Skip to content
← All systems

Video pipeline · long-form in, vertical Shorts out

Working end to end

shorts-clipper

Watchlist-driven, rights-gated, resumable.

A seven-stage pipeline that discovers candidate videos, ingests one, transcribes it, scores moments against a rubric, renders a captioned vertical clip with a ducked music bed, writes the upload metadata — and then re-fits its own scoring weights against how the clip actually performed.

10.9K
Python LOC
455
Tests
7
Pipeline stages
0
Network calls in tests

The hard part

Which thirty seconds of a ninety-minute video is worth cutting — and how do you know you were right?


A rubric scores candidate moments, and then a calibrate stage correlates the scores that predicted each clip against the retention it actually got after publishing, and re-fits the weights. The scoring function is not a hand-tuned constant; it is a thing that learns from its own published output.

Design decisions

01

Rerun a stage, not the pipeline

Each stage reads the job's state file, does its work, and writes it back. A failed render does not cost you the transcription, and a rubric change re-scores moments without re-downloading the video.

02

Rights are a gate, not a disclaimer

A watchlist file decides both what gets scanned and what may legally be clipped, and it ships empty — the tool does nothing useful until someone has stated what it is allowed to touch. Every music bed's licence has to be recorded before use, because a Content ID claim on the audio takes the revenue for the whole Short.

03

455 tests that need neither network nor ffmpeg

Media work is the easiest thing to leave untested, because the dependencies are heavy. Transcription, scoring, captioning, snapping, rate limiting and the music mix all sit behind seams, so the suite runs anywhere in seconds.

04

The mix does not change when the track does

Music is ducked out from under the speech by a sidechain compressor keyed on the voice, and every bed is normalised to a target LUFS — so swapping the track swaps the music, not the levels.

Stack

  • Python
  • uv
  • Gemini
  • FFmpeg
  • yt-dlp
  • pytest
  • ruff

My part in it

Sole engineer.


What is not done

Two things from the build order are outstanding: face-tracked reframing (the reframer is centre-crop only) and the local review UI.