Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th June 2012, 19:02   #1  |  Link
ssuave
Registered User
 
ssuave's Avatar
 
Join Date: Jan 2012
Location: Sweden
Posts: 18
Bitrate of each frame in a H.264 file?

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!
ssuave is offline   Reply With Quote
Old 30th June 2012, 13:29   #2  |  Link
Ma-Xell
Somewhere Back in Time
 
Ma-Xell's Avatar
 
Join Date: Jul 2008
Location: Hungary
Posts: 61
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?
Ma-Xell is offline   Reply With Quote
Old 30th June 2012, 13:36   #3  |  Link
ssuave
Registered User
 
ssuave's Avatar
 
Join Date: Jan 2012
Location: Sweden
Posts: 18
Quote:
Originally Posted by Ma-Xell View Post
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.
ssuave is offline   Reply With Quote
Old 30th June 2012, 13:50   #4  |  Link
Andouille
Registered sausage
 
Andouille's Avatar
 
Join Date: May 2012
Posts: 78
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)
Andouille is offline   Reply With Quote
Old 30th June 2012, 13:53   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally Posted by ssuave View Post
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.

Last edited by Guest; 30th June 2012 at 13:58.
Guest is offline   Reply With Quote
Old 1st July 2012, 03:11   #6  |  Link
upyzl
zj262144
 
upyzl's Avatar
 
Join Date: Sep 2010
Posts: 105
Attached Images
 
__________________
MPC-HC 1.7.8 / LAV Filters 0.64+ (tMod) / XySubFilter 3.1.0.705 / madVR 0.87.14

Direct264 Mod (src & win32 builds): code.google.com/p/direct264umod (maybe outdated)
upyzl is offline   Reply With Quote
Old 3rd July 2012, 18:33   #7  |  Link
obieobieobie
Registered User
 
Join Date: Mar 2004
Posts: 182
It's actually impossible to have a bit rate for a still image.
obieobieobie is offline   Reply With Quote
Old 3rd July 2012, 18:42   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally Posted by obieobieobie View Post
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.
Guest is offline   Reply With Quote
Old 3rd July 2012, 18:57   #9  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 4,966
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
poisondeathray is offline   Reply With Quote
Old 4th July 2012, 16:26   #10  |  Link
obieobieobie
Registered User
 
Join Date: Mar 2004
Posts: 182
Quote:
Originally Posted by neuron2 View Post
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.
obieobieobie is offline   Reply With Quote
Old 25th July 2012, 14:07   #11  |  Link
ssuave
Registered User
 
ssuave's Avatar
 
Join Date: Jan 2012
Location: Sweden
Posts: 18
Hi,
Thanks all. I appreciate it!
ssuave is offline   Reply With Quote
Reply

Tags
bitrate, frame, h.264/avc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.