[MPlayer-users] Audio & video file sizes don't add up to actual file size (mencoder)

D Richard Felker III dalias at aerifal.cx
Fri Jul 9 08:44:00 CEST 2004


On Tue, Jun 22, 2004 at 12:07:31AM +0200, Pit Cuppens wrote:
> Dear all,
> 
> I tried encoding a movie with mencoder using
> 
> mencoder dvd://1 -dvd-device VIDEO_TS/ -o movie.avi -alang en -vf 
> crop=720:436:0:70,scale=416:-3 -oac lavc -ovc lavc -lavcopts acodec=ac3:
> abitrate=128:vcodec=mpeg4:vbitrate=829:vhq:vqmin=2:v4mv:trell:autoaspect:
> vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01:vpass=2 -endpos 6060
> 
> This works fine, and just before mencoder ends, it outputs
> the video and audio bitrate: the audio bit rate is 128kbit
> and the video rate around 828kbit -- which is wonderful.
> 
> Now my problem is the following. Mencoder also outputs
> (right after the above bitrates, in parenthesis) the number
> of bytes used for video and audio. Again, these numbers
> are exactly what I have expected. However, if I add them
> together, I get an (expected) total file size which is
> *much* smaller (around 30mb) than the actual size of the
> movie (as obtained via 'ls' on Unix). Obviously, mencoder
> needs some more space for the AVI-format, header, etc.,
> and does *not* take this into account in the bitrates.
> Is this correct?
> 
> And is it also correct that this additional space is
> proportional to the movie size? (Because it seems to
> me that 30mb is a little bit too much for file header,
> etc.) Is there a way to predict this additional space?
> 
> Many thanks for your answers,

The additional space is 24 bytes per frame. A frame means either a
video frame or an audio frame. MP3 audio usually has around 38 frames
per second at normal samplerates. So you can count on about 1300-1600
bytes per second wasted on AVI crap, depending on your video framerate
and audio samplerate. (To get the exact audio frame rate, divide the
samplerate by 1152. Or by 576 if you're using a low "MPEG-2"
samplerate, i.e. below 32000.) Finally there are a few bytes for the
main header and stuff, but those are fixed size and don't grow with
the length of the movie.

Rich




More information about the MPlayer-users mailing list