AI video generators are very good at motion and often silent. If you generate a clip of a ball bouncing, a door closing, or a glass being set on a table, you usually get pixels and no audio. Adding the right "thud" by hand in an editor is fine for one clip. It doesn't scale to a batch.
This post builds a small Python + ffmpeg pipeline that does three things:
Finds the frames where an impact happens.
Mixes a short sound effect at exactly those times.
Measures how far the audio actually lands from the true impact time.
That third step is the one most tutorials skip. "It sounds about right" isn't a number. I wanted one.
All code below ran on a Linux box with Python 3.13, NumPy and ffmpeg 7.1. Everything is in three files you can copy.
The test clip is synthetic, on purpose
To measure alignment error you need ground truth: the exact moment each impact really happens. Real AI video doesn't give you that.…