FFmpeg  1.2.12
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
AVPacket
Core functions/structures. | Memory Management | Decoding | Encoding

Types and functions for working with AVPacket. More...

Modules

 Decoding

Data Structures

struct  AVPacket
 This structure stores compressed data. More...

Macros

#define AV_PKT_FLAG_KEY   0x0001
 The packet contains a keyframe.
#define AV_PKT_FLAG_CORRUPT   0x0002
 The packet content is corrupted.
#define AV_PKT_FLAG_KEY   0x0001
 The packet contains a keyframe.
#define AV_PKT_FLAG_CORRUPT   0x0002
 The packet content is corrupted.
#define AV_PKT_FLAG_KEY   0x0001
 The packet contains a keyframe.
#define AV_PKT_FLAG_CORRUPT   0x0002
 The packet content is corrupted.

Typedefs

typedef struct AVPacket AVPacket
 This structure stores compressed data.
typedef struct AVPacket AVPacket
 This structure stores compressed data.
typedef struct AVPacket AVPacket
 This structure stores compressed data.

Enumerations

enum  AVPacketSideDataType {
  AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, AV_PKT_DATA_PARAM_CHANGE, AV_PKT_DATA_H263_MB_INFO,
  AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_STRINGS_METADATA, AV_PKT_DATA_SUBTITLE_POSITION,
  AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, AV_PKT_DATA_PARAM_CHANGE,
  AV_PKT_DATA_H263_MB_INFO, AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_STRINGS_METADATA,
  AV_PKT_DATA_SUBTITLE_POSITION, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA,
  AV_PKT_DATA_PARAM_CHANGE, AV_PKT_DATA_H263_MB_INFO, AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO,
  AV_PKT_DATA_STRINGS_METADATA, AV_PKT_DATA_SUBTITLE_POSITION, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
}
enum  AVSideDataParamChangeFlags {
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008
}
enum  AVPacketSideDataType {
  AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, AV_PKT_DATA_PARAM_CHANGE, AV_PKT_DATA_H263_MB_INFO,
  AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_STRINGS_METADATA, AV_PKT_DATA_SUBTITLE_POSITION,
  AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, AV_PKT_DATA_PARAM_CHANGE,
  AV_PKT_DATA_H263_MB_INFO, AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_STRINGS_METADATA,
  AV_PKT_DATA_SUBTITLE_POSITION, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA,
  AV_PKT_DATA_PARAM_CHANGE, AV_PKT_DATA_H263_MB_INFO, AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO,
  AV_PKT_DATA_STRINGS_METADATA, AV_PKT_DATA_SUBTITLE_POSITION, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
}
enum  AVSideDataParamChangeFlags {
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008
}
enum  AVPacketSideDataType {
  AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, AV_PKT_DATA_PARAM_CHANGE, AV_PKT_DATA_H263_MB_INFO,
  AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_STRINGS_METADATA, AV_PKT_DATA_SUBTITLE_POSITION,
  AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, AV_PKT_DATA_PARAM_CHANGE,
  AV_PKT_DATA_H263_MB_INFO, AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_STRINGS_METADATA,
  AV_PKT_DATA_SUBTITLE_POSITION, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA,
  AV_PKT_DATA_PARAM_CHANGE, AV_PKT_DATA_H263_MB_INFO, AV_PKT_DATA_SKIP_SAMPLES = 70, AV_PKT_DATA_JP_DUALMONO,
  AV_PKT_DATA_STRINGS_METADATA, AV_PKT_DATA_SUBTITLE_POSITION, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
}
enum  AVSideDataParamChangeFlags {
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
  AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008
}

Functions

void av_destruct_packet (AVPacket *pkt)
 Default packet destructor.
void av_init_packet (AVPacket *pkt)
 Initialize optional fields of a packet with default values.
int av_new_packet (AVPacket *pkt, int size)
 Allocate the payload of a packet and initialize its fields with default values.
void av_shrink_packet (AVPacket *pkt, int size)
 Reduce packet size, correctly zeroing padding.
int av_grow_packet (AVPacket *pkt, int grow_by)
 Increase packet size, correctly zeroing padding.
int av_dup_packet (AVPacket *pkt)
int av_copy_packet (AVPacket *dst, AVPacket *src)
 Copy packet, including contents.
void av_free_packet (AVPacket *pkt)
 Free a packet.
uint8_tav_packet_new_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int size)
 Allocate new information of a packet.
int av_packet_shrink_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int size)
 Shrink the already allocated side data buffer.
uint8_tav_packet_get_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int *size)
 Get side information from packet.
int av_packet_merge_side_data (AVPacket *pkt)
int av_packet_split_side_data (AVPacket *pkt)

Detailed Description

Types and functions for working with AVPacket.

< preferred ID for MPEG-1/2 video decoding

< A dummy id pointing at the start of audio codecs

< preferred ID for decoding MPEG audio layer 1, 2 or 3

< as in Berlin toast format

< A dummy ID pointing at the start of subtitle codecs.

< raw UTF-8 text

< A dummy ID pointing at the start of various fake codecs.

< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it

< FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)

  < _FAKE_ codec to indicate a MPEG-4 Systems

stream (only used by libavformat)

< Dummy codec for streams containing only metadata information.

This struct describes the properties of a single codec described by an AVCodecID.

See Also
avcodec_get_descriptor()

Name of the codec described by this descriptor. It is non-empty and unique for each codec descriptor. It should contain alphanumeric characters and '_' only.

A more descriptive name for this codec. May be NULL.

Codec properties, a combination of AV_CODEC_PROP_* flags.

Codec uses only intra compression. Video codecs only.

Codec supports lossy compression. Audio and video codecs only.

Note
a codec may support both lossy and lossless compression modes

Codec supports lossless compression. Audio and video codecs only.

Subtitle codec is bitmap based

Required number of additionally allocated bytes at the end of the input bitstream for decoding. This is mainly needed because some optimized bitstream readers read 32 or 64 bit at once and could read over the end.
Note: If the first 23 bits of the additional bytes are not 0, then damaged MPEG bitstreams could cause overread and segfault.

minimum encoding buffer size Used to avoid some checks during header writing.

motion estimation type.

< no search, that is use 0,0 vector whenever one is needed

< enhanced predictive zonal search

< reserved for experiments

< hexagon based search

< uneven multi-hexagon search

< iterative search

< transformed exhaustive search algorithm

< discard nothing

< discard useless packets like 0 size packets in avi

< discard all non reference

< discard all bidirectional frames

< discard all frames except keyframes

< discard all

< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B

< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM

< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC

< functionally identical to above

< Not part of ABI

< also ITU-R BT1361

< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM

< also ITU-R BT470BG

< Not part of ABI

< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B

< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601

< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above

< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16

< Not part of ABI

< the normal 219*2^(n-8) "MPEG" YUV ranges

< the normal 2^n-1 "JPEG" YUV ranges

< Not part of ABI

X X 3 4 X X are luma samples, 1 2 1-6 are possible chroma positions X X 5 6 X 0 is undefined/unknown position

< mpeg2/4, h264 default

< mpeg1, jpeg, h263

< DV

< Not part of ABI

< Not part of ABI

The parent program guarantees that the input for B-frames containing streams is not written to for at least s->max_b_frames+1 frames, if this is not set the input will be copied.

Codec uses get_buffer() for allocating buffers and supports custom allocators. If not set, it might not use get_buffer() at all or use operations that assume the buffer was allocated by avcodec_default_get_buffer.

Encoder or decoder requires flushing with NULL input at the end in order to give the complete and correct output.

NOTE: If this flag is not set, the codec is guaranteed to never be fed with with NULL data. The user can still send NULL data to the public encode or decode function, but libavcodec will not pass it along to the codec unless this flag is set.

Decoders: The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, avpkt->size=0 at the end to get the delayed data until the decoder no longer returns frames.

Encoders: The encoder needs to be fed with NULL data at the end of encoding until the encoder no longer returns data.

NOTE: For encoders implementing the AVCodec.encode2() function, setting this flag also means that the encoder must set the pts and duration for each output packet. If this flag is not set, the pts and duration will be determined by libavcodec from the input frame.

Codec can be fed a final frame with a smaller size. This can be used to prevent truncation of the last audio samples.

Codec can export data for HW decoding (VDPAU).

Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time, demuxers which do not do are connected to a parser to split what they return into proper frames. This flag is reserved to the very rare category of codecs which have a bitstream that cannot be split into frames without timeconsuming operations like full decoding. Demuxers carring such bitstreams thus may return multiple frames in a packet. This has many disadvantages like prohibiting stream copy in many cases thus it should only be considered as a last resort.

Codec is experimental and is thus avoided in favor of non experimental encoders

Codec should fill in channel configuration and samplerate instead of container

Codec is able to deal with negative linesizes

Codec supports frame-level multithreading.

Codec supports slice-based (or partition-based) multithreading.

Codec supports changed parameters at any point.

Codec supports avctx->thread_count == 0 (auto).

Audio encoder supports receiving a different number of samples in each call.

Codec is intra only.

Codec is lossless.

Pan Scan area. This specifies the area which should be displayed. Note there may be multiple such areas for one frame.

id

width and height in 1/16 pel

position of the top left corner in 1/16 pel for up to 3 fields/frames

Types and functions for working with AVPacket.

< preferred ID for MPEG-1/2 video decoding

< A dummy id pointing at the start of audio codecs

< preferred ID for decoding MPEG audio layer 1, 2 or 3

< as in Berlin toast format

< A dummy ID pointing at the start of subtitle codecs.

< raw UTF-8 text

< A dummy ID pointing at the start of various fake codecs.

< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it

< FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)

  < _FAKE_ codec to indicate a MPEG-4 Systems

stream (only used by libavformat)

< Dummy codec for streams containing only metadata information.

This struct describes the properties of a single codec described by an AVCodecID.

See Also
avcodec_get_descriptor()

Name of the codec described by this descriptor. It is non-empty and unique for each codec descriptor. It should contain alphanumeric characters and '_' only.

A more descriptive name for this codec. May be NULL.

Codec properties, a combination of AV_CODEC_PROP_* flags.

Codec uses only intra compression. Video codecs only.

Codec supports lossy compression. Audio and video codecs only.

Note
a codec may support both lossy and lossless compression modes

Codec supports lossless compression. Audio and video codecs only.

Subtitle codec is bitmap based

Required number of additionally allocated bytes at the end of the input bitstream for decoding. This is mainly needed because some optimized bitstream readers read 32 or 64 bit at once and could read over the end.
Note: If the first 23 bits of the additional bytes are not 0, then damaged MPEG bitstreams could cause overread and segfault.

minimum encoding buffer size Used to avoid some checks during header writing.

motion estimation type.

< no search, that is use 0,0 vector whenever one is needed

< enhanced predictive zonal search

< reserved for experiments

< hexagon based search

< uneven multi-hexagon search

< iterative search

< transformed exhaustive search algorithm

< discard nothing

< discard useless packets like 0 size packets in avi

< discard all non reference

< discard all bidirectional frames

< discard all frames except keyframes

< discard all

< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B

< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM

< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC

< functionally identical to above

< Not part of ABI

< also ITU-R BT1361

< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM

< also ITU-R BT470BG

< Not part of ABI

< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B

< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601

< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above

< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16

< Not part of ABI

< the normal 219*2^(n-8) "MPEG" YUV ranges

< the normal 2^n-1 "JPEG" YUV ranges

< Not part of ABI

X X 3 4 X X are luma samples, 1 2 1-6 are possible chroma positions X X 5 6 X 0 is undefined/unknown position

< mpeg2/4, h264 default

< mpeg1, jpeg, h263

< DV

< Not part of ABI

< Not part of ABI

The parent program guarantees that the input for B-frames containing streams is not written to for at least s->max_b_frames+1 frames, if this is not set the input will be copied.

Codec uses get_buffer() for allocating buffers and supports custom allocators. If not set, it might not use get_buffer() at all or use operations that assume the buffer was allocated by avcodec_default_get_buffer.

Encoder or decoder requires flushing with NULL input at the end in order to give the complete and correct output.

NOTE: If this flag is not set, the codec is guaranteed to never be fed with with NULL data. The user can still send NULL data to the public encode or decode function, but libavcodec will not pass it along to the codec unless this flag is set.

Decoders: The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, avpkt->size=0 at the end to get the delayed data until the decoder no longer returns frames.

Encoders: The encoder needs to be fed with NULL data at the end of encoding until the encoder no longer returns data.

NOTE: For encoders implementing the AVCodec.encode2() function, setting this flag also means that the encoder must set the pts and duration for each output packet. If this flag is not set, the pts and duration will be determined by libavcodec from the input frame.

Codec can be fed a final frame with a smaller size. This can be used to prevent truncation of the last audio samples.

Codec can export data for HW decoding (VDPAU).

Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time, demuxers which do not do are connected to a parser to split what they return into proper frames. This flag is reserved to the very rare category of codecs which have a bitstream that cannot be split into frames without timeconsuming operations like full decoding. Demuxers carring such bitstreams thus may return multiple frames in a packet. This has many disadvantages like prohibiting stream copy in many cases thus it should only be considered as a last resort.

Codec is experimental and is thus avoided in favor of non experimental encoders

Codec should fill in channel configuration and samplerate instead of container

Codec is able to deal with negative linesizes

Codec supports frame-level multithreading.

Codec supports slice-based (or partition-based) multithreading.

Codec supports changed parameters at any point.

Codec supports avctx->thread_count == 0 (auto).

Audio encoder supports receiving a different number of samples in each call.

Codec is intra only.

Codec is lossless.

Pan Scan area. This specifies the area which should be displayed. Note there may be multiple such areas for one frame.

id

width and height in 1/16 pel

position of the top left corner in 1/16 pel for up to 3 fields/frames

Types and functions for working with AVPacket.

Macro Definition Documentation

#define AV_PKT_FLAG_CORRUPT   0x0002
#define AV_PKT_FLAG_CORRUPT   0x0002

The packet content is corrupted.

Definition at line 1085 of file avcodec.h.

#define AV_PKT_FLAG_CORRUPT   0x0002

The packet content is corrupted.

Definition at line 1085 of file avcodec.h.

#define AV_PKT_FLAG_KEY   0x0001

The packet contains a keyframe.

Examples:
doc/examples/muxing.c.

Definition at line 1084 of file avcodec.h.

Referenced by a64multi_encode_frame(), ape_tag_read_field(), asf_read_picture(), asf_read_pts(), asf_write_packet(), av_read_frame(), avcodec_encode_audio2(), avi_write_packet(), avpriv_dv_produce_packet(), avs_read_audio_packet(), avs_read_video_packet(), avui_encode_frame(), bmp_encode_frame(), cdxl_read_packet(), compute_pkt_fields(), dc1394_read_common(), decode_frame(), dirac_gptopts(), dnxhd_encode_picture(), do_streamcopy(), do_video_out(), dv_extract_audio_info(), ea_read_packet(), encode_frame(), encode_picture_lossless(), encode_picture_ls(), ff_asf_parse_packet(), ff_id3v2_parse_apic(), ff_mov_add_hinted_packet(), ff_mov_write_packet(), ff_MPV_encode_picture(), ff_rm_parse_packet(), ff_rm_retrieve_cache(), ff_subtitles_queue_insert(), ffm_read_packet(), ffm_write_packet(), flashsv2_encode_frame(), flashsv_decode_frame(), flashsv_encode_frame(), flv_data_packet(), flv_read_packet(), flv_write_packet(), framecrc_write_packet(), get_attachment(), get_needed_flags(), gif_encode_frame(), gif_read_packet(), h263_handle_packet(), hls_read_packet(), hls_write_packet(), http_prepare_data(), idcin_read_packet(), iff_read_packet(), img_read_packet(), ism_write_packet(), libopenjpeg_encode_frame(), libschroedinger_encode_frame(), lmlm4_read_packet(), lvf_read_packet(), lxf_read_packet(), main(), matroska_parse_block(), mkv_write_packet(), mkv_write_packet_internal(), modplug_read_packet(), mov_create_chapter_track(), mov_create_timecode_track(), mov_parse_vc1_frame(), mov_read_covr(), mov_read_packet(), mov_write_single_packet(), mpeg_mux_write_packet(), mpegts_write_flush(), mpegts_write_packet_internal(), msnwc_tcp_read_packet(), mv_read_packet(), nsv_read_chunk(), nut_read_packet(), nut_write_packet(), nuv_packet(), ogg_read_packet(), ogg_read_timestamp(), ogg_validate_keyframe(), ogg_write_packet(), ogm_packet(), old_dirac_gptopts(), pam_encode_frame(), parse_packet(), parse_picture(), pcx_encode_frame(), pkt_dump_internal(), pnm_encode_frame(), prores_encode_frame(), put_payload_header(), qt_rtp_parse_packet(), qtrle_encode_frame(), raw_encode(), read_frame(), read_frame_internal(), read_packet(), rm_write_audio(), rm_write_video(), roq_encode_frame(), rpl_read_packet(), search_hi_lo_keyframes(), seek_frame_generic(), seg_write_packet(), show_packet(), siff_read_packet(), smush_read_packet(), Stagefright_decode_frame(), storeframe(), sunrast_encode_frame(), svq1_encode_frame(), targa_encode_frame(), theora_gptopts(), tmv_read_packet(), utvideo_encode_frame(), v308_encode_frame(), v408_encode_frame(), v410_encode_frame(), vc1t_read_packet(), vc1test_write_packet(), vid_read_packet(), write_frame(), write_timestamp(), write_video_frame(), X264_frame(), XAVS_frame(), xbm_encode_frame(), xface_encode_frame(), xmv_fetch_video_packet(), xvid_encode_frame(), xwd_encode_frame(), y41p_encode_frame(), yop_read_packet(), yuv4_encode_frame(), and zerocodec_decode_frame().

#define AV_PKT_FLAG_KEY   0x0001

The packet contains a keyframe.

Definition at line 1084 of file avcodec.h.

#define AV_PKT_FLAG_KEY   0x0001

The packet contains a keyframe.

Definition at line 1084 of file avcodec.h.

Typedef Documentation

typedef struct AVPacket AVPacket

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.

AVPacket is one of the few structs in FFmpeg, 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 destruct field. If it is set, the packet data is dynamically allocated and is valid indefinitely until av_free_packet() is called (which in turn calls the destruct callback to free the data). If destruct is not set, the packet data is typically backed by some static buffer somewhere and is only valid for a limited time (e.g. until the next read call when demuxing).

The side data is always allocated with av_malloc() and is freed in av_free_packet().

typedef struct AVPacket AVPacket

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.

AVPacket is one of the few structs in FFmpeg, 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 destruct field. If it is set, the packet data is dynamically allocated and is valid indefinitely until av_free_packet() is called (which in turn calls the destruct callback to free the data). If destruct is not set, the packet data is typically backed by some static buffer somewhere and is only valid for a limited time (e.g. until the next read call when demuxing).

The side data is always allocated with av_malloc() and is freed in av_free_packet().

typedef struct AVPacket AVPacket

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.

AVPacket is one of the few structs in FFmpeg, 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 destruct field. If it is set, the packet data is dynamically allocated and is valid indefinitely until av_free_packet() is called (which in turn calls the destruct callback to free the data). If destruct is not set, the packet data is typically backed by some static buffer somewhere and is only valid for a limited time (e.g. until the next read call when demuxing).

The side data is always allocated with av_malloc() and is freed in av_free_packet().

Enumeration Type Documentation

Enumerator:
AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
s32le channel_count
u64le channel_layout
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

Definition at line 910 of file avcodec.h.

Enumerator:
AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

Definition at line 910 of file avcodec.h.

Enumerator:
AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

AV_PKT_DATA_PALETTE 
AV_PKT_DATA_NEW_EXTRADATA 
AV_PKT_DATA_PARAM_CHANGE 

An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:

u32le param_flags
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
s32le channel_count
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
u64le channel_layout
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
s32le width
s32le height
AV_PKT_DATA_H263_MB_INFO 

An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g.

as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows:

u32le bit offset from the start of the packet
u8 current quantizer at the start of the macroblock
u8 GOB number
u16le macroblock address within the GOB
u8 horizontal MV predictor
u8 vertical MV predictor
u8 horizontal MV predictor for block number 3
u8 vertical MV predictor for block number 3
AV_PKT_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_PKT_DATA_JP_DUALMONO 

An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used.

u8 selected channels (0=mail/left, 1=sub/right, 2=both)
AV_PKT_DATA_STRINGS_METADATA 

A list of zero terminated key/value strings.

There is no end marker for the list, so it is required to rely on the side data size to stop.

AV_PKT_DATA_SUBTITLE_POSITION 

Subtitle event position.

u32le x1
u32le y1
u32le x2
u32le y2
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL 

Data found in BlockAdditional element of matroska container.

There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data.

Definition at line 910 of file avcodec.h.

Enumerator:
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 

Definition at line 1087 of file avcodec.h.

Enumerator:
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 

Definition at line 1087 of file avcodec.h.

Enumerator:
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT 
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT 
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE 
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS 

Definition at line 1087 of file avcodec.h.

Function Documentation

int av_copy_packet ( AVPacket dst,
AVPacket src 
)

Copy packet, including contents.

Returns
0 on success, negative AVERROR on fail

Definition at line 166 of file avpacket.c.

Referenced by aiff_write_packet(), tee_write_packet(), and write_packet().

void av_destruct_packet ( AVPacket pkt)
int av_dup_packet ( AVPacket pkt)
Warning
This is a hack - the packet memory allocation stuff is broken. The packet is allocated if it was not really allocated.

Definition at line 155 of file avpacket.c.

Referenced by av_read_frame(), avcodec_encode_audio2(), avcodec_encode_video2(), avformat_find_stream_info(), ff_interleave_add_packet(), input_thread(), packet_queue_put(), parse_packet(), tee_write_packet(), and worker().

void av_free_packet ( AVPacket pkt)

Free a packet.

Parameters
pktpacket to free
Examples:
doc/examples/decoding_encoding.c, doc/examples/demuxing.c, doc/examples/filtering_audio.c, and doc/examples/filtering_video.c.

Definition at line 172 of file avpacket.c.

Referenced by adx_read_packet(), aiff_write_trailer(), amr_read_packet(), asf_read_header(), asf_read_picture(), asf_read_pts(), asf_reset_header(), asfrtp_parse_packet(), audio_decode_frame(), audio_encode_example(), audio_read_packet(), av_get_packet(), av_interleaved_write_frame(), av_packet_merge_side_data(), av_write_trailer(), avcodec_encode_audio2(), avcodec_encode_video2(), avi_read_close(), avs_read_video_packet(), cdxl_read_packet(), cin_read_packet(), dfa_read_packet(), do_audio_out(), do_video_out(), dxa_read_packet(), ea_read_packet(), encode_frame(), estimate_timings_from_pts(), extract_mpeg4_header(), ff_asf_parse_packet(), ff_free_stream(), ff_raw_read_partial_packet(), ff_read_packet(), ff_rm_free_rmstream(), ff_spdif_read_packet(), ffm_read_packet(), fourxm_read_packet(), free_input_threads(), free_packet_buffer(), free_packet_list(), free_pkt_fifo(), free_variant_list(), g723_1_read_packet(), gsm_read_packet(), hls_read_seek(), http_prepare_data(), idcin_read_packet(), ilbc_read_packet(), img_read_packet(), interleave_packet(), load_ipmovie_packet(), lxf_read_packet(), main(), matroska_clear_queue(), matroska_merge_packets(), modplug_read_packet(), mov_write_subtitle_end_packet(), movie_push_frame(), mp3_queue_flush(), mpc_read_packet(), mpc_read_seek(), mpegts_get_dts(), mpegts_raw_read_packet(), mpegts_read_packet(), mxf_interleave_get_packet(), nc_read_packet(), nsv_read_close(), nuv_packet(), packet_queue_flush(), packet_queue_put(), parse_packet(), process_input(), pulse_read_packet(), qt_rtp_parse_packet(), read_frame_internal(), read_packet(), read_packets(), read_thread(), recode_subtitle(), rl2_read_packet(), rm_assemble_video_frame(), rm_read_packet(), rpl_read_packet(), sap_fetch_packet(), search_hi_lo_keyframes(), seek_frame_generic(), seek_subtitle(), str_read_close(), str_read_packet(), stream_component_close(), subtitle_thread(), thp_read_packet(), video_encode_example(), video_thread(), vivo_read_packet(), vmd_read_packet(), vqf_read_packet(), wc3_read_close(), write_frame(), write_trailer(), wv_read_packet(), wv_read_seek(), xiph_handle_packet(), xvid_encode_frame(), yop_read_close(), yop_read_packet(), and yop_read_seek().

int av_grow_packet ( AVPacket pkt,
int  grow_by 
)

Increase packet size, correctly zeroing padding.

Parameters
pktpacket
grow_bynumber of bytes by which to increase the size of the packet

Definition at line 87 of file avpacket.c.

Referenced by av_append_packet(), ff_subtitles_queue_insert(), and matroska_merge_packets().

void av_init_packet ( AVPacket pkt)
int av_new_packet ( AVPacket pkt,
int  size 
)

Allocate the payload of a packet and initialize its fields with default values.

Parameters
pktpacket
sizewanted payload size
Returns
0 if OK, AVERROR_xxx otherwise

Definition at line 60 of file avpacket.c.

Referenced by aac_parse_packet(), amr_handle_packet(), amr_read_packet(), ape_read_packet(), audio_read_packet(), av_get_packet(), av_grow_packet(), avisynth_read_packet(), avs_read_video_packet(), bmv_read_packet(), callback(), cdxl_read_packet(), cin_read_packet(), decode_frame(), dxa_read_packet(), fbdev_read_packet(), ff_alloc_packet2(), ff_asf_parse_packet(), ff_h263_handle_packet(), ff_interleave_new_audio_packet(), ff_raw_read_partial_packet(), ff_rm_retrieve_cache(), ff_spdif_read_packet(), ff_subtitles_queue_insert(), ffm_read_packet(), film_read_packet(), fourxm_read_packet(), g723_1_read_packet(), grab_read_packet(), h264_handle_packet(), iff_read_packet(), ilbc_read_packet(), img_read_packet(), latm_parse_packet(), lavfi_read_packet(), load_ipmovie_packet(), lxf_read_packet(), matroska_parse_frame(), matroska_parse_rm_audio(), mmap_read_frame(), modplug_read_packet(), mpc_read_packet(), mpeg_parse_packet(), mpegts_raw_read_packet(), nut_read_packet(), nuv_packet(), ogg_read_packet(), pulse_read_packet(), qdm2_restore_block(), qt_rtp_parse_packet(), read_frame(), read_packet(), recode_subtitle(), return_stored_frame(), rm_assemble_video_frame(), rm_read_audio_stream_info(), roq_read_packet(), rtp_parse_packet_internal(), sbg_read_packet(), seq_read_packet(), siff_read_packet(), smacker_read_packet(), store_packet(), str_read_packet(), supply_new_packets(), swf_read_packet(), videostream_cb(), vmd_read_packet(), vqf_read_packet(), wsaud_read_packet(), wv_read_packet(), xiph_handle_packet(), and yop_read_packet().

uint8_t * av_packet_get_side_data ( AVPacket pkt,
enum AVPacketSideDataType  type,
int *  size 
)

Get side information from packet.

Parameters
pktpacket
typedesired side information type
sizepointer for side information size to store (optional)
Returns
pointer to data if present or NULL otherwise

Definition at line 214 of file avpacket.c.

Referenced by aac_decode_frame(), aac_decode_frame_int(), add_metadata_from_side_data(), apply_param_change(), avcodec_decode_audio4(), cinepak_decode_frame(), decode_frame(), decode_tag(), idcin_decode_frame(), ipvideo_decode_frame(), msrle_decode_frame(), msvideo1_decode_frame(), qtrle_decode_frame(), raw_decode(), rtp_write_packet(), smc_decode_frame(), srt_decode_frame(), and srt_write_packet().

int av_packet_merge_side_data ( AVPacket pkt)

Definition at line 231 of file avpacket.c.

Referenced by ff_read_packet(), and split_write_packet().

uint8_t * av_packet_new_side_data ( AVPacket pkt,
enum AVPacketSideDataType  type,
int  size 
)

Allocate new information of a packet.

Parameters
pktpacket
typeside information type
sizeside information size
Returns
pointer to fresh allocated data or NULL otherwise

Definition at line 189 of file avpacket.c.

Referenced by av_read_frame(), ff_add_param_change(), ff_asf_parse_packet(), ff_MPV_encode_picture(), flv_read_packet(), idcin_read_packet(), lavfi_read_packet(), load_ipmovie_packet(), matroska_parse_frame(), mov_read_packet(), read_frame(), srt_read_header(), and swf_read_packet().

int av_packet_shrink_side_data ( AVPacket pkt,
enum AVPacketSideDataType  type,
int  size 
)

Shrink the already allocated side data buffer.

Parameters
pktpacket
typeside information type
sizenew side information size
Returns
0 on success, < 0 on failure

Definition at line 307 of file avpacket.c.

Referenced by ff_MPV_encode_picture().

int av_packet_split_side_data ( AVPacket pkt)
void av_shrink_packet ( AVPacket pkt,
int  size 
)

Reduce packet size, correctly zeroing padding.

Parameters
pktpacket
sizenew size

Definition at line 79 of file avpacket.c.

Referenced by av_append_packet(), av_get_packet(), cdxl_read_packet(), cin_read_packet(), ff_asf_parse_packet(), ff_raw_read_partial_packet(), libopus_encode(), mxf_decrypt_triplet(), mxf_get_d10_aes3_packet(), nuv_packet(), and yop_read_packet().