This structure stores compressed data. More...
|A reference to the reference-counted buffer where the packet data is stored. More...|
|Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will be presented to the user. More...|
|Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed. More...|
|A combination of AV_PKT_FLAG values. More...|
|Additional packet data that can be provided by the container. More...|
|Duration of this packet in AVStream->time_base units, 0 if unknown. More...|
|byte position in stream, -1 if unknown More...|
This structure stores compressed data.
It is typically exported by demuxers and then passed as input to decoders, or received as output from encoders and then passed to muxers.
For video, it should typically contain one compressed frame. For audio it may contain several compressed frames. Encoders are allowed to output empty packets, with no compressed data, containing only side data (e.g. to update some stream parameters at the end of encoding).
AVPacket is one of the few structs in Libav, whose size is a part of public ABI. Thus it may be allocated on stack and no new fields can be added to it without libavcodec and libavformat major bump.
The semantics of data ownership depends on the buf field. If it is set, the packet data is dynamically allocated and is valid indefinitely until a call to av_packet_unref() reduces the reference count to 0.
If the buf field is not set av_packet_ref() would make a copy instead of increasing the reference count.
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will be presented to the user.
Can be AV_NOPTS_VALUE if it is not stored in the file. pts MUST be larger 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 AVPacket.
Referenced by encode().
|attribute_deprecated int64_t AVPacket::convergence_duration|