[MEncoder-users] Audio/video synchronization bug with MEncoder

Eric Buist buisteri at iro.umontreal.ca
Sun Apr 6 20:30:44 CEST 2008


Hello,
I tried to convert a DivX video to MPEG-2 for DVD using MEncoder
2:1.0~rc1-0ubuntu13.2, and I have many time-consuming difficulties.
The command-line I used was:
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf
scale=720:480,telecine,harddup -srate 48000 -af lavcresample=48000
-lavcopts
vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9000:vbitrate=3350:vratetol=10:keyint=15:aspect=16/9:acodec=ac3:abitrate=128:vstrict=0:trell:mbd=2:dc=10
-ofps 24000/1001 -o out.mpg out.avi
The resolution of the input AVI was 704x288 with 25 fps. I hoped to get
a NTSC resolution of 720x480 by rescaling and setting the aspect ratio
to 16:9. I tried to set the frame rate to 24000/1001, and use soft
telecine to get the 30000/1001 frame rate required for a DVD.
First, encoding was very very long, twice the length as the movie, and I
have a Pentium D 2.8GHz CPU. If I don't use quality-enhancing options, I
sometimes get white pixels appearing in my encodes.  During my first
trials, I was always getting a 4.7GB MPEG file as output. I was trying
to change the vbitrate parameter without any effect. I got more success
after I have set vratetol to 10. I made several tests without quality
enhancing options (trell, mbd, etc.), and I made my final encoding using
the options.
But problems appeared when I played the movie. At the beginning,
everything was fine, but if I seek after a few minutes of video, audio
and video are out of sync. I tried both with Totem and MPlayer, with the
same bad results.
I thought the problem was telecine stuff so I reprocessed my output file
using the command-line:
mencoder -ovc copy -oac copy -of mpeg -mpegopts format=dvd:tsaf:telecine
-o hp1-3350-t.mpg hp1-3350.mpg
I hoped that this way, I could add back soft telecine information into
the MPEG program stream, but I got exactly the same results: A/V sync
problem.
Do I really have to play around with A/V delay to fix that? This is too
much hard work for me, and I don't have the time to do trial and error
with this. If there is no other solution than this, or recompiling from
source to get the most recent version of MEncoder on Ubuntu 7.10, I will
revert to using TMPGEnc with Wine, but I would like to avoid this,
because TMPGEnc seems to have difficulty with AVI files containing MP3
audio.
Thanks in advance.
Eric



More information about the MEncoder-users mailing list