pub struct VideoEffectRenderer { /* private fields */ }Expand description
Reusable single-frame renderer for a Clip’s video effect chain.
Built once via Clip::video_effect_renderer; holds one FilterGraph
configured with the same yuv420p working space and Clip::video_effect_chain
that Timeline::render() uses, so a host preview matches the exported result.
Feed frames through render repeatedly — the graph (and any
lut3d .cube file it loads) is built once, not per frame, which is the right
choice for real-time preview.
All frames passed to render must share the pixel format (the input_format
given at construction) and the dimensions of the first rendered frame. Build a
new renderer if the grade, format, or frame size changes.
Implementations§
Source§impl VideoEffectRenderer
impl VideoEffectRenderer
Sourcepub fn new(
clip: &Clip,
input_format: PixelFormat,
) -> Result<VideoEffectRenderer, PipelineError>
pub fn new( clip: &Clip, input_format: PixelFormat, ) -> Result<VideoEffectRenderer, PipelineError>
Builds a renderer for clip’s current effect chain. Frames passed to
render must be in input_format; the output is returned
in the same format.
The graph itself is configured lazily from the first frame’s dimensions on
the initial render call.
§Errors
Returns PipelineError::Filter if the filter graph cannot be built.
Sourcepub fn render(
&mut self,
frame: &VideoFrame,
) -> Result<VideoFrame, PipelineError>
pub fn render( &mut self, frame: &VideoFrame, ) -> Result<VideoFrame, PipelineError>
Applies the effect chain to one frame, reusing the built graph.
frame must match the input_format and dimensions established by the
first rendered frame. The returned frame has the same pixel format as the
input. The frame’s own timestamp is forwarded to the graph (as
Timeline::render() does); the effect chain is pixel-domain and does not
depend on PTS ordering.
§Errors
Returns PipelineError::Filter if the frame cannot be processed.