[MEncoder-users] some minutes delay between audio and video

Bill Crockett wsc4 at optusnet.com.au
Fri Jan 6 02:24:47 CET 2012


On 6/01/2012 12:39 AM, Malte Schünemann wrote:
> On 01/04/2012 03:45 AM, Bill Crockett wrote:
>>
>>
>> On 31/12/2011 9:04 AM, Malte Schünemann wrote:
>>> I am frequently converting videos coming via satellite as transport 
>>> stream. I recently experienced a strange delay between the audio and 
>>> the video part that is in the range of minutes.
>>>
>>> The problem happens only if I attempt to cut out advertisings - so 
>>> far I only observed the problem at the beginning of the file 
>>> (cutting off the first 5 minutes). I tried to overcome the problem 
>>> with -audio-delay, but had no success.
>>>
>>> My options are usually the following.
>>>
>>> -ofps 25 -hr-edl-seek -demuxer lavf -oac  lavc -ovc lavc -of mpeg
>>> -mpegopts format=dvd:tsaf -vf scale=720:576,harddup
>>> -srate 48000 -af volnorm=2:0.15:lavcresample=48000 -lavcopts 
>>> vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=9800:keyint=25:vstrict=0:acodec=ac3:abitrate=192
>>> -ofps 25 -edl file.edl -o video.mpg video.ts
>>>
>>> Thanks
>>>   Malte
>>> _______________________________________________
>>>
>>
>> I changed a few parameters to suit my test video "videoTS.mpg" which 
>> is an MPEG-TS
>>
>> mencoder -fps 25 -oac lavc -ovc lavc -of lavf -lavfopts format=mpg 
>> -vf crop=512:560:102:8,harddup -lavcopts 
>> vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=8000:vbitrate=4854:keyint=25:vstrict=0:acodec= 
>> /
>> mp2:abitrate=192:autoaspect -delay 0.125 -ofps 25 -o video.mpg 
>> videoTS.mpg
>>
>> I did not use Edit Decision List options because I'm only trying to 
>> get the A/V  in sync.  I found using -demuxer lavf printed out a lot 
>> of errors.  Also, -of mpeg caused many errors (I don't know why), so 
>> I changed it to -of lavf.  -vf crop is for my video for testing.  I 
>> dropped the -srate and -af as I did not need them.  vbitrate  and 
>> maxrate are for my taste.  acodec=ac3 caused a problem, so changed to 
>> mp2.
>>
>> -audio-delay only works with -of avi.  If you are using a different 
>> muxer, then you must use -delay instead.  Delay relative to video: 
>> -125ms was retrieved via MediInfo from the videoTS.mpg file.  I could 
>> not find this info via MPlayer or FFprobe.  After the encode, the A/V 
>> in video.mpg was in sync.  Without -delay, it was up to 300 ms out.
>>
>
> Many thanks for suggestions. However, my scenario appears to be 
> different. Without EDL I do not have this problem ... and if I use a 
> EDL, the delay in in the range of minutes and cannot be adjusted via 
> option -delay. I tried your cmd line, and the situation remained 
> unchanged.
>
> Malte

When I was experimenting with your command line, it did produce a huge 
delay (without any EDL).  This was in the range of 10's of seconds.  
However, I had changed an option at the time, but I can't remember which 
one.  I could not use your original command line; it produced too many 
errors.

I found in the past that the EDL has to start at the very beginning.  I 
recorded a film which started right at the beginning, then the first 
advertisement came in 5 minutes later.  That is when I hit 'i' to mark 
the start of the skip block and preceded with the rest of the video to 
mark the start or end of skip blocks.  The video ended up being way out 
of sync after the encoded.  I then cut out a few seconds of the start of 
the film by editing the EDL file.   For example: Start:  65186.523438  
Stop: 65188.000000  as the first record.  It fixed the problem, even 
though I lost a few seconds of the start.


More information about the MEncoder-users mailing list