Skip to main content

AbrRendition

Struct AbrRendition 

Source
pub struct AbrRendition {
    pub width: u32,
    pub height: u32,
    pub video_bitrate: u64,
    pub audio_bitrate: u64,
    pub name: Option<String>,
}
Expand description

One resolution/bitrate tier in an ABR ladder.

Each rendition becomes an independent encoder stream. The output files are placed in a subdirectory named after the rendition (see dir_name).

Fields§

§width: u32

Target video width in pixels.

§height: u32

Target video height in pixels.

§video_bitrate: u64

Target video encoder bitrate in bits per second.

§audio_bitrate: u64

Target audio encoder bitrate in bits per second.

§name: Option<String>

Optional subdirectory name. Defaults to "{width}x{height}".

Implementations§

Source§

impl AbrRendition

Source

pub fn dir_name(&self) -> String

Returns the subdirectory name for this rendition.

Uses name if set; otherwise "{width}x{height}".

§Example
use ff_stream::AbrRendition;

let r = AbrRendition { width: 1920, height: 1080,
    video_bitrate: 4_000_000, audio_bitrate: 192_000, name: None };
assert_eq!(r.dir_name(), "1920x1080");

let r2 = AbrRendition { width: 1280, height: 720,
    video_bitrate: 2_000_000, audio_bitrate: 128_000,
    name: Some("720p".into()) };
assert_eq!(r2.dir_name(), "720p");

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<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, 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.