[MEncoder-users] A/V sync problems

Corey Hickey bugfood-ml at fatooh.org
Fri Aug 3 06:32:27 CEST 2007


Grozdan Nikolov wrote:
> On Friday 03 August 2007 05:59, Corey Hickey wrote:
>> Grozdan Nikolov wrote:
>>> Hi,
>>>
>>> I'm having a problem with a soft telecined NTSC DVD. During playback time
>>> of this DVD, mplayer repeatedly reported frame rate switching between
>>> 23.97 and 23.976 fps. After watching the movie, I decided to encode it
>>> and I used the pullup filter to remove the telecine from it...
>>>
>>> -vf pullup,softskip,scale=608:384 -ofps 24000/1001
>> What was your full command line?
> 
> Pass 1
> 
> mencoder dvd://1 -dvd-device /home/microchip/DVD -ofps 24000/1001 -vf 
> pullup,softskip,crop=720:480:0:0,scale=608:384:0:0 -sws 10 -nosound -ovc 
> x264 -x264encopts 
> pass=1:crf=19:turbo=1:me=umh:me_range=19:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:nobrdo:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:bime:frameref=3:bframes=4:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=5:chroma_me:cabac:deblock -passlogfile /home/microchip/.h264enc/h264.log -o /dev/null 
> 2>/dev/null
> 
> Pass 2
> 
> mencoder dvd://1 -dvd-device /home/microchip/DVD -ofps 24000/1001 -vf 
> pullup,softskip,crop=720:480:0:0,scale=608:384:0:0 -sws 10 -aid 128 -channels 
> 4 -oac faac -faacopts mpeg=4:br=170:object=2 -ovc x264 -x264encopts 
> pass=2:bitrate=1070:me=umh:me_range=19:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:nobrdo:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:bime:frameref=3:bframes=4:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=5:chroma_me:ssim:cabac:deblock -passlogfile /home/microchip/.h264enc/h264.log -o /home/microchip/H264.avi
> 
> does it has something to do with me not adding -fps 30000/1001 in addition 
> to -ofps 24000/1001 ?

No... I don't know what's wrong, but unless you get a better response, 
here's what I suggest:

1. Get rid of "-sws 10" and every x264 option that slows down the
encoding. You want to be able to test quickly.

2. Use "-oac copy" for handling sound in _both_ passes. Having different 
sound options in each pass is a bad idea because mencoder will handle 
A-V sync slightly differently, and drop different frames; x264 (and 
lavc, etc.) base their 2nd-pass encoding decisions on the sequence of 
frames seen in the first pass, and that sequence is altered if different 
frames are dropped. Unless I'm mistaken, using different sound options 
shouldn't actually mess up the A-V sync, but I might be wrong.

3. Do a test encode and see what happens. If it encodes fine, try to 
work backwards from there. If you have the same problem, take a close 
look and see if there's a constant A-V drift or if there's a 
discontinuity (fine before, desync after). Report back here for more 
help if you need.

-Corey



More information about the MEncoder-users mailing list