I was recording a cover after Linkin Park concert today, it was so damn good!!!
Phone propped up for video and vocals, DAW running for MIDI keyboard.
When I went to put them together, they were out of sync. The audio from my DAW didn’t line up with the video from my phone. Off by some fraction of a second that made everything sound wrong.
The normal fix: open a video editor, zoom into the waveforms, drag things around until they match, export, check, repeat. I’ve done this before. It’s tedious. So I had stopped doing it and just use bad audio instead for my previous covers.
Instead I opened Cursor CLI and said “sync this video with this audio file. Before you do anything, first ask any clarifying questions so that you can do this task better.”
It one-shotted a Python script that uses cross-correlation to find the offset automatically. Compares the audio from the video with the replacement audio, finds where they align, and merges them with FFmpeg.
The whole thing took maybe 5 minutes. Building the tool was faster than manually syncing would have been.
I cleaned it up a bit and published it:
pip install audio-video-sync
avsync video.mp4 audio.mp3That’s it. One command. It figures out the offset and spits out a synced video.
The code uses two methods to find the sync point: chromagram correlation (compares pitch content, works even if the audio is processed differently) and waveform correlation (more precise when recordings are similar). It picks whichever one has higher confidence.
I finished my cover and now I have a tool for next time.