pub struct LavfiSource { /* private fields */ }Expand description
Generates video frames from an FFmpeg lavfi filtergraph string (e.g.
color=s=1920x1080:c=black@0.0,drawtext=text='Title'), so a host such as the
preview runner can feed a timeline-level generated overlay into a
RealtimeComposer as pushed frames.
The output is rgba and preserves the graph’s own alpha (no canvas is
composited underneath), matching the export path’s topmost lavfi layer. Frames
are produced sequentially via pull; the source exposes no seek,
so a host that seeks rebuilds it from scratch.
Implementations§
Source§impl LavfiSource
impl LavfiSource
Sourcepub fn new(lavfi: &str) -> Result<Self, FilterError>
pub fn new(lavfi: &str) -> Result<Self, FilterError>
Builds a source from a lavfi filtergraph string.
§Errors
Returns FilterError when the underlying FFmpeg graph cannot be built
(e.g. the movie / lavfi demuxer is unavailable, or the string is invalid).
Sourcepub fn pull(&mut self) -> Result<Option<VideoFrame>, FilterError>
pub fn pull(&mut self) -> Result<Option<VideoFrame>, FilterError>
Pulls the next generated frame (rgba), or None when none is buffered yet
or at end-of-stream.
§Errors
Returns FilterError on an unexpected FFmpeg error.