I noticed that simply using
i=0.7 && ffmpeg -i delay1.mp4 -filter:a "atempo=$i" -vf "setpts=(PTS-STARTPTS)/$i" output-$i.mp4
always had a significant a/v sync issue.
I tried jogging the source first:
ffmpeg -i input.mp4 -itsoffset 0.3 -i input.mp4 -vcodec copy -acodec copy -map 0:1 -map 1:0 delay1.mp4
and then slowing down the resulting de-sync'ed video(delay1.mp4
), but it still had sync issues.
I wound up discovering, when I converted just a clip (eg. -t 30
) they retained the itsoffset
I was trying for, and remained correctly sync'ed.
So, in the end I used the (0.3
) desync-ed input (delay1.mp4
) with a -t <duration>
argument:
ffmpeg -ss 0:0 -i delay1.mp4 -filter:a "atempo=$i" -vf "setpts=(PTS-STARTPTS)/$i" -t <DURATION> output-$i.mp4 && open output-$i.mp4
DURATION varies inversely with the value of $i
-- trial and error was used to find an approximately correct duration for each rate.
Resources used: