ubuntu 12.04安装ffmpeg

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

apt-get install libx264-dev
apt-get install libfaac-dev
apt-get install libmp3lame-dev
apt-get install libtheora-dev
apt-get install libvorbis-dev
apt-get install libxvidcore-dev
apt-get install libxext-dev
apt-get install 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}...





  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值