How can I get the resolution (width and height) for a video file from a linux command line?

前端 未结 9 1332
无人共我
无人共我 2020-12-02 10:22

I\'ve been digging through the mplayer/mencoder and ffmpeg documentation and I can\'t seem to come up with anything. I\'m not especially picky as to the out

9条回答
  •  再見小時候
    2020-12-02 10:50

    If you are just interested in the resolution:

    ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width video.mkv
    

    It works also on Windows. This is running right now on my PC to build an index of all files:

    find //Q1207/Film -size +10000k -print -a -exec ./ffprobe.exe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width \{\} \; > //Q1207/Film/index.txt
    

提交回复
热议问题