ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] ### 函数列表 ***** 简单分析一下上述几个结构体的初始化和销毁函数。这些函数列表如下。 | 结构体 | 初始化 | 销毁 | | --- | --- | --- | | AVFormatContext | avformat_alloc_context() | avformat_free_context | | AVIOContext| avio_alloc_context() | | | AVStream| avformat_new_stream() | | | AVCodecContext| avcodec_alloc_context3() | | | AVFrame| av_frame_alloc() av_image_fill_arrays() | av_frame_free()| | AVPacket | av_init_packet()av_new_packet() | av_free_packet()| ``` AVFormatContext:统领全局的基本结构体。主要用于处理封装格式(FLV/MKV/RMVB等)。 AVIOContext:输入输出对应的结构体,用于输入输出(读写文件,RTMP协议等)。 AVStream,AVCodecContext:视音频流对应的结构体,用于视音频编解码。 AVFrame:存储非压缩的数据(视频对应RGB/YUV像素数据,音频对应PCM采样数据) AVPacket:存储压缩数据(视频对应H.264等码流数据,音频对应AAC/MP3等码流数据) ``` 包含头文件还有连接器=》输入=》附加依赖项 ``` avcodec.lib;avformat.lib;avutil.lib;avdevice.lib;avfilter.lib;postproc.lib;swresample.lib;swscale.lib; ```