ffmpeg重要结构体之AVPacket
来源:互联网 发布:有些什么直播软件 编辑:程序博客网 时间:2024/06/05 09:24
ffmpeg重要结构体之AVFrame
ffmpeg重要结构体之AVFormatContext
ffmpeg重要结构体之AVCodecContext
ffmpeg重要结构体之AVCodec
ffmpeg重要结构体之AVIOContext
ffmpeg重要结构体之AVStream
ffmpeg重要结构体之AVPacket
AVPacket是ffmpeg中有关格式信息的结构体,在文件libavcodec/avcodec.h中。
typedef struct AVPacket { /** * A reference to the reference-counted buffer where the packet data is * stored. * May be NULL, then the packet data is not reference-counted. */ AVBufferRef *buf; /** * 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. */ int64_t pts; /** * Decompression timestamp in AVStream->time_base units; the time at which * the packet is decompressed. * Can be AV_NOPTS_VALUE if it is not stored in the file. */ int64_t dts; uint8_t *data; int size; int stream_index; /** * A combination of AV_PKT_FLAG values */ int flags; /** * Additional packet data that can be provided by the container. * Packet can contain several types of side information. */ AVPacketSideData *side_data; int side_data_elems; /** * Duration of this packet in AVStream->time_base units, 0 if unknown. * Equals next_pts - this_pts in presentation order. */ int64_t duration; int64_t pos; ///< byte position in stream, -1 if unknown#if FF_API_CONVERGENCE_DURATION /** * @deprecated Same as the duration field, but as int64_t. This was required * for Matroska subtitles, whose duration values could overflow when the * duration field was still an int. */ attribute_deprecated int64_t convergence_duration;#endif} AVPacket;#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corruptedenum 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,};其中有关视频解码的主要成员:
AVBufferRef *buf:提供给其他参考本packet的地址。
uint8_t *data:一个packet的数据,通常为一个完整的结构,比如对于AVC,就是一个nal(可以是pps或sps或一帧图像)
int size:packet的大小。
int64_t duration:此packet的持续时间,对于一帧数据就是这帧图像的播放时长。
int dts:解码时间戳
int pts:显示时间戳
举个例子,解码某AVC码流,time_base = 1/1000(time_base见ffmpeg重要结构体之AVStream),duration = 42
换算成秒就是42*(1/1000)=0.042秒,相当于24帧每秒。
0 0
- ffmpeg重要结构体之AVPacket
- FFMPEG结构体分析:AVPacket
- FFMPEG结构体分析:AVPacket
- FFMPEG结构体分析:AVPacket
- FFMPEG结构体分析 AVPacket
- FFMPEG结构体分析:AVPacket
- FFMPEG结构体分析:AVPacket
- FFMPEG结构体分析:AVPacket
- FFmpeg总结(六)AV系列结构体之AVPacket
- ffmpeg之AVPacket笔记
- FFmpeg之AVPacket
- ffmpeg重要结构体之AVFrame
- ffmpeg重要结构体之AVFormatContext
- ffmpeg重要结构体之AVCodecContext
- ffmpeg重要结构体之AVCodec
- ffmpeg重要结构体之AVIOContext
- ffmpeg重要结构体之AVStream
- FFMPeg代码分析:AVPacket结构体和av_read_frame函数
- eclipse中注释的技巧
- android 删除SD卡下指定的文件夹(高级写法)
- Android Launcher全面剖析
- FreeRTOS系列第2篇---FreeRTOS入门指南
- 从头认识java-8.10 接口里面的类
- ffmpeg重要结构体之AVPacket
- VMware vSphere Client下增加虚拟机磁盘空间的方法
- <蓝牙BLE>cc2540如何添加特征值
- android 混淆学习
- OnFocusChangeListener接口简介
- Node.js cookie-parser
- 分享一个简单的Makefile
- 公钥,私钥和数字签名这样最好理解
- 学习Angular2-typescript编译