#[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,
},
ConflictingFilterDescriptions,
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.
ConflictingFilterDescriptions
Both VideoWriterBuilder::filter_desc and the opened Output’s
set_video_filter were configured. The writer runs exactly one
filter chain between the pushed frames and the encoder, and guessing
which of the two the caller meant would silently ignore the other —
configure the chain in exactly one place.
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 is STRUCTURAL: it follows the links between filters, and
inside each filter every input pad is assumed to influence every
output pad. Filter routing is not pruned by the applied options,
because libavfilter routing is not static — a selector’s map
(streamselect) can be rewritten mid-stream by sendcmd or the
send-command API, and ffmpeg itself accepts and runs descriptions
whose current selection drops the pushed stream. A description that
discards the pushed frames at runtime (an unselected streamselect
input, a multi-stream concat steering them into a sink leg, …)
therefore passes this gate and runs as declared, exactly like the
CLI; what cannot pass is a graph where no wiring could ever carry the
pushed frames toward the encoder.
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()