Skip to main content

Module ffmpeg_context_builder

Module ffmpeg_context_builder 

Source
Expand description

The ffmpeg_context_builder module defines the builder pattern for creating FfmpegContext objects.

It exposes the FfmpegContextBuilder struct, which allows you to:

  • Configure multiple Input and Output streams.
  • Attach filter descriptions via FilterComplex or inline strings (e.g., "scale=1280:720", "hue=s=0").
  • Produce a finished FfmpegContext that can then be executed by FfmpegScheduler.

§Examples

// 1. Create a builder (usually via FfmpegContext::builder())
let builder = FfmpegContext::builder();

// 2. Add inputs, outputs, and filters
let ffmpeg_context = builder
    .input("input.mp4")
    .filter_desc("hue=s=0")
    .output("output.mp4")
    .build()
    .expect("Failed to build FfmpegContext");

// 3. Use `ffmpeg_context` with FfmpegScheduler (e.g., `.start()` and `.wait()`).

Structs§

FfmpegContextBuilder
A builder for constructing FfmpegContext objects with customized inputs, outputs, and filter configurations. Typically, you will start by calling FfmpegContext::builder(), then chain methods to add inputs, outputs, or filter descriptions, and finally invoke build() to produce an FfmpegContext.