Log in

View Full Version : *REAL* average bitrate of an mpeg-2 vbr video stream..?


fried chicken
4th March 2006, 17:46
I've been searching for a formula/method to calculate the REAL average bitrate of an mpeg-2 video stream but can't seem to find this info anywhere. If anyone knows the proper way to accurately do this, PLEASE share! Elecard's StreamEye Tools software does it but the source code isn't available for it.

Thanks fellas.

Oline 61
4th March 2006, 18:01
First find out how many bytes the stream is (right click -> properties).

Then multiply by 8 to get bits.

Divide by 1000 for kilobits.

Divide by seconds for kbps (kilobits per second).

Hellworm
4th March 2006, 18:05
bitrate = kb / s

Average Bitrate = File size in kb / lenght in seconds

Edit: Oline 61 was faster ( and more detailed )

fried chicken
4th March 2006, 18:11
So I have to count the bytes of all the i-frame, p-frame, b-frames or is there a shortcut?

Thanks for such a fast response!

Oline 61
4th March 2006, 18:52
No.......

1. Right Click on file
2. Click properties
3. Look for the number in the red box:
http://img332.imageshack.us/img332/9306/untitled6er.gif
4. Multiply it by 8
5. Then divide it by 1000
6. Then divide it by the number of seconds in the file (To find this, divide the number of frames by the framerate).

foxyshadis
4th March 2006, 20:03
If you want a video stream only out of a vob (likely not, but worth a try), a parse-thru via dgindex will gather that in its info box.

fried chicken
4th March 2006, 21:38
Oline - I appreciate your suggestion but I'm interested in the true average bitrate of the video stream only. Your method doesn't factor out audio, subtitles or bytes used for headers and so on.

foxyshadis - I've looked into DGIndex (version 1.4.6 I believe it was) but if I remember correctly it only gives the average bitrate of the entire file, not each separate stream individually. Although I suppose I could parse the bitrate of the audio and then subtract it from the total but since I'd be parsing the file, I might as well parse the information I'm looking for.

It sounds like I need to find the total bytes used by the i-frames, b-frames and p-frames, add them together and then do some math...?

Oline 61
4th March 2006, 22:17
Do you know the bitrate of the audio? Is it CBR or VBR?

foxyshadis
4th March 2006, 22:19
I was going off of memory, but here's the thread pertaining to it:
http://forum.doom9.org/showthread.php?t=106932

Mug Funky
6th March 2006, 15:35
actually, i'd like a good way of calculating mux overhead from DVD. it can be a real killer. it seems to increase per-stream, but there's things like multiangle and subtitles, or several audio tracks of several different types... i just can't tell if an overly tight encode isn't going to oversize by 300 megs come compile time.

...so if you were to estimate the video bitrate by subtracting audio bitrates from total size/time, you'd actually end up with video bitrate + mux overhead for all streams, which is not at all what you want :)

try bitrateview. multiply all it's results by 1.024 (kibi/KB stupidity) and don't take it's peak bitrate measure too seriously - it's always wrong, sometimes by quite a bit.