Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get ffmpeg information in friendly way

People also ask

How do I get Ffprobe?

ffprobe can be downloaded from OTTVerse's FFmpeg builds page. Download the FFmpeg static build for Windows 64-bit, and when you unzip the file, you'll find three executables – ffmpeg, ffprobe, and ffplay. You can simply open your command prompt, and start using the ffprobe utility.

What is FFmpeg and how it works?

FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing of video and audio files.

What is FFmpeg command?

FFmpeg is an extremely powerful and versatile command-line tool for converting audio and video files. It is free and available for Windows, Mac and Linux machines.


A bit late, but perhaps still relevant to someone..

ffprobe is indeed an excellent way to go. Note, though, that you need to tell ffprobe what information you want it to display (with the -show_format, -show_packets and -show_streams options) or it'll just give you blank output (like you mention in one of your comments).

For example, ffprobe -v quiet -print_format json -show_format -show_streams somefile.asf would yield something like the following:

{
  "streams": [{
    "index": 0,
    "codec_name": "wmv3",
    "codec_long_name": "Windows Media Video 9",
    "codec_type": "video",
    "codec_time_base": "1/1000",
    "codec_tag_string": "WMV3",
    "codec_tag": "0x33564d57",
    "width": 320,
    "height": 240,
    "has_b_frames": 0,
    "pix_fmt": "yuv420p",
    "level": -99,
    "r_frame_rate": "30000/1001",
    "avg_frame_rate": "0/0",
    "time_base": "1/1000",
    "start_time": "0.000",
    "duration": "300.066",
    "tags": {
        "language": "eng"
    }
  }],
  "format": {
    "filename": "somefile.asf",
    "nb_streams": 1,
    "format_name": "asf",
    "format_long_name": "ASF format",
    "start_time": "0.000",
    "duration": "300.066",
    "tags": {
        "WMFSDKVersion": "10.00.00.3646",
        "WMFSDKNeeded": "0.0.0.0000",
        "IsVBR": "0"
    }
  }
}

Now is possible to use -progress - to print friendly info formatted by key=value.

ffmpeg  -i video.mp4 .......-s 1920x1080 -progress - -y out.mp4

speed=5.75x
frame=697
fps=167.7
stream_0_0_q=39.0
bitrate=2337.0kbits/s
total_size=6979778
out_time_ms=23893333
out_time=00:00:23.893333
dup_frames=0
drop_frames=0

You could try ffprobe. The correct command to get JSON output should look like the following:

ffprobe ... -print_format json

Another usage of ffprobe which is nicely parseable:

ffprobe -v error -select_streams v:0 -show_entries stream=width,height,r_frame_rate,bit_rate,codec_name,duration -of csv=p=0:s=x video.mp4

results in:

h264x600x480x25/1x385.680000x542326

-select_streams v:0 selects only the first video stream. If you remove that parameter you get one line for each stream.