I have a video with variable framerate that I decode into single frames using -vsync passthrough
to avoid duplicate/lost frames. After processing those frames with another application I want to encode them again into an mp4 video that has the exact same timestamps as the original video.
My idea is to input the frames plus the original video and use the timecodes of the latter. Is this possible?
This is my current approach:
ffmpeg -i input/%d.jpg -vsync 0 -i input.mov \
-filter_complex '[0]setpts=PTS[vid1];[vid1]pad=iw*2:ih[vid2];[vid2][1:v]overlay=W/2:0[vid3]' \
-map [vid3] -map 1:a \
-y result.mp4
I do a concatenation of both videos side-by-side to see if they are in sync which they are not...
setpts=PTS
uses the timecodes of the frames so this can not work. However, is there a way of using PTS
from the second video? Something like [0]setpts=PTS{1:v:0}
?