linux下安装FFmpeg

FFmpeg的安装需要yasm的支持,如果转码MP4,需要faac解码包的支持

FFmpeg:http://ffmpeg.org/download.html

yasm:http://yasm.tortall.net/Download.html

faac:http://www.audiocoding.com/downloads.html

开始安装

安装:faac-1.28.tar.gz

解包 tar -xf faac-1.28.tar.gz

查看解压目录下的安装帮助文件"INSTALL"

安装分三步:

执行 ./configure
执行 make
执行 make install

其中在make时会报错

mpeg4ip.h:126:58: 错误:对‘char* strcasestr(const char*, const char*)’的新声明
 char *strcasestr(const char *haystack, const char *needle);
                                                          ^
In file included from mpeg4ip.h:107:0,
                 from mp4common.h:29,
                 from 3gp.cpp:28:
/usr/include/string.h:365:26: 错误:使旧的声明‘const char* strcasestr(const char*, const char*)’出现歧义
 extern "C++" const char *strcasestr (const char *__haystack,

./common/mp4v2/mpeg4ip.h

124 extern "C" {
125 #endif
126 char *strcasestr(const char *haystack, const char *needle);

修改为

124 extern "C++" {
125 #endif
126 const char *strcasestr(const char *haystack, const char *needle);

重新make

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

安装yasm-1.3.0.tar.gz

解包 tar -xf yasm-1.3.0.tar.gz

查看解压目录下的安装帮助文件"INSTALL"

安装分三步:

执行 ./configure
执行 make
执行 make install

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

安装ffmpeg-2.6.2.tar.bz2

解包 tar -xf ffmpeg-2.6.2.tar.bz2

查看解压目录下的安装帮助文件"INSTALL"

安装分三步:

执行./configure  --enable-libfaac --enable-nonfree 
执行 make
执行 make install

运行 ffmpeg 

如果出现报错如下:

ffmpeg: error while loading shared libraries: libfaac.so.0: cannot open shared object file: No such file or directory

修改 

vim /etc/ld.so.conf

添加一行 /usr/local/lib

运行 ldconfig -v 刷新

再次运行 ffmpeg

ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --enable-libfaac --enable-nonfree
  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
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

到此安装完成

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

运行

ffmpeg -i movie.avi movie.mp4

至此可以检验是否可以正常转换



你可能感兴趣的:(linux下安装FFmpeg)