How to install ffmpeg Print

  • 0

https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

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

mkdir ~/ffmpeg_sources


# Yasm

cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/yasm/yasm.git
cd yasm
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
make distclean

# libx264

cd ~/ffmpeg_sources
git clone --depth 1 git://git.videolan.org/x264
cd x264
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make
make install
make distclean

 

# libx265

cd ~/ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install

 

# libfdk_aac

# AAC audio encoder.

# Requires ffmpeg to be configured with --enable-libfdk-aac (and --enable-nonfree if you also included --enable-gpl).

cd ~/ffmpeg_sources
git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

 

# libmp3lame

# MP3 audio encoder.

# Requires ffmpeg to be configured with --enable-libmp3lame.

cd ~/ffmpeg_sources
curl -L -O 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 --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
make
make install
make distclean

 

 

# libopus

# Opus audio decoder and encoder.

# Requires ffmpeg to be configured with --enable-libopus.

cd ~/ffmpeg_sources
git clone git://git.opus-codec.org/opus.git
cd opus
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

 


# libogg

# Ogg bitstream library. Required by libtheora and libvorbis.

cd ~/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
tar xzvf libogg-1.3.2.tar.gz
cd libogg-1.3.2
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

 

 

# libvorbis

# Vorbis audio encoder. Requires libogg.

# Requires ffmpeg to be configured with --enable-libvorbis.

cd ~/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
tar xzvf libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
LDFLAGS="-L$HOME/ffmeg_build/lib" CPPFLAGS="-I$HOME/ffmpeg_build/include" ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

 

# libvpx

# VP8/VP9 video encoder.

# Requires ffmpeg to be configured with --enable-libvpx.

cd ~/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples
make
make install
make clean

 

# INSTALL XVID
http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-CompileFFmpeg(theconfigureoptionshavetobeononeline)

# Requires ffmpeg to be configured with --enable-libxvid.


cd /opt
wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
tar xzvf xvidcore-1.3.2.tar.gz
cd xvidcore/build/generic
./configure --prefix="$HOME/ffmpeg_build"
make
make install

 

 

# FFmpeg

cd ~/ffmpeg_sources
git clone http://source.ffmpeg.org/git/ffmpeg.git

If the above do not work, use
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg


cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid
make
make install
make distclean
hash -r

 

 

 

 

 

 

################################################################################### CONVERT TESTING ################################################################################################################################

[root@server public_html]# ffmpeg -i movie.mov -b 300 -s 320x240 -vcodec libxvid -ab 32 -ar 24000 -acodec aac final_video.mp4


ffmpeg version N-78559-g2e8ad2d Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.103 / 57. 24.103
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 32.100 / 6. 32.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'movie.mov':
Metadata:
minor_version : 537199360
major_brand : qt
compatible_brands: qt
creation_time : 2009-02-26 21:53:04
Duration: 00:00:14.98, start: 0.000000, bitrate: 542 kb/s
Stream #0:0(eng): Data: none (rtp / 0x20707472), 217 kb/s (default)
Metadata:
creation_time : 2009-02-26 21:53:04
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Data: none (rtp / 0x20707472), 56 kb/s (default)
Metadata:
creation_time : 2009-02-26 21:53:04
handler_name : Apple Alias Data Handler
Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 52 kb/s (default)
Metadata:
creation_time : 2009-02-26 21:53:04
handler_name : Apple Alias Data Handler
Stream #0:3(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 480x360, 208 kb/s, 14.82 fps, 14.99 tbr, 600 tbn, 1200 tbc (default)
Metadata:
creation_time : 2009-02-26 21:53:04
handler_name : Apple Alias Data Handler
encoder : H.264
Please use -b:a or -b:v, -b is ambiguous
[libxvid @ 0x2c59180] Bitrate 300 is extremely low, maybe you mean 300k
The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
[aac @ 0x2c5a400] Bitrate 32 is extremely low, maybe you mean 32k
The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Output #0, mp4, to 'final_video.mp4':
Metadata:
minor_version : 537199360
major_brand : qt
compatible_brands: qt
encoder : Lavf57.25.100
Stream #0:0(eng): Video: mpeg4 (libxvid) ( [0][0][0] / 0x0020), yuv420p, 320x240, q=2-31, 0 kb/s, 14.99 fps, 15k tbn, 14.99 tbc (default)
Metadata:
creation_time : 2009-02-26 21:53:04
handler_name : Apple Alias Data Handler
encoder : Lavc57.24.103 libxvid
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 24000 Hz, mono, fltp, 0 kb/s (default)
Metadata:
creation_time : 2009-02-26 21:53:04
handler_name : Apple Alias Data Handler
encoder : Lavc57.24.103 aac
Stream mapping:
Stream #0:3 -> #0:0 (h264 (native) -> mpeg4 (libxvid))
Stream #0:2 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0x3171380] Increasing reorder buffer to 1
frame= 222 fps= 79 q=31.0 Lsize= 91kB time=00:00:14.97 bitrate= 49.9kbits/s speed=5.32x
video:64kB audio:19kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.104278%
[aac @ 0x2c5a400] Qavg: 0.000
[root@server public_html]#


###################################################################################################################################################################################################################

 


Was this answer helpful?

« Back

Powered by WHMCompleteSolution