How to determine video codec of a file with FFmpeg

前端 未结 4 1871
无人共我
无人共我 2021-02-06 22:38

I often have problems reading AVI files with my TV\'s DVD player if they are not DivX or Xvid (e.g., DX50 is not readable).

I\'d like to make a fast script to determine

4条回答
  •  再見小時候
    2021-02-06 23:00

    ffmpeg has it. On mac i did it this way :

    first download ffmpeg like this:

    brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
    

    and then run this on the command line:

    ffmpeg -filter:v idet \
        -frames:v 100 \
        -an \
        -f rawvideo -y /dev/null \
        -i ~/Downloads/yourfile.mp4
    

    then check for something like this in the output:

    Duration: 00:00:05.48, start: 0.000000, bitrate: 952 kb/s Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 750x1334, 619 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)

提交回复
热议问题