Ubuntu14.04 安装ffmpeg

一、xvid、x264、ffmpeg源码下载

链接:https://pan.baidu.com/s/13phSFrLqkGrKDGF3_a2cSA
提取码:ls2s

二、安装

1. xvid
  1. tar zxvf xvidcore-1.3.3.tar.gz
  2. cd xvidcore/build/generic
  3. ./configure --prefix=/usr/local/soft_install --enable-shared --enable-pic
  4. make -j 8
  5. make install
2. x264
  1. tar jxvf last_x264.tar.bz2
  2. cd x264-snapshot-20161225-2245
  3. ./configure --prefix=/usr/local/soft_install --enable-shared --enable-pic --disable-asm
  4. make -j 8
  5. make install
3. ffmpeg
  1. 安装依赖包
    sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libxext-dev libxfixes-dev

  2. ./configure --prefix=/usr/local/soft_install/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvorbis

出现错误:

Unknown option "--enable-libfaac".
See ./configure --help for available options.

原因是新版ffmpeg已经remove了 libaac

又出现异常信息

nasm/yasm not found or too old. Use --disable-x86asm 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 "ffbuild/config.log" produced by configure as this will help
solve the problem.

添加–disable-x86asm 编译成功

./configure --prefix=/usr/local/soft_install/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-libvorbis --disable-x86asm

三、修改环境变量

  1. vi /etc/profile
    在文件末尾添加
# ffmpeg
export PKG_CONFIG_PATH=/usr/local/soft_install/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/soft_install/ffmpeg/lib
export PATH=$PATH:/usr/local/soft_install/ffmpeg/lib:/usr/local/soft_install/ffmpeg/bin
  1. source /etc/profile

  2. 成功标志

root@chenwr-pc:/etc# ffmpeg
ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
  configuration: --prefix=/usr/local/soft_install/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-libvorbis --disable-x86asm
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

安装成功!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值