ubuntu 12.04安装ffmpeg

来源:互联网 发布:魔兽6.2数据库 编辑:程序博客网 时间:2024/06/06 00:17

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-devapt-get install libfaac-devapt-get install libmp3lame-devapt-get install libtheora-devapt-get install libvorbis-devapt-get install libxvidcore-devapt-get install libxext-devapt-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 

makemake 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 0
原创粉丝点击