系列文章:
https://blog.csdn.net/fdsafwagdagadg6576/article/details/122774122
https://blog.csdn.net/fdsafwagdagadg6576/article/details/122788243
音视频编码过程一样,audio只是将avcode_encode_video2改成avcode_encode_audio2.
本文以视频为例。
编码流程图
音频编码将avcodec_encode_video2改成avcodec_encode_audio2
1.av_register_all() : 注册组件, 包括FFmpeg所有编解码器
2.avformat_alloc_context(): 初始化封装格式上下文
3.avio_open(): 打开输入文件,关联封装格式上下文到输出文件
4.avformat_new_stream(): 创建输出码流
5.avcodec_find_encoder():查找视频编码器
6.avcodec_o