ffmpeg 编译


 ./configure --prefix=/usr/local/ffmpeg  --enable-pic --enable-shared  --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads  --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-x11grab 
  1. Download yasm source code from http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
  2. Unpack tar xvzf yasm-1.2.0.tar.gz
  3. cd yasm-1.2.0
  4. Configure and build:

    ./configure && make -j 4 && sudo make install


1、下载ffmpeg-2.6.3.tar.bz2、last_x264.tar.bz2、yasm-1.2.0.tar.gz   http://download.csdn.net/detail/xl4025/8919329
2、libx264需要yasm,所以先安装yasm
3、安装ffmpeg的依赖包
libfaac、libmp3lame、libtheora、libvorbis、libxvid、libxext、libxfixes
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14rc0/nasm-2.14rc0.tar.gz
tar xzf nasm-2.14rc0-xdoc.tar.bz2
cd nasm*
./configure;make;sudo make install

wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2

tar xfj last_x264.tar.bz2;
cd x264-*

sudo apt-get install libx264-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libxext-dev libxfixes-dev


4、解压ffmpeg
tar -xjvf ffmpeg-2.6.3.tar.bz2
对ffmpeg进行编译安装
./configure --prefix=/usr/local/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 


make
make install


5、当中问题
1)、执行 ffmpeg -i "/home/user/down/flv/001.flv" -acodec copy -vcodec libx264 -b 560k -bf 6 -s 682*310 -f mp4 "/home/user/test/001.mp4"遇到错误
Unknown encoder 'libx264' 错误 由于已经安装过libx264、迷茫找了很久找到
Unknown encoder 'libx264'. Installing the package libavcodec-extra-53
In Ubuntu 14.04 LTS the package that is needed is called libavcodec-extra-54 (and libav-tools)
安装libavcodec-extra-53
apt-get install libavcodec-extra-53


进入到
/usr/local/ffmpeg/bin 目录下把
复制到/usr/local/bin下
在命令中直接运行
ffmpeg


提示
built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/usr/local/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
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...


转载于:https://www.cnblogs.com/mtcnn/p/9410042.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值