[MEncoder-users] AV sync

James Hastings-Trew jimht at shaw.ca
Sun Sep 23 16:40:57 CEST 2007


Greg Heywood wrote:
> Difficult to tell, but I think it starts out wrong and stay's almost
> constantly wrong. I also thing that when the file is played, the seconds
> value (the amount of time that it has been playing for) is wrong, and it is
> crashing the PC occasionally as well.
>
> On 23/09/2007, James Hastings-Trew <jimht at shaw.ca> wrote:
>   
>> Greg Heywood wrote:
>>     
>>> On 22/09/2007, James Hastings-Trew <jimht at shaw.ca> wrote:
>>>       
>>>> Mencoder maintains a/v sync by dropping or duplicating frames, usually
>>>> at the boundaries of black frames so as not to cause visible stutter.
>>>> Try getting rid of the vf=harddup=1 option in your profile and see if
>>>> sync improves. This is just a guess on my part as to something to try.
>>>>
>>>> Thanks. Tried that, and also tried the following (with and without the
>>>> harddup option).
>>>>
>>>> [ivtv2]
>>>> tv=norm=0:device=/dev/video0:width=720:height=576
>>>>         
>> pvr=abitrate=192:vbitrate=2200000:vpeak=2600000:fmt=ps:aspect=2:arate=32000
>>     
>>>> ofps=25
>>>> ovc=copy=1
>>>> oac=copy=1
>>>> vf=harddup=1
>>>>         
>> What kind of sync problem are you having? Does it start out wrong and
>> stay wrong at a constant value, or does it start out right and drift
>> wrong after a while?

Play back your result in Mplayer, and use the + and - keys to correct 
the audio delay till you find a value that makes things right. Then plug 
the negative of that value into an -audio-delay parameter in your 
encoding options and see if it holds true for all of your recordings.

*−audio-delay <any floating-point number>*


	

Delays either audio or video by setting a delay field in the header 
(default: 0.0). This does not delay either stream while encoding, but 
the player will see the delay field and compensate accordingly. Positive 
values delay the audio, and negative values delay the video. Note that 
this is the exact opposite of the −delay option. For example, if a video 
plays correctly with −delay 0.2, you can fix the video with MEncoder by 
using −audio-delay -0.2.





More information about the MEncoder-users mailing list