Getting video dimension / resolution / width x height from ffmpeg

Use ffprobe Example 1: With keys / variable names ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 input.mp4 width=1280 height=720 Example 2: Just width x height ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x input.m4v 1280×720 Example 3: JSON ffprobe -v error -select_streams v -show_entries stream=width,height -of json input.mkv { “programs”: [ ], “streams”: [ … Read more

Using ffprobe to check if file is audio or video only

To output the 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. Same as above but output just the values 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 … Read more