【文件属性】:
文件名称:centos 6.5 安装 FFmpeg及转码插件
文件大小:16.19MB
文件格式:7Z
更新时间:2020-07-23 04:55:02
FFmpeg 转码
3. 安装FFmpeg
1) 指定第三方插件安装默认目录
[root@localhost ffmpeg]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/bin
/usr/local/lib
2) 安装各插件
安装lame
[root@localhost ffmpeg]# tar -zxvf lame-3.99.5.tar.gz
[root@localhost lame-3.99.5]# cd lame-3.99.5
[root@localhost lame-3.99.5]# ./configure --enable-shared
[root@localhost lame-3.99.5]# make && make install
[root@localhost lame-3.99.5]# ldconfig
安装yasm
[root@localhost ffmpeg]# tar -zxvf yasm-1.2.0.gz
[root@localhost yasm-1.2.0]# cd yasm-1.2.0
[root@localhost yasm-1.2.0]# ./configure --enable-shared
[root@localhost yasm-1.2.0]# make && make install
[root@localhost yasm-1.2.0]# ldconfig
安装xvidcore (注意目录位置,不在直接的解压后的文件下)
[root@localhost ffmpeg]# tar -zxvf xvidcore-1.1.3.tar.gz
[root@localhost ffmpeg]# cd xvidcore-1.1.3/build/generic/
[root@localhost generic]# ./configure
[root@localhost generic]# make && make install
[root@localhost generic]# ldconfig
安装x264 (注意格式为.tar.bz2)
[root@localhost ffmpeg]# bunzip2 last_x264.tar.bz2
[root@localhost ffmpeg]# tar -xvf last_x264.tar
[root@localhost ffmpeg]# cd x264-snapshot-20121030-2245/
[root@localhost x264-snapshot-20121030-2245]# ./configure --enable-shared
[root@localhost x264-snapshot-20121030-2245]# make && make install
[root@localhost x264-snapshot-20121030-2245]# ldconfig
安装a52dec
[root@localhost ffmpeg]# tar -zxvf a52dec-0.7.4.tar.gz
[root@localhost ffmpeg]# cd a52dec-0.7.4
[root@localhost a52dec-0.7.4]# ./configure --enable-shared=PKGS && make && make install
[root@localhost a52dec-0.7.4]# ldconfig
安装 faac
[root@localhost ffmpeg]# yum install -y automake autoconf libtool
[root@localhost ffmpeg]# tar -zxvf faac-1.28.tar.gz
[root@localhost ffmpeg]# cd faac-1.28
[root@localhost faac-1.28]# vi ./common/mp4v2/mpeg4ip.h
…
:123
#ifdef __cplusplus
extern "C" {
#endif
//char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
[root@localhost faac-1.28]# ./bootstrap && ./configure && make && make install
[root@localhost faac-1.28]# ldconfig
安装 faad2
[root@localhost ffmpeg]# tar -zxvf faad2-2.7.tar.gz
[root@localhost ffmpeg]# cd faad2-2.7
[root@localhost faad2-2.7]# chmod 755 bootstrap
[root@localhost faad2-2.7]# ./bootstrap && ./configure && make && make install
[root@localhost faad2-2.7]# ldconfig
安装 vo-aacenc
[root@localhost ffmpeg]# tar -zxvf vo-aacenc_0.1.3.orig.tar.gz
[root@localhost ffmpeg]# cd vo-aacenc-0.1.3/
[root@localhost vo-aacenc-0.1.3]# ./configure
[root@localhost vo-aacenc-0.1.3]# make && make install
[root@localhost vo-aacenc-0.1.3]# ldconfig
3) 安装FFmpeg
[root@localhost ffmpeg]# tar -zxvf ffmpeg-1.2.11.tar.gz
[root@localhost ffmpeg]# cd ffmpeg-1.2.11
[root@localhost ffmpeg-1.2.11]# ./configure --enable-gpl --enable-version3 --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-libvo-aacenc
[root@localhost ffmpeg-1.2.11]# make && make install
[root@localhost ffmpeg-1.2.11]# ldconfig
[root@localhost ffmpeg-1.2.11]# cp /usr/local/bin/ffmpeg /usr/bin/
4) 安装qt-faststart
[root@localhost ffmpeg-1.2.11]# cd ffmpeg-1.2.11
[root@localhost ffmpeg-1.2.11]# make tools/qt-faststart
[root@localhost ffmpeg-1.2.11]# cp -a tools/qt-faststart /usr/bin/
5) 查看版本和转换测试
查看版本
[root@localhost software]# ffmpeg
ffmpeg version 1.2.11 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 21 2016 17:48:12 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --enable-gpl --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
测试
[root@localhost software]# ffmpeg -i ./09.mp4 -y -acodec libmp3lame -ab 128 -ar 22050 -vcodec h264 -b 96k -r 25 ./01.flv
…
[root@localhost software]# ll
total 32232
-rw-r--r--. 1 root root 4378561 Apr 21 17:56 01.flv
-rw-r--r--. 1 root root 28609569 Apr 21 17:52 09.mp4
成功!
【文件预览】:
ffmpeg
----yasm-1.2.0.gz(1.37MB)
----last_x264.tar(3.33MB)
----last_x264.tar.bz2(637KB)
----libvorbis-1.3.4.tar.xz(1.04MB)
----xvidcore-1.1.3.tar.gz(722KB)
----amrwb-7.0.0.1.tar.bz2(215KB)
----vo-aacenc_0.1.3.orig.tar.gz(598KB)
----faad2-2.7.tar.gz(1.08MB)
----amrnb-7.0.0.1.tar.bz2(222KB)
----faac-1.28.tar.gz(663KB)
----libdca-0.0.2.tar.gz(288KB)
----lame-3.99.5.tar.gz(1.38MB)
----ffmpeg-1.2.11.tar.gz(7.03MB)
----a52dec-0.7.4.tar.gz(236KB)
----libogg-1.1.3.tar.gz(394KB)