<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 16 июл. 2024 г., 21:56 Stefan de Konink via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">cin@lists.cinelerra-gg.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Op 7/16/24 om 6:39 PM schreef Andrew Randrianasulu via Cin:<br>
> I have read this problem about synchronizing few videos on forum. After <br>
> yet another search I found some tool ....<br>
> <br>
> Anyone have few multicam files to test this Java tool?<br>
<br>
I just did. And this tool is maybe very academically functional, it is <br>
not practical.<br>
<br>
This is the directory structure I usually follow, my individual <br>
recordings from multiple sources are placed in separate folders, where I <br>
typically also have an independent audio track. Not this time, we are <br>
keeping it "simple".<br>
<br>
<<a href="https://download.stefan.konink.de/syncsink/" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://download.stefan.konink.de/syncsink/</a>><br>
<br>
In this folder structure you can see that there are two files in the two <br>
folders. Hence we already know if we follow the metadata of these <br>
individual we know 'exactly' when recording started. The device may have <br>
an offset.<br>
<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_DSC0680.MOV':<br>
   Metadata:<br>
     major_brand     : qt<br>
     minor_version   : 537331968<br>
     compatible_brands: qt  niko<br>
     creation_time   : 2023-12-10T11:10:25.000000Z<br>
<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_DSC0681.MOV':<br>
   Metadata:<br>
     major_brand     : qt<br>
     minor_version   : 537331968<br>
     compatible_brands: qt  niko<br>
     creation_time   : 2023-12-10T11:13:29.000000Z<br>
<br>
My basic expectation: the sync tool is aware that a sequential recording <br>
has been made from the same device and is able to position it relative <br>
towards each other. Creation time, metadata, duration, *timecode* would <br>
help. Even if the tool would not have figured out that this was a <br>
specific camera, it still would have placed it at the correct offset.<br>
<br>
Now the tool at hand is not aware of this sequential nature of the <br>
files. It can do relative positions of recordings, but not takes.<br>
<br>
So we get a result of the second folder and it comes up with a way to <br>
align the *audio*.<br>
<br>
#execute the following in the terminal<br>
cd '/mnt/media/video/20231209-penm-allstars/ronin'<br>
ffmpeg -i "_DSC4395.MOV" "original__DSC4395.wav"<br>
ffmpeg -f lavfi -i aevalsrc=0:d=7.5135827 -i <br>
"/mnt/media/video/20231209-penm-allstars/nikon/_DSC0680.MOV" <br>
-filter_complex "[0:0] [1:0] concat=n=2:v=0:a=1 [a]" -map [a] <br>
"synced__DSC0680.wav"<br>
<br>
What I would want is the ability to tag the existing files with a <br>
timecode so any tool would be able to use that information to place the <br>
files on a timeline.<br>
<br>
The ideal tool (which I would be looking at) would be something within <br>
the scope of opentimelineio, place the assets correctly towards each <br>
other like it would be the timeline view of Cinerella. The first <br>
synchronisation step could be a directory determining the track, file <br>
modification time, metadata. Where a second step either by audio or by <br>
visual cues syncing the media at frame and audio level, so it would <br>
overcome millisecond differences as well.<br>
<br>
If we would then be able to either export in Cinelerra project "xml" or <br>
have the ability to import opentimelineio, that would greatly improve my <br>
workflow and I think everyone that has multicam recordings without in <br>
camera timecode.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I found this forum post on Shotcut forums:</div><div dir="auto"><br></div><div dir="auto"><a href="https://forum.shotcut.org/t/audio-alignment-implementation/30420/10" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://forum.shotcut.org/t/audio-alignment-implementation/30420/10</a><br></div><div dir="auto"><br></div><div dir="auto">it goes into details of how it can be implemented </div><div dir="auto"><br></div><div dir="auto">compare.cpp lives in</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/andre-caldas/sandbox/tree/master/audio_aligner" rel="noreferrer noreferrer noreferrer" target="_blank">https://github.com/andre-caldas/sandbox/tree/master/audio_aligner</a><br></div><div dir="auto"><br></div><div dir="auto">for more complex folder processing I found this repo, but it relies on hardware LTC generator?</div><div dir="auto"><br></div><div dir="auto"><a href="https://hackaday.io/project/176196/logs" rel="noreferrer noreferrer" target="_blank">https://hackaday.io/project/176196/logs</a><br></div><div dir="auto"><br></div><div dir="auto">Also,some blender experiments from 2013, not sure where real implementation lived ....</div><div dir="auto"><br></div><div dir="auto"><a href="https://monochrome.sutic.nu/2014/03/02/multi-camera-sync.html" target="_blank" rel="noreferrer">https://monochrome.sutic.nu/2014/03/02/multi-camera-sync.html</a><br></div><div dir="auto"><br></div><div dir="auto">and this article mentioning -timecode switch for ffmpeg (but it also relies on electronic slate/tablo visible in very first frame of video)</div><div dir="auto"><br></div><div dir="auto"><a href="https://probably.co.uk/posts/adding-timecode-to-older-video-recorders/">https://probably.co.uk/posts/adding-timecode-to-older-video-recorders/</a><br></div><div dir="auto"><br></div><div dir="auto">so, one idea is to </div><div dir="auto"><br></div><div dir="auto">1) extract audio from sources.</div><div dir="auto">2) compare all those wavs to master sound file extracted from master media file.</div><div dir="auto">3) convert offsets into timecode</div><div dir="auto">4) run ffmpeg to tag video files via copying a/v streams to new files (or may be use gpac if it can do it inplace?)</div><div dir="auto"><br></div><div dir="auto">sync via timecode in cingg ;)</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-- <br>
Stefan<br>
<br>
-- <br>
Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
</blockquote></div></div></div>