-
HANDY TIP: Using FFprobe for stream analysis
HANDY TIP:
You can easily extract bitrate data and frame types (I,P,B) using FFprobe.
At the time of writing, FFprobe version SVN-r92, Copyright (c) 2007-2009 Stefano Sabatini works for frame analysis amongst many other things. The FFprobe attachment to the trunk of FFmpeg version SVN-r23145, Copyright (c) 2000-2010 the FFmpeg developers is not fully complete. Never fear, it works great anyway. Just install the SVN-r92 FFprobe version and run it manually.
./ffprobe -show_frames -pretty two_pass.mp4
…produces this output:
[FRAME]
codec_type=video
pict_type=I
width=1024
height=576
quality=0
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
repeat_pict=0
reference=3
stream_index=0
size=822.000 byte
pkt_pts=0:00:00.000000
pkt_dts=0:00:00.960000
pkt_duration=0:00:00.040000
file_pkt_nb=1
stream_pkt_nb=1
pkt_flag_key=K
[/FRAME]
…etc.This is repeated for every frame of video which can be a VERY long list. You can filter the list by piping the output to the grep command.
./ffprobe -show_frames -pretty two_pass.mp4 | grep ‘size\|pict_type\|coded_picture_number’
pict_type=I
coded_picture_number=0
size=822.000 byte
pict_type=P
coded_picture_number=1
size=219.000 byte
pict_type=P
coded_picture_number=2
size=515.000 byte
pict_type=P
coded_picture_number=3
size=942.000 byte
pict_type=B
coded_picture_number=5
size=2.292 Kibyte
pict_type=P
coded_picture_number=4
size=3.896 Kibyte
pict_type=B
coded_picture_number=7
size=5.546 Kibyte
…etc.(Note the frame reordering in the structure of the file.)
Now the challenge is to create an open source graphing program for this data.
Any thoughts?
Michael
“half-way to world domination A.K.A. the belligerent blue bike shed”





