#[non_exhaustive]pub struct VideoRendition {
pub name: String,
pub size: Option<Size>,
pub rate: Option<FrameRate>,
pub config: Config,
}Expand description
One encoding of a broadcast’s picture.
The encoder settings are moq-video’s own Config. Its width, height
and framerate are filled in from size, rate
and the source when the rendition opens, and so is its color unless set.
Its resize is filled in with moq-video’s defaults unless set, so a frame
of another size is scaled on the encoder’s thread.
Its join is the keyframe interval: a subscriber cannot draw anything
before a keyframe, so it sets how long a new viewer waits for a picture and
how long a rendition switch takes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe track name, which a subscriber picks the rendition by.
size: Option<Size>The encoded size. None encodes at the source’s own size.
rate: Option<FrameRate>The frame rate. None follows the source. It cannot exceed the source’s rate.
config: ConfigThe encoder settings: bitrate, keyframe interval, codec, backend, preset.
Implementations§
Source§impl VideoRendition
impl VideoRendition
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a rendition at the source’s size with moq-video’s default settings.
The defaults are H.264 from any backend, a keyframe every two seconds, and a bitrate derived from the size and rate.
Sourcepub fn with_size(self, size: Size) -> Self
pub fn with_size(self, size: Size) -> Self
Returns this rendition encoded at size instead of the source’s size.