FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方案。它包含了非常先进的音频/视频编解码库libavcodec,为了保证高可移植性和编解码质量,libavcodec里很多code都是从头开发的。
FFmpeg在Linux平台下开发,但它同样也可以在其它操作系统环境中编译运行,包括Windows、Mac OS X等。这个项目最早由Fabrice Bellard发起,2004年至2015年间由Michael Niedermayer主要负责维护。许多FFmpeg的开发人员都来自MPlayer项目,而且当前FFmpeg也是放在MPlayer项目组的服务器上。项目的名称来自MPEG视频编码标准,前面的"FF"代表"Fast Forward"。 [1] FFmpeg编码库可以使用GPU加速。
前提需要安装yasm、libx264、pkg-config
yum install yasm -y
如果没有安装yasm,在执行./configure --enable-libx264 --enable-gpl --prefix=/usr/local/ffmpeg会提示如下错误:
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
# tar jxvf x264-master.tar
# cd x264-master
# ./configure --enable-shared
# make && make install
如果没有安装libx264,在使用ffmpeg会提示:Unknown encoder ‘libx264’
# tar jxvf pkg-config-0.29.2.tar.gz
# cd pkg-config-0.29.2
# ./configure --with-internal-glib
# make
# make check
# make install
wget http://www.ffmpeg.org/releases/ffmpeg-5.0.tar.gz
tar -zxvf ffmpeg-5.0.tar.gz
# ./configure --enable-libx264 --enable-gpl --prefix=/usr/local/ffmpeg
# make && make install
# vim /etc/ld.so.conf
/usr/local/ffmpeg/lib/
/usr/local/lib/
# ldconfig
# ./ffmpeg -version
# vim /etc/profile
export PATH=$PATH:/usr/local/ffmpeg/bin
# source /etc/profile
# ffmpeg -version
留言与评论(共有 0 条评论) “” |