Skip to content
Search

AVPacket

lastmod 2024-05-24created 2024-05-241 edits

The AVPacket struct of FFmpeg

int64_t AVPacket::convergence_duration

Time difference in stream time base units from the point of this packet to the point where the output of the decoder converges independent of the availability of previous frames.

That is, the frames are virtually identical no matter whether decoding started from the very first frame or from this keyframe. AV_NOPTS_VALUE if unknown. This field is not the display duration of the current packet.

The purpose of this field is to allow seeking in streams that have no keyframes in the conventional sense. It corresponds to the recovery point SEI of H.264 and match_time_delta in NUT. It is also essential for some types of subtitle streams to ensure that all subtitles are displayed correctly after seeking.

int64_t AVPacket::dts

Decompression timestamp in time_base units. The time at which the packet is decompressed.

Can be AV_NOPTS_VALUE if it is not stored in the file.

int AVPacket::duration

Duration of this packet in time_base units, 0 if unknown.

Equals next_pts - this_pts in presentation order.

int AVPacket::flags

Flags of the packet

int64_t AVPacket::pos

Byte position in the stream, -1 if unknown

void* AVPacket::priv

??

int64_t AVPacket::pts

Presentation timestamp in time_base units. The time at which the decompressed packet is presented to the user.

Can be AV_NOPTS_VALUE if it is not stored in the file. pts MUST be larger than or equal to dts, as presentation cannot happen before decompression, unless one wants to view hex dumps.

Some formats misuse the terms dts and pts/cts to mean something different.

Such timestamps must be converted to true pts/dts before they are stored in an AVPacket.

int AVPacket::size

Size of the packet in bytes

int AVPacket::stream_index

Index of the stream this packet belongs to

PTS vs DTS

See Presentation timestamp#PTS vs DTS for the concept.

See also

Favorite site

author Zer0 sitemap