Loading...
Searching...
No Matches
AVCodecParameters Struct Reference
libavcodec » Core functions/structures.

This struct describes the properties of an encoded stream. More...

`#include <libavcodec/codec_par.h>`

## Data Fields

enum AVMediaType | codec_type
| General type of the encoded data.
enum AVCodecID | codec_id
| Specific type of the encoded data (the codec used).
uint32_t | codec_tag
| Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * | extradata
| Extra binary data needed for initializing the decoder, codec-dependent.
int | extradata_size
| Size of the extradata content in bytes.
AVPacketSideData * | coded_side_data
| Additional data associated with the entire stream.
int | nb_coded_side_data
| Amount of entries in coded_side_data.
int | format
int64_t | bit_rate
| The average bitrate of the encoded data (in bits per second).
int | bits_per_coded_sample
| The number of bits per sample in the codedwords.
int | bits_per_raw_sample
| This is the number of valid bits in each output sample.
int | profile
| Codec-specific bitstream restrictions that the stream conforms to.
int | level
int | width
| Video only.
int | height
AVRational | sample_aspect_ratio
| Video only.
AVRational | framerate
| Video only.
enum AVFieldOrder | field_order
| Video only.
enum AVColorRange | color_range
| Video only.
enum AVColorPrimaries | color_primaries
enum AVColorTransferCharacteristic | color_trc
enum AVColorSpace | color_space
enum AVChromaLocation | chroma_location
int | video_delay
| Video only.
AVChannelLayout | ch_layout
| Audio only.
int | sample_rate
| Audio only.
int | block_align
| Audio only.
int | frame_size
| Audio only.
int | initial_padding
| Audio only.
int | trailing_padding
| Audio only.
int | seek_preroll
| Audio only.
enum AVAlphaMode | alpha_mode
| Video with alpha channel only.

## Detailed Description

This struct describes the properties of an encoded stream.

sizeof(AVCodecParameters) is not a part of the public ABI, this struct must be allocated with avcodec_parameters_alloc() and freed with avcodec_parameters_free().

Examples
  remux.c.

Definition at line 47 of file codec_par.h.

## Field Documentation

## codec_type

enum AVMediaType AVCodecParameters::codec_type

General type of the encoded data.

Examples
  remux.c.

Definition at line 51 of file codec_par.h.

Referenced by main().

## codec_id

enum AVCodecID AVCodecParameters::codec_id

Specific type of the encoded data (the codec used).

Examples
  demux_decode.c, qsv_decode.c, qsv_transcode.c, transcode.c, and transcode_aac.c.

Definition at line 55 of file codec_par.h.

Referenced by main(), open_codec_context(), open_input_file(), open_input_file(), and open_input_file().

## codec_tag

uint32_t AVCodecParameters::codec_tag

Additional information about the codec (corresponds to the AVI FOURCC).

Examples
  remux.c.

Definition at line 59 of file codec_par.h.

Referenced by main().

## extradata

uint8_t* AVCodecParameters::extradata

Extra binary data needed for initializing the decoder, codec-dependent.

Must be allocated with av_malloc() and will be freed by avcodec_parameters_free(). The allocated size of extradata must be at least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding bytes zeroed.

Examples
  qsv_decode.c.

Definition at line 69 of file codec_par.h.

Referenced by main().

## extradata_size

int AVCodecParameters::extradata_size

Size of the extradata content in bytes.

Examples
  qsv_decode.c.

Definition at line 73 of file codec_par.h.

Referenced by main().

## coded_side_data

AVPacketSideData* AVCodecParameters::coded_side_data

Additional data associated with the entire stream.

Should be allocated with av_packet_side_data_new() or av_packet_side_data_add(), and will be freed by avcodec_parameters_free().

Definition at line 81 of file codec_par.h.

## nb_coded_side_data

int AVCodecParameters::nb_coded_side_data

Amount of entries in coded_side_data.

Definition at line 86 of file codec_par.h.

## format

int AVCodecParameters::format

- video: the pixel format, the value corresponds to enum AVPixelFormat.
- audio: the sample format, the value corresponds to enum AVSampleFormat.

Definition at line 92 of file codec_par.h.

## bit_rate

int64_t AVCodecParameters::bit_rate

The average bitrate of the encoded data (in bits per second).

Definition at line 97 of file codec_par.h.

## bits_per_coded_sample

int AVCodecParameters::bits_per_coded_sample

The number of bits per sample in the codedwords.

This is basically the bitrate per sample. It is mandatory for a bunch of formats to actually decode them. It's the number of bits for one sample in the actual coded bitstream.

This could be for example 4 for ADPCM For PCM formats this matches bits_per_raw_sample Can be 0

Definition at line 110 of file codec_par.h.

## bits_per_raw_sample

int AVCodecParameters::bits_per_raw_sample

This is the number of valid bits in each output sample.

If the sample format has more bits, the least significant bits are additional padding bits, which are always 0. Use right shifts to reduce the sample to its actual size. For example, audio formats with 24 bit samples will have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. To get the original sample use "(int32_t)sample >> 8"."

For ADPCM this might be 12 or 16 or similar Can be 0

Definition at line 123 of file codec_par.h.

## profile

int AVCodecParameters::profile

Codec-specific bitstream restrictions that the stream conforms to.

Definition at line 128 of file codec_par.h.

## level

int AVCodecParameters::level

Definition at line 129 of file codec_par.h.

## width

int AVCodecParameters::width

Video only.

The dimensions of the video frame in pixels.

Definition at line 134 of file codec_par.h.

## height

int AVCodecParameters::height

Definition at line 135 of file codec_par.h.

## sample_aspect_ratio

AVRational AVCodecParameters::sample_aspect_ratio

Video only.

The aspect ratio (width / height) which a single pixel should have when displayed.

When the aspect ratio is unknown / undefined, the numerator should be set to 0 (the denominator may have any value).

Definition at line 144 of file codec_par.h.

## framerate

AVRational AVCodecParameters::framerate

Video only.

Number of frames per second, for streams with constant frame durations. Should be set to { 0, 1 } when some frames have differing durations or if the value is not known.

Note
  This field corresponds to values that are stored in codec-level headers and is typically overridden by container/transport-layer timestamps, when available. It should thus be used only as a last resort, when no higher-level timing information is available.

Definition at line 156 of file codec_par.h.

## field_order

enum AVFieldOrder AVCodecParameters::field_order

Video only.

The order of the fields in interlaced video.

Definition at line 161 of file codec_par.h.

## color_range

enum AVColorRange AVCodecParameters::color_range

Video only.

Additional colorspace characteristics.

Definition at line 166 of file codec_par.h.

## color_primaries

enum AVColorPrimaries AVCodecParameters::color_primaries

Definition at line 167 of file codec_par.h.

## color_trc

enum AVColorTransferCharacteristic AVCodecParameters::color_trc

Definition at line 168 of file codec_par.h.

## color_space

enum AVColorSpace AVCodecParameters::color_space

Definition at line 169 of file codec_par.h.

## chroma_location

enum AVChromaLocation AVCodecParameters::chroma_location

Definition at line 170 of file codec_par.h.

## video_delay

int AVCodecParameters::video_delay

Video only.

Number of delayed frames.

Definition at line 175 of file codec_par.h.

## ch_layout

AVChannelLayout AVCodecParameters::ch_layout

Audio only.

The channel layout and number of channels.

Definition at line 180 of file codec_par.h.

## sample_rate

int AVCodecParameters::sample_rate

Audio only.

The number of audio samples per second.

Definition at line 184 of file codec_par.h.

## block_align

int AVCodecParameters::block_align

Audio only.

The number of bytes per coded audio frame, required by some formats.

Corresponds to nBlockAlign in WAVEFORMATEX.

Definition at line 191 of file codec_par.h.

## frame_size

int AVCodecParameters::frame_size

Audio only.

Audio frame size, if known. Required by some formats to be static.

Definition at line 195 of file codec_par.h.

## initial_padding

int AVCodecParameters::initial_padding

Audio only.

The amount of padding (in samples) inserted by the encoder at the beginning of the audio. I.e. this number of leading decoded samples must be discarded by the caller to get the original audio without leading padding.

Definition at line 203 of file codec_par.h.

## trailing_padding

int AVCodecParameters::trailing_padding

Audio only.

The amount of padding (in samples) appended by the encoder to the end of the audio. I.e. this number of decoded samples must be discarded by the caller from the end of the stream to get the original audio without any trailing padding.

Definition at line 210 of file codec_par.h.

## seek_preroll

int AVCodecParameters::seek_preroll

Audio only.

Number of samples to skip after a discontinuity.

Definition at line 214 of file codec_par.h.

## alpha_mode

enum AVAlphaMode AVCodecParameters::alpha_mode

Video with alpha channel only.

Alpha channel handling

Definition at line 219 of file codec_par.h.

The documentation for this struct was generated from the following file:

- libavcodec/codec_par.h