zoukankan      html  css  js  c++  java
  • Linux 安装编译 FFMPEG

    资源准备:

    ffmpeg-3.4.tar.bz2

    yasm-1.3.0.tar.gz

    编译安装:

    本人二进制包存放在 /opt/moudles中, 解压缩在 /opt/softwares

    解包 ffmpeg-3.4.tar.bz2

    [root@localhost moudles]# tar -jxvf ffmpeg-3.4.tar.bz2 -C ../softwares/

    在 /opt/softwares 中生成 文件夹。

    解包 yasm-1.3.0.tar.gz

    [root@localhost moudles]# tar -zxvf yasm-1.3.0.tar.gz -C ../softwares/

     /opt/softwares 中生成文件夹。

    编译 yasm:

    [root@localhost moudles]# cd /opt/softwares/yasm-1.3.0/

    [root@localhost yasm-1.3.0]# ./configure 

    [root@localhost yasm-1.3.0]# make && make install

    编译 ffmpeg-3.4:

    [root@localhost yasm-1.3.0]# cd /opt/softwares/ffmpeg-3.4/

    [root@localhost ffmpeg-3.4]# ./configure --enable-shared --prefix=/usr/local/ffmpeg

    [root@localhost ffmpeg-3.4]# make && make install

    时间比较长, 耐心等待……

    检测ffmpeg是否安装成功:

    [root@localhost ffmpeg-3.4]# /usr/local/ffmpeg/bin/ffmpeg --version

    注意:会报错,提示库找不到。

    /usr/local/ffmpeg/bin/ffmpeg: error while loading shared libraries: libavdevice.so.56: cannot open shared object file: No such file or directory

    解决:修改文件/etc/ld.so.conf 内容增加/usr/local/ffmpeg/lib/

    [root@localhost ffmpeg-3.4]# vim /etc/ld.so.conf

    include ld.so.conf.d/*.conf

    /usr/local/ffmpeg/lib/

    使修改生效:

    [root@localhost ffmpeg-3.4]# ldconfig 

     配置环境变量:

    [root@localhost ffmpeg-3.4]# vim /etc/profile

     特别注意:若是不安装yasm, 直接编译ffmpeg会抛出异常。

    yasm/nasm not found or too old. Use --disable-yasm for a crippled build.

    If you think configure made a mistake, make sure you are using the latest
    version from Git.  If the latest version fails, report the problem to the
    ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
    Include the log file "config.log" produced by configure as this will help
    solve the problem.

    编译FFMPEG时,出现了 ffmpeg yasm not found, use --disable-yasm for a crippled build,是因为 FFMPEG为了提高编译速度,使用了汇编指令,如果系统中没有yasm指令的话,就会出现上述的问题。

    附注:查找适合自己系统的yasm

    yasm-releases

  • 相关阅读:
    [转]char、varchar、nchar、nvarchar的区别
    【转】Asp.net 2.0中页的生存周期(Lifecycle)和动态控件 [.Net]
    git免登录sshkey
    ios8,xcode6 周边
    iOS 推送证书
    Lazarus中TreeView导出XML以及XML导入TreeView
    flac文件提取专辑封面手记
    Lazarus解决含中文文件名或路径的使用问题
    使用PowerShell管理Windows8应用
    thbgm拆包【in progress】
  • 原文地址:https://www.cnblogs.com/chinda/p/7866008.html
Copyright © 2011-2022 走看看