Table of Contents

How to get video/image information with ffmpeg ?

About

To get information about your video with ffmpeg, you would use the ffrpobe 1) utility (installed with ffmpeg)

How to

How to get the video information at the console ?

ffprobe video.mp4

Example of output where you can see the aspect ratio of 1920×1080

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Video Gifts
    artist          : Gerard nico
    encoder         : Lavf58.29.100
    keywords        : Video-Gifts
  Duration: 00:00:39.27, start: 0.000000, bitrate: 3067 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2933 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : Core Media Video
      timecode        : 00:00:00;00
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : Core Media Video
      timecode        : 00:00:00;00

How to get the information in a Json format ?

ffprobe -v quiet -print_format json -show_format -show_streams "input.mp4" > "output.json"