[MPlayer-users] Re: 3pass audio sync problem

Jonathan Rogers jonner at teegra.net
Sun Jun 29 13:25:20 CEST 2003


Renai wrote:
> When I encode files with 2 pass encoding, using the following commands, I 
> don't have the same problem.
> 
> mencoder -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=1 
> -vop lavcdeint -oac copy stream.dump
> 
> mencoder -o divx.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:aspect=4/3:vpass=2 
> -vop lavcdeint -oac copy stream.dump
> 
> Can anyone enlighten me as to what I am doing wrong here, or is this a 
> limitation of mplayer?

I think you've already solved the problem: just don't use the frameno 
thingy. I really don't know what it's useful for or how it's supposed to 
work. I've asked about it on mailing lists, but never gotten a straight 
answer. Also, it's always a good idea to specify "-ofps", at least for 
NTSC input. In particular, it's necessary if you are encoding film that 
has been telecined. If you don't have NTSC DVDs, you probably have no 
appreciation for what we have to deal with here in the US (count your 
blessings).

Is it that you want to reencode audio instead of copying the audio 
stream from the original? You can just use "-oac pcm" for the first pass 
and "-oac mp3lame" for the second. Of course, you probably want to know 
what video bitrate to use beforehand in order to fit the final video 
into a certain size. You can know how big audio will be if you use CBR, 
but that won't give the best quality.

You can encode the audio as a first step to find out how big it will be. 
Then, encode the two video passes using "-oac pcm", discarding the 
output from the first pass. I've been told that sync could be lost if 
you don't decode audio while encoding video. Finally, remultiplex the 
audio and video into the final target.

I haven't tried this procedure with AVI, since I prefer to use Vorbis 
audio, which doesn't work well in AVI. I use either ogmmerge or mkvmerge 
to produce a final OGM or Matroska file. Read the encoding-tips.txt file 
in the DOCS directory. If you have MP3 audio and AVI video, you should 
be able to multiplex them into a final AVI using mencoder with the 
"-audiofile" option. I've heard bad things about VBR audio in AVIs, 
though, so you may want to use OGM or Matroska anyway, even if the audio 
is MP3.

Jonathan Rogers



More information about the MPlayer-users mailing list