[MPlayer-users] A/V sync problem

T o n g mlist4suntong at yahoo.com
Sat Jan 2 23:03:36 CET 2010


Hi,

Trying to solve a problem that always haunts me: how to solve the A/V 
sync problem?  

Reimar Döffinger recently posted in the mlist:

for this particular example (audio is 2.4 seconds long) -mc 100 works 
mostly fine. . . 
the sync correction and most of the time can be improved with e.g. -mc 100
. . . 

I tried it, but A/V is still drifting further and further apart to almost 
2 seconds. This is what I do:

 mencoder -of avi -oac mp3lame -lameopts abr:br=48:vol=2.2 -ovc x264 -
srate 8000 -vf softskip,harddup -mc 100 -o test.avi test.flv

Pos:1802.9s  27095f (82%) 76.18fps Trem:   1min  38mb  A-V:0.085 [122:23]
Pos:2023.7s  30407f (92%) 76.08fps Trem:   0min  38mb  A-V:0.081 [122:23]
Pos:2201.9s  33081f (100%) 76.22fps Trem:   0min  38mb  A-V:0.054 [121:23]

I know the downloaded .flv files might be problematic, but they play 
flawlessly with xine, mplayer, or vlc. I don't understand why such 
accurate timing cannot be carried forward into the encoded video.

Moreover, I don't understand why the "-mc 100" usage. From the man page:

       -mc <seconds/frame>
              maximum A-V sync correction per frame (in seconds)

Since it is seconds/frame, I thought it would be better to be very small.
Also, from http://www.debianhelp.co.uk/mplayer.htm

". . . The most important A-V sync parameter is "-mc". It means "max A-V
time correction per frame", and defaults to 0.01. For good input, you can 
go down even to 0.0001, but 0.001 is enough for most cases. Note that 
smaller values make playback smoother but slow reaction time to fix A-V
desynchronization (broken/skipped frames, etc.)."

But I've tried -mc 0.05 as well -- it's 15 fps video, and 

 1/15 = 0.0666667 > 0.05 

The reality is neither '-mc 100' nor '-mc 0.05' have any impact/
improvement on the nearly-2-second lag time. 

So, how to solve the A/V sync problem when encoding with mencoder? 

Other options I tried for A/V sync:

 -autosync is not an MEncoder option
 -framedrop is not an MEncoder option
 -correct-pts is not an MEncoder option

Please comment. 
Thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/



More information about the MPlayer-users mailing list