Skip to content

How to check audio / video file information in FFmpeg?

Now that you understand the importance of knowing which codecs your file formats should conform to. It is useful to have the ability to check the input file format before using FFMPEG commands. Luckily this functionality is native to FFMPEG, the command is as follows:

$ ffmpeg -i input.mp3
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mp3, from 'input.mp3':
  Metadata:
    title           : 1989 MAZDA FAMILIA // Car
    artist          : テレビCM
    track           : 16
    album           : Visual Signals
    date            : 2020
    encoder         : Lavf58.29.100
  Duration: 00:00:16.58, start: 0.023021, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.54
    Side data:
      replaygain: track gain - 13.100000, track peak - unknown, album gain - unknown, album peak - unknown, 
At least one output file must be specified

After the installed FFMPEG version and configuration information the Input section details information like metadata, duration, encoding and more. In the above example it can be noted that input.mp3 is indeed an mp3 with a Lavc/Lavf encoder which I guess is the standard encoding for Bandcamp downloads.

Love FFmpeg? Grab a copy of FFmpeg For Beginners on Kindle or Paperback to learn over 120 ways to master FFmpeg!

buy now on amazon