[MPlayer-users] introducing DVD-to-DivX approach that fixes A/V sync problems

Rich Felker dalias at aerifal.cx
Thu Jul 7 21:42:15 CEST 2005


On Wed, Jul 06, 2005 at 12:29:40PM +0200, Joachim Jautz wrote:
> On Tue, Jul 05, 2005 at 01:33:03PM -0400, Rich Felker wrote:
> > 1, using frameno.avi. STRONGLY discouraged. it will not work with any
> > inverse telecine, frame decimation, etc., which are needed for most
> > movies.
> 
> Okay, Martin Collins pointed that out, too. I do not stick to that
> frameno-method if there is a better way.
> 
> But, let's look at it from a practical point of view. The problem
> is that using the frameno.avi _seems_ to be the only way to
> achieve these goals:
> 
> - the video is to be encoded only once (in two passes, of course)
> - multiple audio tracks (e.g. `en' and `de') are desired; moreover
>   it would be nice if these audio tracks were
>   * MP3 encoded (instead of -oac copy)
>   * `normalized' or in other words: not so silent that you have to
>     pump up your stereo to volume `blow it' ;)
> - each audio track is to be mixed to the video resulting in one
>   stand-alone movie file
> - target format is MPEG4 / DivX5
> 
> My assumption is that the recommended way that is described in the
> mplayer documentation requires to encode the video twice if you
> want to get two different language versions.

Try this:

dump audio to fifo with: mplayer -ao pcm ...
encode from fifo with: lame ...
(repeat for each audio track)
encode video pass 1, with: mencoder -audiofile lang1.mp3 -oac copy ...
encode video pass 2, with: mencoder -audiofile lang1.mp3 -oac copy ...
use whatever program you like to mux all the other audio tracks in too

Even for just one audio track, this is the only clean way I know to
avoid a/v desync with mencoder..

> > 2, 'normalizing' audio. if you normalize to maximize peak, you WILL
> > generate SERIOUS distortion when encoding with any frequency-domain
> > audio codec (i.e. any decent non-lossless codec). the headroom away
> > from peak is needed to prevent clipping in the transformations. you
> > should either normalize rms instead (to a moderate value, not high),
> > or do no normalization at all!
> 
> I'm sure there are scenarios in which your warning is good advice
> and has to be considered.

No, "there are scenarios" is incorrect. PSNR is ALWAYS significantly
lower, and distortions can be heard, if you peak-normalize then encode
to mp3, vorbis, etc.

> Regretfully I cannot see why there should occur distortion when
> - dumping audio to a wave file
> - adjusting the file so that its maximum sample is at full scale
>   which just gives a file the maximum volume possible without
>   clipping (cf. [1])
> - encoding the wave file into MPEG Layer 3
> 
> Do I miss some important technical detail?

Yes, the one I described above.

> If the distortion were
> `SERIOUS', it would be audible, I assume? To me the result sounds
> perfect.

Your ears are bad. Don't feel bad about it, mine are too. But people
with good ears will writhe in pain listening to your bad encodes.

Rich




More information about the MPlayer-users mailing list