Skip to main content

OutputProgress

Struct OutputProgress 

Source
#[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_NOFILE muxer (HLS, null, …) manages its own I/O, so total_size and bitrate_kbps stay None.

Implementations§

Source§

impl OutputProgress

Source

pub fn output_index(&self) -> usize

Position of this output in the job’s output declaration order.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> OutputProgress

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OutputProgress

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,