加入收藏 | 设为首页 | 会员中心 | 我要投稿 甘南站长网 (https://www.0941zz.com/)- 科技、行业物联网、开发、云计算、云管理!
当前位置: 首页 > 综合聚焦 > CentOS > 正文

CentOS下ffmpeg与第三方编码编译安装

发布时间:2023-02-18 09:31:06 所属栏目:CentOS 来源:互联网
导读:1、系统 CENTOS7 2、安装依赖包 yum -y install gccglibc glibc-devel make nasm pkgconfig lib-devel openssl-devel expat-develgettext-devel libtool mhash* perl-Digest-SHA1* yum -y install makeautomake bzip2 unzip patch subversion libjpeg-devel

 
  解决方法:编译ffmpeg是使用PIC选项
 
  CFLAGS="-O3-fPIC" ./configure --enable-gpl --enable-version3 --enable-shared--enable-nonfree --enable-postproc --enable-x11grab --enable-gray--enable-small --enable-bzlib --enable-frei0r --enable-libopencore-amrnb--enable-libopencore-amrwb
 
  make
 
  make install
 
  B、如果已经安装ffmpeg,将会报如下错误:出现avformat_free_context和AVCodecID未声明:
 
  cap_ffmpeg.cpp:45:0:
 
  cap_ffmpeg_impl.hpp:在成员函数‘voidCvVideoWriter_FFMPEG::close()’中:
 
  cap_ffmpeg_impl.hpp:1532:29:错误:‘avformat_free_context’在此作用域中尚未声明
 
  avformat_free_context(oc);
 
  ^
 
  cap_ffmpeg.cpp:45:0:
 
  cap_ffmpeg_impl.hpp:在全局域:
 
  cap_ffmpeg_impl.hpp:1546:71:错误:使用枚举‘AVCodecID’前没有给出声明
 
  static inline bool cv_ff_codec_tag_match(constAVCodecTag *tags,enum AVCodecID id,unsigned int tag)
 
  ^
 
  cap_ffmpeg_impl.hpp:1556:83:错误:使用枚举‘AVCodecID’前没有给出声明
 
  static inline boolcv_ff_codec_tag_list_match(const AVCodecTag *const *tags,unsigned int tag)
 
  解决方法:将WITH_FFMPEG=OFF
 
  ./configure--enable-shared
 
  C、如果已经安装GTK,将会报如下错误:出现未定义的引用:
 
  Linking CXXexecutable ../../bin/opencv_test_core
 
  /lib64/libgtk-3.so.0:对‘g_type_add_instance_private’未定义的引用
 
  /lib64/libgtk-3.so.0:对‘g_type_class_adjust_private_offset’未定义的引用
 
  /lib64/libgtk-3.so.0:对‘g_variant_parse_error_quark’未定义的引用
 
  collect2: 错误:ld 返回 1
 
  make[2]: ***[bin/opencv_test_core] 错误1
 
  make[1]: ***[modules/core/CMakeFiles/opencv_test_core.dir/all] 错误 2
 
  make: *** [all] 错误 2
 
  解决方法:将WITH_GTK=OFF
 
  15、安装libdc1394:
 
  yum installlibdc1394
 
  16、安装ORC(libdirac依赖于该包):
 
  官网:http://code.entropywave.com/projects/orc/
 
  (1)安装方法
 
  cd/home/mycentos7/tools/ffmpeg/
 
  wget http://code.entropywave.com/download/orc/orc-0.4.18.tar.gz
 
  tar zxvf orc-0.4.18.tar.gz
 
  cd orc-0.4.18
 
  ./configure
 
  make
 
  sudo makeinstall (或使用root安装: make install)
 
  cd ..
 
  (2)设置
 
  ln -s /usr/local/lib/pkgconfig/orc-0.4.pc /usr/lib64/pkgconfig/orc-0.4.pc
 
  否则在dirac编译时报错误:
 
  checking for ORC...no
 
  configure: error:orc-0.4 >= 0.4.16 is required

(编辑:甘南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

推荐文章
    热点阅读