博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
FFMPEG结构体分析:AVCodecParameters
阅读量:3533 次
发布时间:2019-05-20

本文共 4385 字,大约阅读时间需要 14 分钟。

/** * 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(). */typedef struct AVCodecParameters {    /**     * General type of the encoded data.     */    enum AVMediaType codec_type;    /**     * Specific type of the encoded data (the codec used).     */    enum AVCodecID   codec_id;    /**     * Additional information about the codec (corresponds to the AVI FOURCC).     */    uint32_t         codec_tag;    /**     * 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.     */    uint8_t *extradata;    /**     * Size of the extradata content in bytes.     */    int      extradata_size;    /**     * - video: the pixel format, the value corresponds to enum AVPixelFormat.     * - audio: the sample format, the value corresponds to enum AVSampleFormat.     */    int format;    /**     * The average bitrate of the encoded data (in bits per second).     */    int64_t bit_rate;    int bits_per_coded_sample;    /**     * Codec-specific bitstream restrictions that the stream conforms to.     */    int profile;    int level;    /**     * Video only. The dimensions of the video frame in pixels.     */    int width;    int height;    /**     * 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).     */    AVRational sample_aspect_ratio;    /**     * Video only. The order of the fields in interlaced video.     */    enum AVFieldOrder                  field_order;    /**     * Video only. Additional colorspace characteristics.     */    enum AVColorRange                  color_range;    enum AVColorPrimaries              color_primaries;    enum AVColorTransferCharacteristic color_trc;    enum AVColorSpace                  color_space;    enum AVChromaLocation              chroma_location;    /**     * Video only. Number of delayed frames.     */    int video_delay;    /**     * Audio only. The channel layout bitmask. May be 0 if the channel layout is     * unknown or unspecified, otherwise the number of bits set must be equal to     * the channels field.     */    uint64_t channel_layout;    /**     * Audio only. The number of audio channels.     */    int      channels;    /**     * Audio only. The number of audio samples per second.     */    int      sample_rate;    /**     * Audio only. The number of bytes per coded audio frame, required by some     * formats.     *     * Corresponds to nBlockAlign in WAVEFORMATEX.     */    int      block_align;    /**     * Audio only. Audio frame size, if known. Required by some formats to be static.     */    int      frame_size;    /**     * 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.     */    int initial_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.     */    int trailing_padding;    /**     * Audio only. Number of samples to skip after a discontinuity.     */    int seek_preroll;} AVCodecParameters;
乍眼一看,AVCodecParameters与AVCodecContext里的参数有很多相同的,但是没有函数。看来伟大的极客们,是想把一些编解码器的参数从AVCodecContext分离出来,因为AVCodecContext这个结构体实在是太大了。

enum AVMediaType codec_type:编解码器的类型(视频,音频...)

enum AVCodecID codec_id:标示特定的编解码器
int format:像素格式/采样数据格式
int bit_rate:平均比特率
uint8_t *extradata; int extradata_size:针对特定编码器包含的附加信息(例如对于H.264解码器来说,存储SPS,PPS等)
int width, height:如果是视频的话,代表宽和高
int refs:运动估计参考帧的个数(H.264的话会有多帧,MPEG2这类的一般就没有了)
int sample_rate:采样率(音频)
uint64_t channel_layout:声道格式
int channels:声道数(音频)
int profile:型(H.264里面就有,其他编码标准应该也有)
int level:级(和profile差不太多)

转载地址:http://vpfhj.baihongyu.com/

你可能感兴趣的文章
【STM32+FPGA+FSMC】31,FSMC熟练掌握;KEIL5生成bin文件;SDRAM的使用;IAP检验码 2019年04月10日
查看>>
【IC1】【转 非常好】运算放大器使用的六个经验
查看>>
【IC-ADC 3】ADC的选型
查看>>
2019年03月18日 查看数据手册的注意点,极限参数、电气参数、推荐参数
查看>>
HiKey960/970用户手册;HiKey960 Development Board User Manual
查看>>
【书籍推荐】FPGA,xilinx
查看>>
N9-SQL注入(union注入)
查看>>
N10-sql注入(information_schema注入)
查看>>
N1-Kali虚拟机中SQLmap
查看>>
N11-sql注入(http头注入)
查看>>
N2-sqlmap初使用
查看>>
N12-sql盲注原理以及boolean盲注案例实现
查看>>
N13-sqli盲注 基于时间型
查看>>
N1 技术心得 2019-6-26
查看>>
N1-环境配置
查看>>
N2-审计方法与步骤
查看>>
N3-常见的INI配置
查看>>
代码审计 N4 常见危险函数和特殊函数(一)
查看>>
MySQL笔记
查看>>
计算机运算方法之(原码 补码 反码 移码)
查看>>