Compile FFmpeg on CentOS

本文提供了一个基于CentOS的FFmpeg安装教程,详细介绍了如何安装FFmpeg及其相关编码库,包括Yasm、x264、libfdk_aac等。适用于CentOS、RHEL及Fedora系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This guide is based on a minimal CentOS installation and will install FFmpeg with several external encoding libraries. This guide is kept relatively up to date with FFmpeg development and library sources (see the page history for changelog), and should also work for recent Red Hat Enterprise Linux (RHEL) and Fedora.

Note: The # indicates that the command should be executed as superuser or root.

Preparation

Remove any existing packages:

# yum erase ffmpeg x264 x264-devel 

Get the dependencies:

# yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig wget zlib-devel 

Make a source directory:

mkdir ~/ffmpeg-source 

Installation

Yasm

Yasm is an assembler used by x264 and FFmpeg.

cd ~/ffmpeg-source wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz tar xzvf yasm-1.2.0.tar.gz cd yasm-1.2.0 ./configure make # make install 

Note: If you do not require certain encoders you may skip the relevant section and then remove the appropriate ./configure option in FFmpeg. For example, if libvorbis is not needed, then skip that section and then remove --enable-libvorbis from the Install FFmpeg section.

x264

H.264 video encoder.

cd ~/ffmpeg-source git clone git://git.videolan.org/x264 cd x264 ./configure --enable-static make # make install 

libfdk_aac

AAC audio encoder.

cd ~/ffmpeg-source git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git cd fdk-aac autoreconf -fiv ./configure --disable-shared make # make install 

LAME

MP3 audio encoder.

cd ~/ffmpeg-source wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz tar xzvf lame-3.99.5.tar.gz cd lame-3.99.5 ./configure --disable-shared --enable-nasm make # make install 

libogg

Required for libtheora and libvorbis.

cd ~/ffmpeg-source wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz tar xzvf libogg-1.3.0.tar.gz cd libogg-1.3.0 ./configure --disable-shared make # make install 

libtheora

Theora video encoder.

cd ~/ffmpeg-source wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz tar xzvf libtheora-1.1.1.tar.gz cd libtheora-1.1.1 ./configure --disable-shared make # make install 

libvorbis

Vorbis audio encoder.

cd ~/ffmpeg-source wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz tar xzvf libvorbis-1.3.3.tar.gz cd libvorbis-1.3.3 ./configure --disable-shared make # make install 

libvpx

VP8 video encoder.

cd ~/ffmpeg-source git clone http://git.chromium.org/webm/libvpx.git cd libvpx ./configure make # make install 

FFmpeg

cd ~/ffmpeg-source git clone git://source.ffmpeg.org/ffmpeg cd ffmpeg ./configure --enable-gpl --enable-libfdk_aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 make # make install 

Compilation is now complete and ffmpeg should now be ready to use. 

转载于:https://www.cnblogs.com/elesos/archive/2013/03/05/2945171.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值