Skip to main content

Export Pipeline

export_timeline renders a frame range to a file with the same layers and the same audio mix as the preview. Session::export runs it on a dedicated thread over a clone of the project, so editing continues during the export.

export-pipeline.png

Stages

StageWork
Decode (scoped thread)For each frame: active video clips, both sides of crossings, track_layers_at through GpuCompounds and StreamingFrameProvider. Hardware decoders are tried in the order listed in the settings; an empty list means CPU decoding.
Compose (scoped thread)Headless wgpu Compositor, render_layers_i420 at the output size.
Encode (export thread)Writes each video frame, then the audio up to the end of that frame.
Audio mix (scoped thread)The whole range mixed at once with mix_range, stereo 48 kHz. It first collects which file windows the mix needs, then decodes only those.

The stages are linked by bounded sync_channels of 8 frames, so decode runs ahead of compose, and compose ahead of encode, without unbounded memory.

Settings

SettingDetail
Video encoderx264, NVENC, VideoToolbox or Vulkan. ExportSettings::preferred picks NVENC when it really opens.
Audio encoderAAC, or FDK AAC when available. Audio is left out when no audio track has clips.
Scale100 / 75 / 50 / 25 % of the timeline resolution, rounded to even dimensions for 4:2:0.

Progress and cancellation

  • ExportProgress (behind a Mutex) holds current frame, total, elapsed time, busy time and fps per stage, the decode paths actually used, the GPU adapter and the encoder. Busy time excludes waits on other stages, so the slowest stage shows the bottleneck.
  • Cancel is an AtomicBool checked every frame by the decode and encode loops. Errors and cancellation also mark the progress as done; the host gets SessionEvent::ExportFinished from tick().
  • render_frame_rgba reuses the decode and compose path for a single frame (the MCP render_frame tool).