Long-form to short-form, automated
A Django, Celery, and RabbitMQ pipeline that turns long-form video into near-ready short-form clips. Stages publish artifacts instead of calling each other, so a run that fails partway resumes from the last boundary it cleared, and Remotion on AWS Lambda renders the clips in parallel.
Manual social clipping took about four weeks per campaign. This pipeline turns a two-hour podcast into 30 to 40 branded social clips in roughly one hour.
Before this, enterprises were paying editors to sit through hours of recording, find the usable moments, cut them down, reframe them vertically, and caption them by hand. The target here was not draft quality. It was near-ready output at production throughput.
The system now lands around 95% ready-to-post quality by pushing the work through sixteen cooperating stages that can fail, resume, and reuse earlier results without losing their place.
Six runs, six different style contracts pinned at execution time. Captions, emphasis, transitions, generated inserts, and the audio mix all change. The selection logic, the DAG, and the render path do not. This is the payoff of treating creative direction as a versioned runtime input rather than something baked into the renderer.
Amber italic emphasis, restrained pacing
Small serif, low-contrast highlight
All-caps, high-contrast, fast cuts
Cream card inserts, soft keyword highlight
Broadsheet layouts, all-caps ticker captions
Boxed captions, serif italic accents
Trimmed excerpts of real pipeline output. Tap any clip to hear its audio mix, since music selection and speech ducking are part of the style contract too.
Two transcode roots run in parallel: one normalizes the analysis copy, the other prepares the render source. Transcription and segment detection fan out from the first, and speaker attribution resolves before any editorial judgement happens. The planning service then scores moments for hook strength, topic completeness, quotability, and likely engagement. Preparation shifts everything to clip-local assets. Framing, protected shots, and cutout work run as separate Cloud Run jobs. Composition writes the render index. Rendering fans out through Remotion on AWS Lambda, and the analysis boundary closes before delivery does.
Simplified. Ten of the sixteen production stages are drawn, and a few edges collapse intermediate work so the shape stays readable. Six of them are delegated. They run outside the orchestrator and report back by callback, which is why the graph has to survive a signal that never arrives.
The run is the top-level control object. Each stage becomes a durable job. Each rendered short becomes its own output. Jobs have four states: pending, in_progress, completed, failed. That is enough to keep orchestration predictable and still allow retries, subtree resets, and reuse of completed work.
Each stage reads the artifacts it depends on, computes, writes new structured data or media to durable storage, and marks its job complete. The orchestrator triggers what comes next. Delegated work, retries, and reuse all fall out of that contract. Debugging becomes reading the directory.
The composition index spawns one render job per short. Remotion packages client branding, captions, overlays, and the audio mix into a single schema-validated props payload, then AWS Lambda fans those renders out in parallel. Each output completes on its own schedule, signalled either by an async webhook or by background polling. Finalization is one terminal-state transition, so the poll recovers a missed callback and a duplicate signal becomes a no-op.
The style and enhancement control plane is a separate subsystem. It authors and publishes immutable creative contracts: subtitle systems, overlays, audio treatment, and visual rules. The pipeline pins them by version at runtime. Creative quality control stays out of the production DAG.
The trigger layer can attach a new execution to compatible completed jobs for the same source asset and stage type. No separate cache. The orchestrator keys off completed contracts, not task invocations. Latency drops, cost drops, and the graph continues from the reused boundary.
Style override reruns enter at the enhancement-planning boundary rather than at the start. That boundary and every stage below it reset to pending, the override lives in the run metadata, and downstream composition and rendering regenerate. The DAG replays from a chosen boundary instead of only running start to finish.
Every completion re-scans the whole graph for stages whose dependencies are now satisfied, not just the direct dependents of the stage that finished. A dropped notification stops being fatal, because the next completion picks up whatever it stranded. A stage sitting in progress past its plausible ceiling counts as a dead worker, and the orchestrator re-dispatches it.
Workflow completion = analysis + composition done. Delivery completion = every output reached a terminal render outcome. Any failed required stage marks the workflow failed. Per-clip render failures roll up into delivery state, not workflow state.
A run costs real money the moment it starts: transcription, inference, GPU time, render minutes. So the run reserves credits against the organization when the graph starts, marks them successful when it completes, and refunds them when it fails. The billing state lives on the same run record as everything else, which makes the whole lifecycle replay-safe: a reservation that already exists is never double-charged, and a refund that already happened is never issued twice.
The interesting part is the ordering. Marking a run failed and refunding it happens under a row lock, before any of the best-effort work like progress logging or realtime fanout. A logging outage can't leave a run stuck in processing with the customer's credits held. The guard runs in both directions. It refuses a late failure arriving after a run was already billed as successful, and it stops a late success from resurrecting a run that already failed and refunded.
Strange codecs, broken containers, missing audio. Transcoding has to be defensive enough that downstream stages can assume a stable input.
An hour of analysis cannot collapse on a render error. Resumability has to live at the artifact boundary, not at the task level.
Six of the sixteen stages complete somewhere else and report back over the network. Polling and readiness re-scans are the safety net, so a dropped callback delays a run instead of stranding it.
Credits are reserved before the work happens, so every terminal transition has to be authoritative and idempotent. A duplicate signal or a late arrival must not double-charge, double-refund, or flip a settled run.
Plans can be technically valid but editorially uneven. Treating the plan as an explicit contract, with style binding and enhancement separation, keeps reruns cheap when only the creative layer needs to move.
What used to take a campaign-long editorial loop now compresses into a single processing run, because transcription, planning, preparation, and rendering all execute as resumable async stages.
Timestamps don't decide the cuts. The planning service scores candidates for hook strength, topic completeness, and quotability, and each winner renders with client branding, captions, and the audio mix already applied.
Parallel Lambda export turns per-clip rendering into fanout instead of a queue of serial renders, so dozens of outputs land in minutes rather than hours.
When stages publish to durable storage, retries, reuse, and delegated execution all become trivial. The orchestrator stops caring about who computed what.
Holding clip selection and creative treatment in different stages made enhancement-only reruns possible without rebuilding the whole graph.
Webhooks reduce time-to-finalize on the happy path. Polling survives missed callbacks. Treat finalization as a terminal-state transition and the race resolves itself.
Style is not a render flag. It is a versioned contract published from a separate control plane. The pipeline pins a version, so two runs a month apart produce the same look and a rerun can't drift into a new one.
Video ingest and analysis pipeline