View Full Version : Bitrate of each frame in a H.264 file?
ssuave
28th June 2012, 19:02
Hi,
I wonder how can we compute/extract bit-rate for each frame of an H.264 encoded video file?
Parse the bit-stream somehow and then collect this info but how?
Any ideas/hints on it?
Thanks!
Ma-Xell
30th June 2012, 13:29
Hi,
Bitrate is usually specified in kbit or mbit per second and if your video is for example 25 frames in a second, then its very simple.
This of course would give the average for one frame across the whole video.
But why would you need this info?
ssuave
30th June 2012, 13:36
Hi,
Bitrate is usually specified in kbit or mbit per second and if your video is for example 25 frames in a second, then its very simple.
This of course would give the average for one frame across the whole video.
But why would you need this info?
Hi,
Thanks but averaging doesn't seem to be good solution for me. I need the exact bit-rate for each encoded frame, otherwise known as 'residual frame' obtained after motion compensation.
Andouille
30th June 2012, 13:50
ffdshow has an option for displaying the size of each frame.
If it is not enough for ya, since ffdshow is based on ffmpeg, you should have some command in ffmpeg to output a log with the frame number/type/size (I guess)
Guest
30th June 2012, 13:53
I wonder how can we compute/extract bit-rate for each frame of an H.264 encoded video file?
Parse the bit-stream somehow and then collect this info but how? If you want to create your own code for this, rather than using an existing utility to dump the frame sizes, you get the H.264 spec and read the part where it tells how to recognize the start of a new frame in the bitstream. Then you parse the bitstream to find these boundaries. The boundaries let you determine the frame sizes. You have the frame rate and so you have the time per frame. Now you have everything you need to calculate the bitrate for any frame.
If you are asking how to parse H.264, then that is also described in the spec.
There is sample code in the JM reference decoder that I used as the basis for the H.264 parsing in my tools.
upyzl
1st July 2012, 03:11
http://forum.doom9.org/attachment.php?attachmentid=12841&stc=1&d=1341108643
obieobieobie
3rd July 2012, 18:33
It's actually impossible to have a bit rate for a still image.
Guest
3rd July 2012, 18:42
It's actually impossible to have a bit rate for a still image. If you have a defined display time for the image then the concept of bitrate for the image has a meaning.
poisondeathray
3rd July 2012, 18:57
A free way is ffdshow's osd (checkmark "coded frame size"), it has option to print out csv file
A non free way is to use a stream parser like elecard streameye
obieobieobie
4th July 2012, 16:26
If you have a defined display time for the image then the concept of bitrate for the image has a meaning.
Yes, you are of course correct.
ssuave
25th July 2012, 14:07
Hi,
Thanks all. I appreciate it!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.