[MPlayer-users] vbitrate without frameno.avi
Matthias Czapla
dermatsch at gmx.de
Wed Feb 18 20:17:18 CET 2004
On Wed, Feb 18, 2004 at 01:28:44PM -0500, D Richard Felker III wrote:
> On Wed, Feb 18, 2004 at 05:10:10PM +0100, Matthias Czapla wrote:
> > So its now dprecated to use frameno.avi. Ok, but how is one supposed to know
> > the needed vbitrate to get a file with a specific size? Luckily I dont need
> > VBR MP3 so I thought I can just do
>
> Even with VBR mp3 you can do this. The bitrate is very predictable
> over the length of a whole movie, and you can measure it during
> vpass=1 and then adjust the vbitrate slightly during vpass=2 if you
> need to...
Really? I thought the two passes _must_ be run with exactly the same
options? And although I dont need VBR, how do you predict the bitrate for
MP3?
> > 700 * 1024 * 1024 * 8 / movie_length_in_seconds
> > to get the overall bitrate available and subtract the MP3 bitrate from the
> > result to obtain the vbitrate for -lavcopts. But this does not work - the
> > resulting file 745 Mill. Bytes instead of the desired 733.
>
> AVI files have a good bit of overhead, at least 32 bytes per frame...
> This is likely a large part of the problem.
I already thought about this too and was hoping to get some definite
numbers. The bitrates the frameno run displays at the end are always correct
so there has to be a formula to calculate them since mencoder obviously uses
it :)
BTW, this bitrate printed by mencoder at the end of a frameno run is always
exactly the same I get when calculating
(wanted_avi_size - size_of_frameno.avi) / length_in_seconds
where the sizes are in Bits. This indicates that the complete overhead is
already contained in frameno.avi in addition to the MP3 data.
> Maybe you messed up your
> calculations too...? When mencoder finishes, it prints the final
> actual audio and video bitrates. Do they match what you asked it to
> use?
Yes, they match. I asked for vbitrate=748 and mencoder prints:
Video stream: 748.148 kbit/s (93518 bps) size: 638810239 bytes 6830.840 secs 170774 frames
The calculation was:
700 * 1024 * 1024 * 8 / 6831 = 859614 bps overall minus 112 kbps for MP3
yields 748 kpbs for vbitrate.
Maybe I can calculate the AVI overhead per second by taking the file size of
a frameno.avi in Bits divided by the length in seconds and subtracting the
specified bitrate for MP3. I will check that. Thanks so far Rich!
Regards
lal
More information about the MPlayer-users
mailing list