ffmpeg
libavcodec
各种类型声音、图像编解码
主要函数:
struct AVCodecContext
AVCodecContext * avcodec_alloc_context3 (const AVCodec *codec);
void avcodec_free_context (AVCodecContext **avctx);
const AVCodec * avcodec_find_encoder (enum AVCodecID id);
const AVCodec * avcodec_find_decoder (enum AVCodecID id); // 找到具有匹配的编解码器ID的已注册解码器。
avcodec_open2(...); // 初始化AVCodecContext以使用给定的AVCodec
int avcodec_close (AVCodecContext *avctx); // 关闭给定的AVCodecContext并释放与之相关的所有数据
int avcodec_send_packet (AVCodecContext *avctx, const AVPacket *avpkt) ; // 为解码器提供原始数据包数据作为输入。
int avcodec_receive_frame (AVCodecContext *avctx, AVFrame *frame); // 从解码器或编码器返回解码后的输出数据
int avcodec_send_frame (AVCodecContext *avctx, const AVFrame *frame);// 向编码器提供原始视频或音频帧。
int avcodec_receive_packet (AVCodecContext *avctx, AVPacket *avpkt); // 从编码器读取编码数据。
libavdevice
多媒体设备
主要函数:
void avdevice_register_all (void); //初始化libavdevice并注册所有输入和输出设备。
const AVInputFormat * av_input_audio_device_next (const AVInputFormat *d) // 音频输入设备迭代器。
const AVInputFormat * av_input_video_device_next (const AVInputFormat *d) // 视频输入设备迭代器。
libavfilter
过滤器、特效、水印、合成等。
libavformat
各种音视频格式的生成和解析
主要函数:
struct AVFormatContext
av_find_input_format //查找视频流或视频
avformat_open_input // 打开输入流并读取数据头
avformat_find_stream_info // 读取媒体文件的数据包以获取流信息
av_find_best_stream // 找到文件中的“最佳”流。
av_read_frame // 读取流的下一帧
avformat_close_input // 关闭打开的输入AVFormatContext
avformat_network_init (void) // 对网络库进行全局初始化,RTSP拉流适用。
avformat_network_deinit(void) // 撤消avformat_network_init所做的初始化
avformat_alloc_context(void) //分配一个AVFormatContext堆空间。
avformat_free_context (AVFormatContext *s) // 释放一个VFormatContext堆空间
libavutil
公共的工具函数(加密和哈希、内存管理、数学、错误码、日志)
libpostproc
后期效果处理
libswresample
高度优化的音频重采样
libswscale
视频场景比例缩放、颜色映射装换
主要函数:
struct SwsContext * sws_alloc_context (void); // 分配一个空SwsContext。
void sws_freeContext (struct SwsContext *swsContext);// 释放一个SwssContext
sws_getContext (...); // 分配并返回一个 SwsContext.
int sws_scale(...); // 在srcSlice中缩放图像切片,并在dst中将得到的缩放切片放入图像中