#[non_exhaustive]pub struct OutputProgress { /* private fields */ }Expand description
Progress of one output of the job.
Apart from output_index, which is always present,
every telemetry metric is an Option: None means “not knowable right
now” (or not applicable to this output), never a fabricated zero. In
particular:
- a packet-sink output delivers packets through callbacks instead of a
muxer, so all of its optional metrics stay
None; - an
AVFMT_NOFILEmuxer (HLS,null, …) manages its own I/O, sototal_sizeandbitrate_kbpsstayNone.
Implementations§
Source§impl OutputProgress
impl OutputProgress
Sourcepub fn output_index(&self) -> usize
pub fn output_index(&self) -> usize
Position of this output in the job’s output declaration order.
Sourcepub fn video_packets(&self) -> Option<u64>
pub fn video_packets(&self) -> Option<u64>
Packets of the selected video stream (the lowest-index video stream of this output) successfully committed to the muxer.
This is the typed counterpart of the CLI’s frame= counter, but it
deliberately is not called “frames”: bitstream filters between the
encoder and the muxer can change the packet count, so what is
counted here is committed packets. None when the output has no
video stream, before the muxer has resolved its streams, and for
packet-sink outputs.
Sourcepub fn fps(&self) -> Option<f64>
pub fn fps(&self) -> Option<f64>
Video packets per second of wall-clock time
(video_packets / elapsed). None whenever
video_packets is None or no time has elapsed.
Sourcepub fn out_time_us(&self) -> Option<i64>
pub fn out_time_us(&self) -> Option<i64>
The output’s progress position in microseconds: the minimum post-fixup timestamp watermark across this output’s active streams, where a watermark advances only when a packet was successfully written to the muxer.
Strict like the fftools progress line: while any active stream has
not committed its first packet this is None rather than a guess.
Streams that finished early leave the active set (a sparse or short
stream cannot pin the value forever), and once every stream finished
the value freezes at the output’s high-water mark. Across snapshots
the sequence of Some values is monotonic non-decreasing.
Sourcepub fn total_size(&self) -> Option<u64>
pub fn total_size(&self) -> Option<u64>
Bytes written to the output so far (header included), as reported by
the muxer’s I/O context after the most recent successful write.
None for AVFMT_NOFILE muxers (e.g. HLS — its segment sizes are
not observable here), for packet-sink outputs, and before the first
write.
Sourcepub fn bitrate_kbps(&self) -> Option<f64>
pub fn bitrate_kbps(&self) -> Option<f64>
Average bitrate so far in kbit/s
(total_size * 8 / out_time_us).
None whenever either input is unavailable or the position is not
yet positive.
Sourcepub fn speed(&self) -> Option<f64>
pub fn speed(&self) -> Option<f64>
Processing speed relative to media time: media seconds produced per
wall-clock second (the CLI’s speed=). None whenever
out_time_us is unavailable or negative, or no
time has elapsed.
Sourcepub fn percent_of(&self, total_us: i64) -> Option<f64>
pub fn percent_of(&self, total_us: i64) -> Option<f64>
Convenience: this output’s position as a percentage of a
caller-supplied total duration in microseconds (for example from
container_info), clamped to [0, 100].
The library does not derive the percentage itself: only the caller
knows the intended total (trims, -t limits and live inputs make
any guess wrong). Returns None when the position is unknown or
total_us is not positive.
Trait Implementations§
Source§impl Clone for OutputProgress
impl Clone for OutputProgress
Source§fn clone(&self) -> OutputProgress
fn clone(&self) -> OutputProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more