#[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: i32,
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,
}
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: i32
< 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