[MEncoder-users] Target file size too big wrt bitrate

Giacomo Comes comes at naic.edu
Sat Apr 7 00:37:24 CEST 2007


On Fri, Apr 06, 2007 at 03:39:52PM -0600, Joey Parrish wrote:
> On 4/6/07, Mariusz Zynel <sysadm at amikom.com.pl> wrote:
> >I'm encoding a movie from DVD to DIVX in three passes. First the
> >audio is encoded:
> >
> >mencoder -ovc frameno -o frameno.avi -oac lavc -lavcopts
> >acodec=ac3:abitrate=96 -alang pl -aid 131 some_file
> >
> >Then two passes to encode the video stream go:
> >
> >mencoder -o /dev/null -oac copy -ovc lavc -lavcopts
> >vcodec=mpeg4:vbitrate=980:vhq:vpass=1:turbo -vf scale=640:360 some_file
> >
> >mencoder -o movie.avi -ffourcc DIVX -oac copy -ovc lavc -lavcopts
> >vcodec=mpeg4:vbitrate=980:vhq:vpass=2 -vf scale=640:360 some_file
> 
> Try this:
> mencoder -o movie.avi -ffourcc DIVX -oac copy -ovc lavc -lavcopts
> vcodec=mpeg4:vbitrate=980:vhq:vpass=2 -vf scale=640:360 some_file
> -audiofile frameno.avi
> 
> I think that without -audiofile option, your -oac copy is copying the
> _original_ audio track from some_file.  If the original is much larger
> than your re-encoded 64 kbit, then this might account for the
> difference.
> 
> I think older versions would load frameno.avi automatically.  New SVN
> does not seem to.  From the manual:
> 
> >?$B!]frameno-file <filename> (DEPRECATED)
> >
> >Specify the name of the audio file with framenumber mappings created in 
> >the first
> >(audio only) pass of a special three pass encoding mode.
> >NOTE: Using this mode will most likely give you A-V desync. Do not use it.
> >It is kept for backwards compatibility only and will possibly be removed 
> >in a
> >future version.
> 
> So if you want the old behavior, you could use -frameno-file
> frameno.avi.  However, since it is noted that you could lose sync, I
> would suggest instead -audiofile.  In my brief tests just now, I did
> not seem to lose sync this way.

The proper way to go, is:
1) get the suggested video bit rate
mencoder -ovc frameno -o frameno.avi -oac lavc -lavcopts
acodec=ac3:abitrate=96 -aid 131 some_file
(-alang is not necessary because you select the audio stream with -aid)

2) first pass
mencoder -o /dev/null -aid 131 -oac lavc -ovc lavc -lavcopts
acodec=ac3:abitrate=96:vcodec=mpeg4:vbitrate=980:vhq:vpass=1:turbo -vf scale=640:360 some_file

3) second pass
mencoder -o movie.avi -ffourcc DIVX -oac lavc -ovc lavc -lavcopts
acodec=ac3:abitrate=96:vcodec=mpeg4:vbitrate=980:vhq:vpass=2 -vf scale=640:360 some_file

Also you should read a more recent documentation and use more appropriate 
video encoding options (in order to have better quality with the same 
file size)

Ciao
Giacomo 



More information about the MEncoder-users mailing list