Repository navigation
FFmpeg Integration
Section: Media & Audio · Hardware-Starter-Packs · Home · Audio-Quality-Enhancement
FFmpeg backs probing, extraction, normalization, and muxing. Encapsulated in Trackdub.Media as an external binary with process wrappers.
The FFmpeg integration is structured around specialized components that interact with the FFmpeg binary via a centralized process runner. This design ensures consistent error handling, logging, and execution across different media tasks.
| Component | Responsibility | Relevant Project |
|---|---|---|
ProcessRunner |
Manages the lifecycle of the external FFmpeg process, including arguments and output. | Trackdub.Media |
FfmpegMediaProbe |
Extracts metadata, stream information, and technical details from media files. | Trackdub.Media |
FfmpegMuxer |
Combines different audio and video streams into a final container format. | Trackdub.Media |
FfmpegHelpers |
Contains development-only probes and command experiments. | Trackdub.Tools |
The following diagram illustrates how the application orchestrates an FFmpeg command through the specialized media classes.
graph TD
A[Application/Pipeline] --> B[FfmpegMediaProbe / FfmpegMuxer]
B --> C[ProcessRunner]
C --> D{FFmpeg Binary}
D --> E[Standard Output / Error]
E --> C
C --> B
B --> A
The diagram shows the top-down flow from high-level pipeline orchestration to the execution of the FFmpeg binary.
The FfmpegMediaProbe is responsible for utilizing ffprobe to inspect media files. It extracts critical information required for the pipeline, such as durations, codecs, and stream indices. This data is essential for the "Media Ingest" and "Audio Preparation" stages of the product spine.
The FfmpegMuxer handles the final stages of the dubbing pipeline. It is responsible for combining the synthesized dubbed speech with the original video or ambiance tracks. This component ensures that the final export matches the requested loudness normalization and format options.
FFmpeg is utilized lazily via EnsureNormalizedAudioAsync to extract and normalize audio artifacts before they are passed to speech separation or ASR (Automatic Speech Recognition) stages.
flowchart TD
Start[Media Ingest] --> Extract[FFmpeg Extract Audio]
Extract --> Normalize[FFmpeg Normalize Audio]
Normalize --> Artifact[ArtifactKind.NormalizedAudio]
Artifact --> Next[Separation / ASR Preflight]
This flow represents the lazy audio preparation sequence using FFmpeg as described in the workspace facts.
-
No Ad-hoc Commands: The system strictly prohibits spawning ad-hoc FFmpeg commands from UI code. All commands must be routed through
Trackdub.Mediaservices. - Artifact Preservation: Original media and prior successful artifacts are treated as sacred. FFmpeg operations must not overwrite source files in-place.
-
Resource Management: Process execution is managed with
CancellationTokensupport to ensure that long-running media tasks can be gracefully cancelled by the user.
The FFmpeg Integration provides the technical foundation for Trackdub's media workstation capabilities. By wrapping complex media operations into structured services like FfmpegMediaProbe and FfmpegMuxer, the project ensures reliable, resumable, and cross-platform media processing that adheres to the core principle of not faking readiness.
Trackdub Engineering Wiki · Trackdub-gated · Trackdub · Contributing
Overview
Architecture
Pipeline
- Pipeline-Orchestration
- Media-Ingest-and-Preparation
- Transcription-and-VAD
- Diarization-and-Speaker-Management
- Translation-Engine
- Text-to-Speech
- Lip-Sync-and-Synthesis
- Mixing-and-Export
Desktop App
AI & Inference
- Inference-Routing-and-Planning
- ONNX-Execution-Providers
- Model-Manifests-and-Governance
- Hardware-Starter-Packs
Media & Audio
Data
Cloud & SaaS
- Cloud-API-and-Job-Management
- Web-Dashboard
- Billing-and-Quota-Management
- Webhook-Delivery-System
- Cloud-Infrastructure-Deployment
Development
Links