[Libav-user] Syncing multiple sources.
Hristo Ivanov
hivanov.ffmailing at gmail.com
Thu Jan 31 13:41:14 EET 2019
Hi Carl.
> How can I reproduce this (major?) issue with ffmpeg (the application)?
.\ffmpeg.exe -y -loop 1 -r 30 -t 5 -i .\frame.png -filter_complex
"[0]settb=expr=1/60[tb];[tb]split[s0][s1];[s1]setpts=PTS+1[offset];[s0][offset]vstack[out]"
-map [out] -c:v h264 -vsync 0 -f mp4 out.mp4
Here is the previous filter broken down:
'-loop 1 -r 30 -t 5 -i .\frame.png' and '[tb]split[s0][s1]' just an easy
way to get two sources.
'[0]settb=expr=1/60[tb]' as I explained in my follow up email the
timebases in use are also relevant.
'[s1]setpts=PTS+1[offset]' as also explained in my follow up email the
ptss must be interleaved.
'-vsync 0' we must cancel the vsync, having the vsync active is the
equivalent to the solution I proposed in my first email.
I know that having the ptss of the two sources interleaved is uncommon, in
fact in my program it happens because once decoded the frames I have some
logic that modifies the ptss.
Here is a less shady case, sources with different framerate, where this
problems can also be seen:
.\ffmpeg.exe -y -loop 1 -r 30 -t 5 -i .\frame.png -loop 1 -r 25 -t 5 -i
.\frame.png -filter_complex "[0][1]vstack[out]" -map [out] -c:v h264 -vsync
0 -f mp4 out.mp4
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190131/2e14c1fe/attachment.html>
More information about the Libav-user
mailing list