【c++后端学习】18、主流应用方向_音视频_ffmpeg

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中将得到的缩放切片放入图像中
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值