Expand description
The context module provides tools for assembling an entire FFmpeg pipeline,
culminating in the FfmpegContext. This includes:
- Inputs:
Inputobjects representing files, URLs, or custom I/O callbacks. - Outputs:
Outputobjects representing target files, streams, or custom sinks. - Filter Descriptions: Simple inline filters via
filter_descor more complexFilterComplexgraphs. - Builders: e.g.,
FfmpegContextBuilderfor constructing a complete context with multiple inputs, outputs, and filter settings.
Once you’ve built an FfmpegContext, you can execute it via the FfmpegScheduler.
§Example
ⓘ
// Build an FFmpeg context with one input, some filter settings, and one output.
let context = FfmpegContext::builder()
.input("test.mp4")
.filter_desc("hue=s=0")
.output("output.mp4")
.build()
.unwrap();
// The context now holds all info needed for an FFmpeg job.Modules§
- ffmpeg_
context - The ffmpeg_context module is responsible for assembling FFmpeg’s configuration: inputs, outputs, codecs, filters, and other parameters needed to construct a complete media processing pipeline.
- ffmpeg_
context_ builder - The ffmpeg_context_builder module defines the builder pattern for creating
FfmpegContextobjects. - filter_
complex - The filter_complex module defines the
FilterComplexstruct, which encapsulates one or more FFmpeg filter descriptions (e.g.,"scale=1280:720","hue=s=0", etc.). You can useFilterComplexto construct more advanced or multi-step filter graphs than simple inline strings allow. - input
- The input module defines the
Inputstruct, representing an FFmpeg input source. An input can be: - null_
output - The null_output module provides a custom null output implementation for FFmpeg that discards all data while supporting seeking.
- output
- The output module defines the
Outputstruct, representing an FFmpeg output destination. An output may be: