[MPlayer-users] Animatrix and -delay workaround

Clemens Wächter clemenswaechter at web.de
Mon Apr 7 14:46:07 CEST 2003

On Mon, 7 Apr 2003 20:55:21 +1000
Richard Jones <richardjones at optushome.com.au> wrote:

> [Automatic answer: RTFM (read DOCS, FAQ), also read
> DOCS/bugreports.html] Is there any chance of being able to play the
> movies without resorting to trickery?
> I tried the -dumpaudio suggestion made by gabor, but couldn't figure
> how to make it play the audio I'd dumped. The suggestion is here:

Well I fear you can't play it without trickery. Instead of working
around the problem I decided to fix it once for all. The Problem
ist the .mov format and the fix is the avi/ogm format ;-)
I will post my way to fix it, it may not be the best but it works
quite well imho.

First, I fix the audio. As gabor said, you need faad for this:

mencoder -ovc frameno -oac pcm -aid 2 -o framenointro.avi detect_640_dl.mov
mencoder -ovc frameno -oac pcm -aid 1 -o framenomain.avi detect_640_dl.mov

I convert it to pcm because I'm goint to use oggenc on this.

mplayer -dumpaudio framenointro.avi
mv stream.dump x
mplayer -dumpaudio framenomain.avi
cat x stream.dump > audio.wav
oggenc -r -o audio.ogg audio.wav

Ok, after a few minutes, the audio is fixed. You can delete all the
files except for audio.ogg and the .mov
Let's start fixing the video.

mencoder -ovc xvid -nosound -xvidencopts bitrate=y -fps 15 -o vdieo.avi detect_640_dl.mov

Of course, you enter your prefered bitrate for y. You can also choose another
video codec if you want to.
This produces the video stream but its too long for the audio, 
this means that you have to correct the fps of the video.
Now determine the length of the audio.ogg
Oggenc's time value is not the one you shoud use, otherwise it gives a 
bad sync. I don't know whose fault it is, wheter mencoder's or oggenc's.
So, try it with

mplayer -ao null -speed 100 audio.ogg

So, take the length of the encoded video, divide it by the length of the audio
and multiply it with 15. Be sure to calculate it as precisely as possible or
video will get out of sync by about 1 sec whitch is annoying.
You should get something over 20, in my case it was 24.00254237, so lets
fix the fps:

mencoder -ovc copy -fps 24.00254237 -o video-fixed.avi video.avi

Ok, now our video stream should be excactly as long as the video.
time to multiplex it:

ogmmerge video-fixed.avi audio.ogg -o output.ogm

And now, your output.ogm should have a good sync and it should play
nicely. I admit this is time and space consuming but fixes the video
well, imho.


More information about the MPlayer-users mailing list