#[non_exhaustive]pub enum WriterError {
InvalidDimensions {
width: u32,
height: u32,
},
UnknownPixelFormat(String),
HardwarePixelFormat(String),
InvalidFps {
num: i32,
den: i32,
},
ZeroQueueCapacity,
NoVideoDestination,
FilterShape {
input_pads: usize,
video_input_pads: usize,
output_pads: usize,
video_output_pads: usize,
},
DisconnectedFilterGraph {
components: usize,
},
UnreachableFilterOutput,
StreamMapsUnsupported,
}Expand description
Errors raised while validating a VideoWriterBuilder or opening its
pipeline. Reachable through crate::error::Error::Writer; it is exported
from crate::error rather than the crate root to keep the root surface to
the three settled writer types.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidDimensions
Width or height is zero or exceeds i32::MAX.
UnknownPixelFormat(String)
The pixel-format name is not known to av_get_pix_fmt.
HardwarePixelFormat(String)
A hardware pixel format (e.g. cuda, vaapi) cannot be filled from a
CPU byte buffer.
InvalidFps
fps(num, den) had a non-positive component.
ZeroQueueCapacity
queue_capacity(0) was requested.
NoVideoDestination
The built pipeline consumes no video from the pushed frames (a
disable_video() output). Without this check write would block
forever against a live-but-unconsumed receiver.
FilterShape
The filter_desc graph does not consume exactly one video input and
produce exactly one video output. A second input pad would have no
producer (the pipeline would buffer forever waiting for it) and a
second output pad would have no destination.
DisconnectedFilterGraph
The filter_desc parses into more than one disconnected filter
component (e.g. "nullsink;color=..."). The pushed frames would feed
one part while an unrelated part feeds (or starves) the encoder — an
unbounded side source could even keep the job from ever finishing.
UnreachableFilterOutput
The filter_desc is connected, but no directed path leads from its
input pad to its output pad (e.g.
"color,split[out][aux];[aux][in]overlay,nullsink"): the pushed
frames drain into a sink while an unrelated branch feeds the encoder,
so they could never influence the encoded output — and an unbounded
side source would keep the job from ever finishing.
This check works at FILTER granularity: it follows links between
filters, not streams within a filter. A filter that internally routes
distinct streams between pad pairs (multi-stream concat is the
notable case) can therefore pass it while still steering the pushed
frames into a sink leg — libavfilter exposes no static per-pad
dataflow to validate against. Such a graph has to be constructed
deliberately and stands on the same footing as any other
filter_desc whose declared routing is what runs.
StreamMapsUnsupported
The Output carries stream maps (add_stream_map /
add_stream_map_with_copy). The writer’s single video stream is the
only stream there is, so maps have nothing to select; rejecting them
beats silently ignoring them.
Trait Implementations§
Source§impl Debug for WriterError
impl Debug for WriterError
Source§impl Display for WriterError
impl Display for WriterError
Source§impl Error for WriterError
impl Error for WriterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()