Struct ffmpeg_sys_the_third::AVStream

source ·
#[repr(C)]
pub struct AVStream {
Show 41 fields pub index: c_int, pub id: c_int, pub codec: *mut AVCodecContext, pub priv_data: *mut c_void, pub time_base: AVRational, pub start_time: i64, pub duration: i64, pub nb_frames: i64, pub disposition: c_int, 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: c_int, pub event_flags: c_int, pub r_frame_rate: AVRational, pub recommended_encoder_configuration: *mut c_char, pub codecpar: *mut AVCodecParameters, pub unused: *mut c_void, pub pts_wrap_bits: c_int, pub first_dts: i64, pub cur_dts: i64, pub last_IP_pts: i64, pub last_IP_duration: c_int, pub probe_packets: c_int, pub codec_info_nb_frames: c_int, pub need_parsing: AVStreamParseType, pub parser: *mut AVCodecParserContext, pub unused7: *mut c_void, pub unused6: AVProbeData, pub unused5: [i64; 17], pub index_entries: *mut AVIndexEntry, pub nb_index_entries: c_int, pub index_entries_allocated_size: c_uint, pub stream_identifier: c_int, pub unused8: c_int, pub unused9: c_int, pub unused10: c_int, pub internal: *mut AVStreamInternal,
}
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§

§index: c_int

< stream index in AVFormatContext

§id: c_int

Format-specific stream ID. decoding: set by libavformat encoding: set by the user, replaced by libavformat if left unset

§codec: *mut AVCodecContext

@deprecated use the codecpar struct instead

§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: c_int

< AV_DISPOSITION_* bit field

§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().

@see av_format_inject_global_side_data()

§nb_side_data: c_int

The number of elements in the AVStream.side_data array.

§event_flags: c_int

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.

§recommended_encoder_configuration: *mut c_char

String containing pairs of key and values describing recommended encoder configuration. Pairs are separated by ‘,’. Keys are separated from values by ‘=’.

@deprecated unused

§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()
§unused: *mut c_void§pts_wrap_bits: c_int

< number of bits in pts (used for wrapping control)

§first_dts: i64

Timestamp corresponding to the last dts sync point.

Initialized when AVCodecParserContext.dts_sync_point >= 0 and a DTS is received from the underlying container. Otherwise set to AV_NOPTS_VALUE by default.

§cur_dts: i64§last_IP_pts: i64§last_IP_duration: c_int§probe_packets: c_int

Number of packets to buffer for codec probing

§codec_info_nb_frames: c_int

Number of frames that have been demuxed during avformat_find_stream_info()

§need_parsing: AVStreamParseType§parser: *mut AVCodecParserContext§unused7: *mut c_void§unused6: AVProbeData§unused5: [i64; 17]§index_entries: *mut AVIndexEntry

< Only used if the format does not support seeking natively.

§nb_index_entries: c_int§index_entries_allocated_size: c_uint§stream_identifier: c_int

Stream Identifier This is the MPEG-TS stream identifier +1 0 means unknown

§unused8: c_int§unused9: c_int§unused10: c_int§internal: *mut AVStreamInternal

An opaque field for libavformat internal usage. Must not be accessed in any way by callers.

Trait Implementations§

source§

impl Clone for AVStream

source§

fn clone(&self) -> AVStream

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AVStream

source§

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

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

impl PartialEq for AVStream

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for AVStream

source§

impl Eq for AVStream

source§

impl StructuralPartialEq for AVStream

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> 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,

§

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>,

§

type Error = Infallible

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>,

§

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.