pub enum StreamingQuality {
Original,
Mbps20,
Mbps10,
Mbps8,
Mbps4,
Mbps2,
Mbps1,
Kbps720,
}Expand description
A ceiling on how much bandwidth a video stream may consume.
A quality step is a bundle of concrete transcode parameters — total stream
ceiling, the audio share of it, and the resolution that ceiling can carry —
not just a label. Those numbers are Jellyfin encoding domain vocabulary, so
they live here and the frontend only ever names a variant; the labels the
picker shows are served over IPC by player_get_streaming_qualities.
The ladder is deliberately expressed in bandwidth rather than resolution: it exists to fit a connection, and the resolution cap is chosen from the bitrate so the encoder does not spend a small budget on pixels it cannot afford. See docs/architecture/01-rust-backend.md (“Streaming quality ladder”).
TRACES: UR-074 | DR-162
Variants§
Original
No client-imposed cap — the server may direct-play the source as-is.
Mbps20
Mbps10
Mbps8
Mbps4
Mbps2
Mbps1
Kbps720
Implementations§
Source§impl StreamingQuality
impl StreamingQuality
Sourcepub const ALL: [StreamingQuality; 8]
pub const ALL: [StreamingQuality; 8]
The ladder, highest first, for enumerating across the IPC boundary.
Sourcepub fn max_bitrate(&self) -> Option<u64>
pub fn max_bitrate(&self) -> Option<u64>
Total bits per second the stream may use (video + audio), or None for
the uncapped Original.
This is the number that goes to PlaybackInfo as MaxStreamingBitrate
and into the device profile. Sending it there — not just on the transcode
URL — is what makes the cap real: a stream the server decides to direct
play is served at the source file’s own bitrate, and no URL parameter
afterwards can reduce it.
Sourcepub fn audio_bitrate(&self) -> u64
pub fn audio_bitrate(&self) -> u64
Bits per second allotted to the audio track.
The value shrinks with the ladder because at the bottom rungs a fixed 384 kbps would be a third of the entire budget.
Sourcepub fn video_bitrate(&self) -> Option<u64>
pub fn video_bitrate(&self) -> Option<u64>
Bits per second allotted to the video track: the total minus the audio
share, so the two together honour max_bitrate
rather than overshooting it by the size of the audio track.
Sourcepub fn max_height(&self) -> Option<u32>
pub fn max_height(&self) -> Option<u32>
Resolution ceiling that suits the bitrate, or None to leave the source
resolution alone. Scaling down is what keeps a small budget looking like
clean video instead of blocky 1080p.
Trait Implementations§
Source§impl Clone for StreamingQuality
impl Clone for StreamingQuality
Source§fn clone(&self) -> StreamingQuality
fn clone(&self) -> StreamingQuality
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamingQuality
impl Debug for StreamingQuality
Source§impl Default for StreamingQuality
impl Default for StreamingQuality
Source§fn default() -> StreamingQuality
fn default() -> StreamingQuality
Source§impl<'de> Deserialize<'de> for StreamingQuality
impl<'de> Deserialize<'de> for StreamingQuality
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl NamedType for StreamingQuality
impl NamedType for StreamingQuality
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
Source§impl PartialEq for StreamingQuality
impl PartialEq for StreamingQuality
Source§fn eq(&self, other: &StreamingQuality) -> bool
fn eq(&self, other: &StreamingQuality) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for StreamingQuality
impl Serialize for StreamingQuality
Source§impl Type for StreamingQuality
impl Type for StreamingQuality
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
definition will be put into the type map.impl Copy for StreamingQuality
impl Eq for StreamingQuality
impl StructuralPartialEq for StreamingQuality
Auto Trait Implementations§
impl Freeze for StreamingQuality
impl RefUnwindSafe for StreamingQuality
impl Send for StreamingQuality
impl Sync for StreamingQuality
impl Unpin for StreamingQuality
impl UnsafeUnpin for StreamingQuality
impl UnwindSafe for StreamingQuality
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FunctionArg for Twhere
T: Type,
impl<T> FunctionArg for Twhere
T: Type,
§fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
DataType]. Read more