libmedia • Docs
libmedia / avformat/AVStream / AVStream
from FFmpeg
new AVStream():
AVStream
codecpar:
AVCodecParameters
disposition:
AVDisposition
=AVDisposition.NONE
AV_DISPOSITION_* bit field
duration:
int64
=NOPTS_VALUE_BIGINT
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.
firstDTS:
int64
第一个 packet 的 dts
id:
int32
=NOPTS_VALUE
Format-specific stream ID. decoding: set by libavformat encoding: set by the user, replaced by libavformat if left unset
index:
int32
=NOPTS_VALUE
stream index in AVFormatContext
metadata:
Data
={}
nbFrames:
int64
number of frames in this stream if known or 0
privData:
any
=null
sampleIndexes:
object
[] =[]
帧索引,可用于 seek
sampleIndexesPosMap:
Map
<int64
,int32
>
pos 到 sample index 的映射
sideData:
Partial
<Record
<AVPacketSideDataType
,Uint8Array
>> ={}
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 write_header().
startTime:
int64
=NOPTS_VALUE_BIGINT
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).
The ASF header does NOT contain a correct start_time the ASF demuxer must NOT set this.
timeBase:
Rational
封装时间基
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).
destroy():
void
void