How it works
Once the source is verified, an ingestion event starts a processing job. A scheduler builds a directed acyclic graph (DAG), a set of tasks with dependency arrows and no loops: inspect first; then audio encoding, video renditions, thumbnails, and optional moderation can run where dependencies allow. Workers read the durable original and write outputs to object storage. Queue messages carry object keys and job IDs, not the media itself.
A preprocessor can inspect tracks and create aligned media chunks for parallel encoding. For example, a 60-minute source cut into 2-minute chunks with five renditions gives 150 encode tasks. At 4 minutes per task, one worker needs 10 hours; 50 workers could finish in about 12 minutes. Each chunk must start on a frame that decodes alone, a constraint resumable upload parts do not have.
Queues absorb bursts but backlog still needs limits and monitoring. Persist task state, lease work (a claim that expires if the worker dies), retry transient failures with bounds, and send persistent failures to a dead-letter path, a queue operators can inspect. Make outputs idempotent, safe to produce twice, because a worker can fail after writing but before acknowledging. Publish only after required renditions and the manifest, the player’s index file, exist. A malformed source is a terminal validation error; repeating the transcode will not repair it.
Workflow engines such as Temporal or AWS Step Functions can hold this state, though they add a dependency to learn and run. A short clip does not need any of it: a 30-second video can go through one FFmpeg job.
A worker dies after writing the 720p output but before acknowledging. What happens on redelivery?
A replacement checks the deterministic output key and task state, verifies the output, and marks it complete or safely overwrites it. Publication still waits for required outputs.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Express dependencies explicitly; parallelize only independent tasks.
- Retries need durable state, idempotent outputs, and a terminal failure path.