Skip to content

Pipeline Orchestration

tonythethompson edited this page Jul 28, 2026 · 3 revisions

Pipeline Orchestration

Section: Pipeline · Layered-Dependency-Rules · Home · Media-Ingest-and-Preparation

Pipeline orchestration sequences, executes, and monitors the multi-stage AI dubbing process. It lives in Trackdub.Application layer, uses Trackdub.Inference for models and Trackdub.Media for file work, and is triggered by Sdk / Cli / desktop app sessions. There is no cloud POST /api/dubs job entrypoint today; the portal Worker does not run this pipeline in PR1.

Stage sequencing

  1. Optional Separation — stem / dialogue separation
  2. VAD — speech regions
  3. Diarization — speaker identity
  4. ASR — source transcript
  5. Translation — target language text
  6. TTS — dubbed audio
  7. Mixing — preview / stems
  8. Export — final media

Stages are user-triggered. Fast media import registers a media spine only; speech stages lazily require ArtifactKind.NormalizedAudio via EnsureNormalizedAudioAsync when needed.

Execution flow

flowchart TD
    Start[Sdk / Cli / Desktop session] --> Init[Initialization]
    Init --> Audio[Audio Extraction / Normalize]
    Audio --> VAD[Voice Activity Detection]
    VAD --> ASR[Speech to Text]
    ASR --> Trans[Translation]
    Trans --> Voice[Voice Assignment]
    Voice --> TTS[TTS Generation]
    TTS --> Mix[Mixing and Export]
    Mix --> End[Run Completed]
Loading

Core components

Component Responsibility
TranscriptPipelineBuilder Orders stage handlers for transcription workflows
TranscriptGenerationContext Per-run config: languages, artifact paths
StageThroughputTracker Per-stage timing / throughput telemetry

Execution governance

  • Immutable snapshots — capture run config at start; UI mutations must not change in-flight meaning
  • Artifact preservation — never overwrite usable prior artifacts on skip/fail; log exact skip reasons
  • Resumability — stable stage IDs + preserved artifacts
  • No fake readiness — registered ≠ downloaded ≠ ran ≠ succeeded

Throughput tracking

sequenceDiagram
    participant P as PipelineRunner
    participant T as StageThroughputTracker
    participant S as StageHandler

    P->>T: RecordStart(stageId)
    activate T
    T-->>P: startTime
    P->>S: ExecuteAsync(context)
    activate S
    S-->>P: Result
    deactivate S
    P->>T: RecordEnd(stageId, byteCount)
    T-->>P: ThroughputSummary
    deactivate T
Loading

Readiness states

State Description
Provider Registered Inference provider available
Model Manifest Present Metadata and license verified
Prerequisites Satisfied Upstream artifacts and hardware OK
Stage Ran Execution attempted
Stage Produced Usable Output Valid artifact produced
Stage Failed Structured failure reason recorded

Related

Clone this wiki locally