飞腾D2000统信linux系统编译ffmpeg源码

  • Post author:
  • Post category:linux



1、

统信系统自带ffmpeg,先想办法把自身的ffmpeg卸载,避免有存在和以后自己的编译ffmpeg版本冲突的可能。


2、


https://blog.csdn.net/T__zxt/article/details/123424359


(1)

按照上面网址编译,装其它三方库的时候正常装,一路绿灯,但是到libx264的时候,libx264的git网址失效,可以用这个网址:https://code.videolan.org/videolan/x264.git(还是失效的话自行百度)


(2)

接着编译ffmpeg源码,我选的是ffmpeg4.3.2(跟我做的项目匹配的原因),编译也没啥问题,就是在编译项目后出现以下错误:

error: undefined reference to `av_frame_alloc()’

error: undefined reference to `avio_close(AVIOContext*)’

error: undefined reference to `avcodec_find_encoder(AVCodecID)’

error: undefined reference to `avcodec_alloc_context3(AVCodec const*)’

error: undefined reference to `av_opt_set(void*, char const*, char const*, int)’

error: undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*, AVDictionary**)’

error: undefined reference to `av_frame_alloc()’

error: undefined reference to `av_image_alloc(unsigned char**, int*, int, int, AVPixelFormat, int)’

error: undefined reference to `avformat_alloc_context()’

后来观察了很久才发现是音频模块的问题,我的项目用不上音频,就在ffmpeg编译的时候把上述网址中的ffmpeg编译的config配置中的 “–enable-libfdk-aac “改成“–disable-libfdk-aac ”,索性不要音频模块,最后把编译出的 include文件夹和lib文件夹拿出来用,就可以啦,大功告成



版权声明:本文为weixin_51572548原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。