[FFmpeg-user] recording video file with 2 video tracks of two live cams
kumowoon1025 at gmail.com
Wed Apr 10 13:34:02 EEST 2019
> BUT: The videos aren't in sync. The audio and video of the first camera are perfectly in sync (obviously, since the mic is connected to the first camera), but the second camera's video track is about 1.3 seconds ahead.
> So, my questions are:
> - Is this command line of mine too primitive for this to work properly?
> - Is there a way to sync the video tracks? Maybe to delay the first one by those 1.3 seconds?
> - Is there a different approach which potentionally works better?
> (- Does maybe one of you guys happen to know a perfectly working software for this?) (I've searched and searched ... It's not a typical use case for surveillance cameras, so no success)
I think the difference comes from which stream connects first and starts receiving packets first, since there’s no reference time to sync both streams to.
Many (most?) devices of this kind also transmit the absolute timestamps separately from the video stream, so if you have the system time synchronized on both cameras, perhaps using ntp, maybe it would be possible to use this information to sync the two streams up but i don’t know if it is possible to do this automatically using ffmpeg alone.
More information about the ffmpeg-user