[FFmpeg-user] -istoffset and -vcodec copy

L. Lee llee040 at sbcglobal.net
Wed Nov 30 01:31:57 CET 2011


I sent this to the Mencoder list today. Maybe you can use it.

> I recently submitted this suggestion for adjusting a/v sync using ffmpeg. I've
> discovered that all the included examples caused the audio to be advanced,
> although the first example incorrectly claims to provide delay for the audio.
> I discovered that to apply delay to the audio, a minus (-) must also precede
> the numeric value, so the first example should read:
> 
> "Make audio 3 seconds later:
> ffmpeg -i input.flv -itsoffset -00:00:03.0 -i input.flv -vcodec copy -acodec
> copy -map 1:0 -map 0:1 output_shift3s-delay.flv"
> 
> I haven't tested to determine whether the order of the "-map" options must be
> reversed between the first and second examples as indicated.
> 
> Anybody know?
> 
> Anyway, to summarize, if the minus (-) before the numeric value is omitted,
> both the original examples serve to advance the audio for the files I've
> tested.
> 
> Thanks.
> 
> Laine
> 
> 
> On 11/8/11 1:27 PM, "L. Lee" <llee040 at sbcglobal.net> wrote:
> 
>> I occasionally have to deal with a stream for which audio seems to begin
>> before video, and MPlayer appears to maintain sync by starting playback at
>> the 
>> point where video enters. When transcoding with MEncoder, I found that I had
>> to disable  -noskip to allow black frames to be created before entrance of
>> the 
>> video so that sync was maintained. That caused some issues that made me
>> change 
>> other options, because I'm having to perform pullup with encoding, but it
>> might be worth trying.
>> 
>> Also, because I have to build ffmpeg to build MEncoder now, it's always
>> available. You can use ffmpeg to offset the sync so you can tell whether the
>> duration is correct. Here are examples (from
>> http://lzone.de/fix+async+video+with+ffmpeg)
>> 
>> Make audio 3 seconds later:
>> ffmpeg -i input.flv -itsoffset 00:00:03.0 -i input.flv -vcodec copy -acodec
>> copy -map 1:0 -map 0:1 output_shift3s-delay.flv
>> 
>> Make audio 3 seconds earlier:
>> ffmpeg -i input.flv -itsoffset 00:00:03.0 -i input.flv -vcodec copy -acodec
>> copy -map 0:1 -map 1:0 output_shift3s-advance.flv
>> 
>> Here's an example for making an iPad (or iPhone) movie's audio about 300
>> milliseconds earlier:
>> 
>> ffmpeg -i inputmovie.iPad.mp4 -itsoffset 00:00:00.3 -i inputmovie.iPad.mp4
>> -vcodec copy -acodec copy -map 1:0 -map 0:1
>> outputmovie.iPad.300ms-advance.mp4
>> 
>> Laine Lee




More information about the ffmpeg-user mailing list