Skip to main content

ByteStreamEncoding

Enum ByteStreamEncoding 

Source
#[non_exhaustive]
pub enum ByteStreamEncoding {
Show 20 variants MpegTs, Matroska, Ogg, Flv, IsoBmff, Mp4, Ivf, MpegPs, Wav, Aiff, Au, Avi, Y4m, Multipart, Raw, Rtp, Srtp, Rtcp, Srtcp, Dtls,
}
Expand description

Wire format of a Caps::ByteStream link, so a demuxer accepts only the container it parses (an MPEG-TS demuxer rejects an arbitrary byte stream structurally, like the codec/raw split does for video).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MpegTs

MPEG-2 Transport Stream (ISO/IEC 13818-1): 188-byte packets, PAT/PMT, PES. The broadcast / SRT / HLS-segment carrier.

§

Matroska

Matroska / WebM (EBML): nested variable-length elements; Tracks describe the elementary streams and Clusters carry the SimpleBlock frames. The common file container, WebM being the browser-delivery subset (VP8 / VP9 / AV1 video + Opus / Vorbis audio).

§

Ogg

Ogg (RFC 3533): “OggS” pages with a segment-table lacing that frames the packets of a logical bitstream. The canonical Opus / Vorbis carrier.

§

Flv

FLV (Flash Video): an “FLV” header then PreviousTagSize / tag pairs, each tag a codec-tagged audio / video / script payload. The RTMP carrier.

§

IsoBmff

ISO Base Media File Format / fragmented MP4 (CMAF): ftyp/moov init then moof+mdat fragments. The modern HLS/DASH segment container, demuxed by fmp4demux incrementally (a live stream, no end).

§

Mp4

Progressive / whole-file MP4 / QuickTime (M479): ftyp + moov (sample tables) + mdat, in either order. A seekable file rather than a live stream, so it is demuxed by mp4demux after the whole file is buffered (the moov may sit at the end, and stco chunk offsets are absolute). The local .mp4 / .mov case, distinct from the streaming IsoBmff above so the auto-plugger picks the whole-file demuxer for files and the incremental one for HLS / DASH.

§

Ivf

IVF: a 32-byte DKIF header (FourCC codec + geometry + timebase) then a 12-byte size+timestamp header before each frame. The simple raw container libvpx / libaom conformance vectors ship in (VP8 / VP9 / AV1).

§

MpegPs

MPEG-1 / MPEG-2 Program Stream (ISO/IEC 13818-1): packs, each a 00 00 01 BA header plus the PES packets that follow it, streams identified by PES stream_id rather than a PID and a PMT. The .mpg / .vob file carrier (VCD, SVCD, DVD), demuxed by mpegpsdemux.

§

Wav

RIFF/WAVE (.wav): a RIFF chunk holding a fmt descriptor and a data chunk of interleaved PCM. The uncompressed file container, and the one an audio tool reads without a demuxer.

§

Aiff

AIFF / AIFC (.aiff / .aif / .aifc): an EA IFF 85 FORM of type AIFF or AIFC holding a COMM descriptor and an SSND sample chunk. The Mac / interchange sibling of WAVE, parsed by aiffparse and written by aiffmux. Multi-byte PCM is big-endian on the wire and swapped to the little-endian AudioFormat the rest of the graph uses.

§

Au

Sun / NeXT AU (.au / .snd): a 24-byte big-endian .snd header then the samples. The Unix sibling of WAVE, parsed by auparse and written by avmux_au. Multi-byte PCM is big-endian on the wire, same swap as AIFF.

§

Avi

AVI (.avi): the RIFF sibling of WAVE, a hdrl list describing one stream per strl and a movi list of the interleaved data chunks, with an idx1 at the end. Demuxed by avidemux, written by avimux.

§

Y4m

YUV4MPEG2 (.y4m): a YUV4MPEG2 W.. H.. F.. text header then a FRAME line before each frame’s planes. The uncompressed video counterpart of WAV, and what encoders and quality tools exchange raw frames in.

§

Multipart

MIME multipart (multipart/x-mixed-replace, RFC 2046): a --boundary line, MIME headers, and a body, repeated. What an IP camera or an mjpg-streamer-style server pushes MJPEG over HTTP with, demuxed by multipartdemux and written by multipartmux.

§

Raw

No container and no framing: a headerless dump whose shape is declared out of band, the .yuv / .pcm file rawvideoparse / rawaudioparse frame from their properties. Content sniffing never answers Raw, since any byte sequence matches it.

§

Rtp

One complete RTP packet per frame.

§

Srtp

One complete SRTP packet per frame.

§

Rtcp

One complete RTCP packet per frame.

§

Srtcp

One complete SRTCP packet per frame.

§

Dtls

One datagram per frame carrying DTLS records multiplexed with SRTP and SRTCP, split on the first byte per RFC 7983.

Trait Implementations§

Source§

impl Clone for ByteStreamEncoding

Source§

fn clone(&self) -> ByteStreamEncoding

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 Copy for ByteStreamEncoding

Source§

impl Debug for ByteStreamEncoding

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ByteStreamEncoding

Source§

impl Hash for ByteStreamEncoding

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ByteStreamEncoding

Source§

fn eq(&self, other: &ByteStreamEncoding) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ByteStreamEncoding

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> 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> ElementBound for T
where T: Send,

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> 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 = !

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.