zoukankan      html  css  js  c++  java
  • 阿里云服务器CentOS7.8安装x264/libav

    网上常见的在CentOS7 x64中安装x264和libav的方法是:

    git clone http://git.videolan.org/git/x264.git
    ./configure –disable-asm
    make
    make install
    wget http://download1.rpmfusion.org/free/el/updates/7/x86_64/x/x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
    wget http://download1.rpmfusion.org/free/el/updates/7/x86_64/x/x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
    rpm -hiv x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
    rpm -hiv x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
    cd /usr/local/src
    git clone https://gitee.com/nwaycn/libav.git
    cd libav
    ./configure --enable-pic --enable-shared  --enable-libx264 --enable-gpl --extra-libs="-ldl"
    make                                                                                  
    make install
    cp /usr/local/lib/pkgconfig/libavcodec.pc    /usr/lib64/pkgconfig/
    cp /usr/local/lib/pkgconfig/libavdevice.pc   /usr/lib64/pkgconfig/
    cp /usr/local/lib/pkgconfig/libavfilter.pc   /usr/lib64/pkgconfig/
    cp /usr/local/lib/pkgconfig/libavformat.pc   /usr/lib64/pkgconfig/
    cp /usr/local/lib/pkgconfig/libavresample.pc /usr/lib64/pkgconfig/
    cp /usr/local/lib/pkgconfig/libavutil.pc     /usr/lib64/pkgconfig/
    cp /usr/local/lib/pkgconfig/libswscale.pc    /usr/lib64/pkgconfig/
    ldconfig

    但在个人环境中,如此编译过程中,总有报错。系统也是CentOS7 x64 2003版本,后来网上找了一套的x264和libav,编译起来没问题一直在用。

    但近日在阿里云服务器上CentOS7.8 x64,用我找的这套编译又报错,主要是libav不能正常编译通过,修改代码要改的地方太多。

    首先是:

    libavcodec/libx264.c: In function 'X264_frame':libavcodec/libx264.c:246:9: error: 'x264_bit_depth' undeclared (first use in this function)if (x264_bit_depth > 8)^libavcodec/libx264.c:246:9: note: each undeclared identifier is reported only once for each function it appears inlibavcodec/libx264.c: In function  'X264_init_static'

    找到该文件,将小写改为大写后,重新编译

    undefined reference to  x264_encoder_open_160

    各种错误,要一点一点去改,太麻烦了。

    于是再去尝试上面两种git clone方式,居然通过了,很神奇,先记录一下。

  • 相关阅读:
    python的正负无穷float("inf")的用法
    python中几个常见的黑盒子之“字典dict” 与 “集合set”
    python中几个常见的“黑盒子”之 列表list
    Python 排序---sort与sorted学习
    django中使用Profile扩展User模块(基于django 1.10版本下)
    获取Linux进程运行在哪个CPU内核上面的方法
    【转】Crontab定时任务配置
    【转】sudo命令情景分析
    【转】详解Python的装饰器
    一步步来配置安卓开发环境ADTBundle
  • 原文地址:https://www.cnblogs.com/cash/p/13278104.html
Copyright © 2011-2022 走看看