[MPlayer-users] Own bitrate calculation (Index size predictable?)

Andre Hinrichs hinrichs at mpia-hd.mpg.de
Tue Aug 19 17:49:00 CEST 2003


Hi List!

For a little script I want to do the bitrate calculation for my own.
This works (nearly) good. The problem I have is the unpredictable size of the 
index. For instance I have a movie in MPEG and I want to recode it to fit on 
two CDs means a final size of 1400 MByte. After doing the audio pass I get 
the size of the audio stream which is in this case 178922029 Bytes and I get 
the number of video frames which is 252417. I calculate the video bitrate 
with the following formula:

vbr=(totalsize-audiosize)*fps*8/frames

Which results in my case to

(1468006400-178922029)*25*8/252417

Result is 1021392.

When I use this exact bitrate with mencoder the output says the following at 
the end:

Video stream:  979.712 kbit/s  (122464 bps)  size: 1289178718 bytes  10527.000 
secs  252417 frames

Audio stream:  135.965 kbit/s  (16995 bps)  size: 178920463 bytes  10527.478 
secs

That looks very good, since 1289178718+178920463=1468099181 (1400.09 MByte)

That's very close to what I want to have, but the file size is 1484460110 
Bytes which is 1415.69 MByte.

I assume the extra space is for the index so the question is how to predict 
the size of the index after the audio pass so that I can calculate a real 
good bitrate?

Does the size of the index directly depend on the number of video frames or 
are there more values to deal with?


Andre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20030819/514b0836/attachment.pgp>


More information about the MPlayer-users mailing list