[MEncoder-users] a/v sync problems

Jon Drukman jdrukman at gmail.com
Tue Feb 3 20:57:43 CET 2009


Alejandro Vargas wrote:
> 2009/2/3 Jon Drukman <jdrukman at gmail.com>:
>> I've got a recipe that works for lots of different types of videos,
>> using mplayer/mencoder to extract the video and audio and convert to
>> H.264.  I use MP4Box to recombine the streams.
> 
> In my experiencie, the problems of a/v sync happens when audio is not
> compressed/converted at the same time of the video.

i generally have no problems, as long as the source video has a constant 
frame rate.


> Try to do ALL the
> work using mencoder, or at least, leave the container conversion to
> another program but do not compress audio and video in two different
> processes.
> 
> Even using only mencoder, a process having mencoder -oac copy -ovc
> lavc [etc. etc.] can result on a/v sync problems. The solution is
> mencoder -oac mp3lame -ovc lavc or something else that encodes both
> streams (audio and video) in the same process.

ok i tried making a flash video using:

/usr/local/bin/mencoder "$1" -o testout.flv -noskip \
     -of lavf -ovc lavc -oac mp3lame -lameopts q=7  \
     -lavcopts vcodec=flv:vbitrate=350 \
     -vf scale=320:-10:noup=1,harddup -srate 22050 -af lavcresample=22050

and the audio & video go out of sync.

it prints tons of "duplicate frame(s)" errors.

Video stream:  370.176 kbit/s  (46272 B/s)  size: 2942666 bytes  63.595 
secs  1164 frames

Audio stream:   51.205 kbit/s  (6400 B/s)  size: 410310 bytes  64.104 secs

notice the lengths are almost 2/3rds of a second off.

-jsd-




More information about the MEncoder-users mailing list