Struct AVStream
#[repr(C)]pub struct AVStream {Show 20 fields
pub av_class: *const AVClass,
pub index: i32,
pub id: i32,
pub codecpar: *mut AVCodecParameters,
pub priv_data: *mut c_void,
pub time_base: AVRational,
pub start_time: i64,
pub duration: i64,
pub nb_frames: i64,
pub disposition: i32,
pub discard: AVDiscard,
pub sample_aspect_ratio: AVRational,
pub metadata: *mut AVDictionary,
pub avg_frame_rate: AVRational,
pub attached_pic: AVPacket,
pub side_data: *mut AVPacketSideData,
pub nb_side_data: i32,
pub event_flags: i32,
pub r_frame_rate: AVRational,
pub pts_wrap_bits: i32,
}
dep_ffmpeg
only.Expand description
Stream structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVStream) must not be used outside libav*.
Fields§
§av_class: *const AVClass
A class for @ref avoptions. Set on stream creation.
index: i32
< stream index in AVFormatContext
id: i32
Format-specific stream ID. decoding: set by libavformat encoding: set by the user, replaced by libavformat if left unset
codecpar: *mut AVCodecParameters
Codec parameters associated with this stream. Allocated and freed by libavformat in avformat_new_stream() and avformat_free_context() respectively.
- demuxing: filled by libavformat on stream creation or in avformat_find_stream_info()
- muxing: filled by the caller before avformat_write_header()
priv_data: *mut c_void
§time_base: AVRational
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
decoding: set by libavformat encoding: May be set by the caller before avformat_write_header() to provide a hint to the muxer about the desired timebase. In avformat_write_header(), the muxer will overwrite this field with the timebase that will actually be used for the timestamps written into the file (which may or may not be related to the user-provided one, depending on the format).
start_time: i64
Decoding: pts of the first frame of the stream in presentation order, in stream time base. Only set this if you are absolutely 100% sure that the value you set it to really is the pts of the first frame. This may be undefined (AV_NOPTS_VALUE). @note The ASF header does NOT contain a correct start_time the ASF demuxer must NOT set this.
duration: i64
Decoding: duration of the stream, in stream time base. If a source file does not specify a duration, but does specify a bitrate, this value will be estimated from bitrate and file size.
Encoding: May be set by the caller before avformat_write_header() to provide a hint to the muxer about the estimated duration.
nb_frames: i64
< number of frames in this stream if known or 0
disposition: i32
Stream disposition - a combination of AV_DISPOSITION_* flags.
- demuxing: set by libavformat when creating the stream or in avformat_find_stream_info().
- muxing: may be set by the caller before avformat_write_header().
discard: AVDiscard
< Selects which packets can be discarded at will and do not need to be demuxed.
sample_aspect_ratio: AVRational
sample aspect ratio (0 if unknown)
- encoding: Set by user.
- decoding: Set by libavformat.
metadata: *mut AVDictionary
§avg_frame_rate: AVRational
Average framerate
- demuxing: May be set by libavformat when creating the stream or in avformat_find_stream_info().
- muxing: May be set by the caller before avformat_write_header().
attached_pic: AVPacket
For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached picture.
decoding: set by libavformat, must not be modified by the caller. encoding: unused
side_data: *mut AVPacketSideData
An array of side data that applies to the whole stream (i.e. the container does not allow it to change between packets).
There may be no overlap between the side data in this array and side data in the packets. I.e. a given side data is either exported by the muxer (demuxing) / set by the caller (muxing) in this array, then it never appears in the packets, or the side data is exported / sent through the packets (always in the first packet where the value becomes known or changes), then it does not appear in this array.
- demuxing: Set by libavformat when the stream is created.
- muxing: May be set by the caller before avformat_write_header().
Freed by libavformat in avformat_free_context().
@deprecated use AVStream’s @ref AVCodecParameters.coded_side_data “codecpar side data”.
nb_side_data: i32
The number of elements in the AVStream.side_data array.
@deprecated use AVStream’s @ref AVCodecParameters.nb_coded_side_data “codecpar side data”.
event_flags: i32
Flags indicating events happening on the stream, a combination of AVSTREAM_EVENT_FLAG_*.
- demuxing: may be set by the demuxer in avformat_open_input(), avformat_find_stream_info() and av_read_frame(). Flags must be cleared by the user once the event has been handled.
- muxing: may be set by the user after avformat_write_header(). to indicate a user-triggered event. The muxer will clear the flags for events it has handled in av_[interleaved]_write_frame().
r_frame_rate: AVRational
Real base framerate of the stream. This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream). Note, this value is just a guess! For example, if the time base is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
pts_wrap_bits: i32
Number of bits in timestamps. Used for wrapping control.
- demuxing: set by libavformat
- muxing: set by libavformat
Trait Implementations§
impl Copy for AVStream
impl Eq for AVStream
impl StructuralPartialEq for AVStream
Auto Trait Implementations§
impl Freeze for AVStream
impl RefUnwindSafe for AVStream
impl !Send for AVStream
impl !Sync for AVStream
impl Unpin for AVStream
impl UnwindSafe for AVStream
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> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more