Is there an ffprobe command I can run to see if an mov file that I have is audio-only or contains video as well? I have various mov files, some of which are audio dubs and some of which are full videos.
ffprobe gathers information from multimedia streams and prints it in human- and machine-readable fashion. With ffprobe, you can print minute but handy details about your videos (pts, dts, frame-rates, pixel formats, picture types, etc.).
“The ffprobe is a Linux command used to retrieve information from multimedia files. The command then displays the output in a machine or human-readable format. With ffprobe, you can gather information, such as the size, bit rate, height, width, codecs, and pixel format of the multimedia stream.
codec_type
ffprobe -loglevel error -show_entries stream=codec_type -of default=nw=1 input.foo
Example result:
codec_type=video
codec_type=audio
If you have multiple audio or video streams the output will show multiple video or audio entries.
ffprobe -loglevel error -show_entries stream=codec_type -of default=nw=1=nk=1 input.foo
or:
ffprobe -loglevel error -show_entries stream=codec_type -of csv=p=0 input.foo
Example result:
video
audio
ffprobe -loglevel error -show_entries stream=index,codec_type -of csv=p=0 input.foo
Example result:
0,video
1,audio
In this example the video is the first stream and the audio is the second stream which is the norm but not always the case.
ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 input.foo
Example result for input with audio:
audio
If the input does not have audio then there will be no output (null output) which could be useful for scripted usage.
ffprobe -loglevel error -show_entries stream=codec_type -of json input.mkv
Example result:
{
"programs": [
],
"streams": [
{
"codec_type": "video"
},
{
"codec_type": "audio"
}
]
}
If you want different output formatting (ini, flat, compact, csv, xml) see FFprobe Documentation: Writers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With