Find if video file has audio present in it [duplicate]

I would use FFprobe (it comes along with FFMPEG):

ffprobe -i INPUT -show_streams -select_streams a -loglevel error

In case there’s no audio it ouputs nothing. If there is an audio stream then you get something like:

[STREAM]

index=0

codec_name=mp3

codec_long_name=MP3 (MPEG audio layer 3)

profile=unknown

codec_type=audio

codec_time_base=1/44100

etc

etc…

[/STREAM]

That should be easy enough to parse regardless of the language you’re using to make this process automated.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)