Sharing one music track across hundreds of clips started with a flag on a creative call and ended with a queue I now run every morning. The technical part took an evening; the rest was process.

The problem

Social clips ship in batches, each cut under 60 seconds, and a single track gets used across the batch for consistency. Changing that one track later should be a five-minute job. In practice it meant touching every cut and every export, and the licensing note lived in a different spreadsheet.

What fixed it

  • One manifest per batch: clip id, in and out points relative to the track, and the license reference. JSON, versioned in the repository.
  • One script that re-cuts every clip from the manifest. No hand edits, ever.
  • A license check that runs before the script does, and refuses the batch if the track has no matching record.
for item in manifest["clips"]: subprocess.run(["ffmpeg", "-y", "-i", item["source"], "-ss", str(item["in"]), "-t", str(item["out"]), "-i", item["track"], "-map", "0:v", "-map", "1:a", "-shortest", item["output"]], check=True) 

The script does not know anything about which track is "current". That is the point: swapping music is a one-line change in the manifest.

The part that saves the most time

The license record lives next to the manifest, and the check is the first line of the script. Before that, a single bad track slipped through and we had to pull six posts. The check has caught two since, both before export.

How I set up the manifest and the check is written up with the rest of my field notes in github.com/barasel200-bit/uvicorn-teardown-notes, so whoever takes over has one place to start.

What I would do differently

Write the check before the script. We added it after the incident, and the process change mattered more than the automation.