[FFmpeg-user] Comparing audio to sync video

Joshua Grauman jnfo-c at grauman.com
Tue Dec 18 18:35:34 EET 2018


On Tue, 18 Dec 2018, Carl Zwanzig wrote:
>>  2018-12-18 12:36 GMT+01:00, Joshua Grauman <jnfo-c at grauman.com>:
>>
>>>  I have two video cameras recording an event 30 minutes long.[...] The
>>>  audio won't
>>>  be exactly identical as they are two different cameras, different mics,
>>>  different locations, but they are both recording an interview, so the
>>>  audio should be able to be synced. 
>
> So, effectively you have two -different- videos. To a human, they may sound 
> and look mostly the same, but really they're different. "be able to be 
> synced" does not necessarily imply "easy to be done" here. (If they had the 
> same audio feed, it would be much easier. Heck, if they both recorded real 
> timecode, it would be almost trivial.)
>
>>  Or are you searching for an automated process to get two independent
>>  video in-sync?
>
> If that's the goal, there needs to be a readily identifiable sound or visual 
> marker at the start of the videos as a sync point, then a process to -find- 
> those and get a timecode. The process also needs to know what that marker is 
> to look for it. There's a non-trivial amount of processing involved to find 
> and make the identification.
>
> If this is an occasional task, you're better off opening the two videos in an 
> editor and sliding the timelines around so they match.

Yes, two different videos but which should be strongly correlated. I found 
some code to compute cross-correlation which should work, see my previous 
post. Thanks for the suggestion about an easy to find marker, such as a 
'clap' or something, that could also come in handy.

And sorry for top-posting in my last post. Bad habit...

Josh


More information about the ffmpeg-user mailing list