[MPlayer-users] Two-passes encoding - What happens exactly?

The Wanderer inverseparadox at comcast.net
Mon May 31 22:11:22 CEST 2004


Alain Barthélemy wrote:

> When I started using MPlayer/Mencoder I had been told to use two-pass
> encoding to reduce video bitrate and file size. Thus I used
> two-passes encoding.
> 
> Now I burn my files on DVD's and I don't care if the file is more
> than 700Mb.
> 
> I still have a better quality (subjective?) with a video bitrate of
> 1800kbit/s. Size of file thus about 1400Mb.
> 
> I read though on this mailing-list that two-passes encoding improve
> quality. I don't disagree of course but I would like to know how it
> happens. On the man page, the only thing I read is "vpass activates
> two pass mode etc ...".
> 
> --------------
> 
> Let's have an example. I do a lot of encoding of TV signal. TV signal
> is never of optimum quality of course. Here is my instruction line:
> 
> mencoder -tv driver=v4l:width=640:height=480:amode=0 -ovc lavc 
> -lavcopts vcodec=mpeg4:vbitrate=1800:mbd=2:acodec=mp3:v4mv -oac 
> mp3lame -lameopts cbr:br=96:mode=3 -vf crop=620:460,pp=tn/lb,scale 
> -zoom -xy 640 -sws 1 tv:// -o movie.avi -endpos <sec>
> 
> I am not original. I just try what I read on the list.

Any particular reason you don't use -oac lavc -lavcopts
acodec=mp3:abitrate=96:... ? Do you just really need mono sound?

> Now if I want to crop the picture I suppose I do:
> 
> mencoder -oac copy -ovc lavc -lavcopts vcodec=mpeg4,vpass=1|2 -vf 
> crop=620:380,pp=tn/lb,scale -zoom -xy 640 -sws 1 -o 
> /dev/null|movie2.avi
> 
> As I don't fully understand what happens during the two-passes
> encoding, I don't know if I have to recopy all the parameters. I
> explain: -vf is for filtering thus once filtering is done it should
> not be filtered a second time except, I suppose, if I recrop and
> rescale. But post-processing? And software scaler (though I read in
> man page that software scaler had to be used with the -zoom option)?

On this I don't know the engine well enough to say for certain.

> My question is. Do I have to recopy all the options? Sorry if it is
> stupid. Thus if I don't make any change in the resolution, video bitrate and
> size of the movie, I suppose I must type the following line and it should be
> enough:
> 
> mencoder -oac copy -ovc lavc -lavcopts vcodec=mpeg4,vpass=1|2 -o 
> /dev/null|movie2.avi.

Actually, this does not leave bitrate unchanged. It uses the default
bitrate, equivalent to vbitrate=800. Other than that, yes, you are
correct except that...

> Normally I should have a better (re-)encoding.

...depends on what you mean by "better". The end result will be
lower-quality than the original, inevitably because of the transcoding
process; the only possible advantages are A) potentially smaller
filesize and B) it will use lavc's codec rather than whatever it had
before, which may constitute an improvement in compression capability.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

A government exists to serve its citizens, not to control them.




More information about the MPlayer-users mailing list