本文分析一下ffmpeg注册复用器,编码器等的函数av_register_all()。该函数在所有基于ffmpeg的应用程序中几乎都是第一个被调用的。只有调用了该函数,才能使用复用器,编码器等。
函数调用关系图如下图所示。av_register_all()调用了avcodec_register_all()。avcodec_register_all()注册了和编解码器有关的组件:硬件加速器,解码器,编码器,Parser,Bitstream Filter。
av_register_all()除了调用avcodec_register_all()之外,还注册了复用器,解复用器,协议处理器。
注册复用器的函数是av_register_output_format()。
void av_register_output_format(AVOutputFormat *format)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
}
注册解复用器的函数是av_register_input_format()。
void av_register_input_format(AVInputFormat *format)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
}
注册协议处理器的函数是ffurl_register_protocol()。
参考文献
1、https://blog.csdn.net/leixiaohua1020/article/details/12677129