Latest FFMPEG installation - CentOS 6 / 7 - FFMPEG + MP4 + FLV, Mplayer


#1

How I installed FFMPEG on Centos 6

yum groupinstall “Development Tools” -y

yasm

mkdir /usr/local/src
cd /usr/local/src
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar zxf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure && make && make install
Check if installation finished successfully

yasm --version
yasm 1.2.0 (this is how the result should look)

LIBOGG

cd /usr/local/src
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
tar zxvf libogg-1.3.0.tar.gz
cd /usr/local/src/libogg-1.3.0
./configure
make install
Check if installation finished successfully

ls /usr/local/lib/libogg*
You should see something like this:

/usr/local/lib/libogg.a /usr/local/lib/libogg.so.0
/usr/local/lib/libogg.la /usr/local/lib/libogg.so.0.8.0

LIBVORBIS
yum install libogg-devel vorbis-tools libvorbis-devel
cd /usr/local/src
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar zxvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure && make clean && make && make install

Check if installation finished successfully
ls /usr/local/lib/libvorbis*
You should see something like this:

/usr/local/lib/libvorbis.a /usr/local/lib/libvorbisfile.so
/usr/local/lib/libvorbisenc.a /usr/local/lib/libvorbisfile.so.3
/usr/local/lib/libvorbisenc.la /usr/local/lib/libvorbisfile.so.3.3.5
/usr/local/lib/libvorbisenc.so /usr/local/lib/libvorbis.la
/usr/local/lib/libvorbisenc.so.2 /usr/local/lib/libvorbis.so
/usr/local/lib/libvorbisenc.so.2.0.9 /usr/local/lib/libvorbis.so.0
/usr/local/lib/libvorbisfile.a /usr/local/lib/libvorbis.so.0.4.6
/usr/local/lib/libvorbisfile.la

================================================================================
LibXvid
cd /usr/local/src
wget http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz
tar zxvf xvidcore-1.3.3.tar.gz
cd xvidcore/build/generic
./configure
make
make install
Check installation:

ls /usr/local/lib/libxvid*
Expected result:

/usr/local/lib/libxvidcore.a /usr/local/lib/libxvidcore.so.4@
/usr/local/lib/libxvidcore.so@ /usr/local/lib/libxvidcore.so.4.3

Theora
cd /usr/local/src
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
tar zxvf libtheora-1.1.1.tar.gz
cd /usr/local/src/libtheora-1.1.1
./configure && make clean && make && make install
Check installation:

ls /usr/local/lib/libtheora*
Expected result:

/usr/local/lib/libtheora.a /usr/local/lib/libtheoraenc.so
/usr/local/lib/libtheoradec.a /usr/local/lib/libtheoraenc.so.1
/usr/local/lib/libtheoradec.la /usr/local/lib/libtheoraenc.so.1.1.2
/usr/local/lib/libtheoradec.so /usr/local/lib/libtheora.la
/usr/local/lib/libtheoradec.so.1 /usr/local/lib/libtheora.so
/usr/local/lib/libtheoradec.so.1.1.4 /usr/local/lib/libtheora.so.0
/usr/local/lib/libtheoraenc.a /usr/local/lib/libtheora.so.0.3.10
/usr/local/lib/libtheoraenc.la

curl -O http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.gz
tar xzvf nasm-2.13.01.tar.gz
cd nasm-2.13.01
./configure --prefix=/opt/nasm
make
sudo make install
export PATH=/opt/nasm/bin/:$PATH

LIBX264
cd /usr/local/src
wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xvjf last_x264.tar.bz2
cd x264-snapshot-*
make distclean
./configure --enable-shared && make clean && make && make install
Check installation:

ls /usr/local/lib/libx264*
This should show:

/usr/local/lib/libx264.so /usr/local/lib/libx264.so.124

============================================================================
Amr
cd /usr/local/src
wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz
tar zxf opencore-amr-0.1.3.tar.gz
cd /usr/local/src/opencore-amr-0.1.3
./configure && make clean && make && make install
Test installation:

ls /usr/local/lib/libopencore*
You should see:

/usr/local/lib/libopencore-amrnb.a
/usr/local/lib/libopencore-amrnb.la
/usr/local/lib/libopencore-amrnb.so
/usr/local/lib/libopencore-amrnb.so.0
/usr/local/lib/libopencore-amrnb.so.0.0.3
/usr/local/lib/libopencore-amrwb.a
/usr/local/lib/libopencore-amrwb.la
/usr/local/lib/libopencore-amrwb.so
/usr/local/lib/libopencore-amrwb.so.0
/usr/local/lib/libopencore-amrwb.so.0.0.3

libfaac
cd /usr/local/src
wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
tar zxvf faac-1.28.tar.gz
cd /usr/local/src/faac-1.28
./configure && make clean && make && make install
Verify installation:

ls /usr/local/lib/libfaac*
You should see this:

/usr/local/lib/libfaac.a /usr/local/lib/libfaac.so /usr/local/lib/libfaac.so.0.0.0
/usr/local/lib/libfaac.la /usr/local/lib/libfaac.so.0

If compilation of libfaac fails, try to edit the file /usr/local/src/faac-1.28/common/mp4v2/mpeg4ip.h and delete the following line (around line 126)

char *strcasestr(const char *haystack, const char *needle);
And repeat compilation:

make clean && ./configure && make && make install

libfdk-aac

yum install unzip
cd /usr/local/src
wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
unzip fdk-aac.zip
cd mstorsjo-fdk-aac*
autoreconf -fiv
./configure
make
make install

Verify installation:

ls /usr/local/lib/libfdk-aac*
You should see:

/usr/local/lib/libfdk-aac.a /usr/local/lib/libfdk-aac.la* /usr/local/lib/libfdk-aac.so@ /usr/local/lib/libfdk-aac.so.1@ /usr/local/lib/libfdk-aac.so.1.0.0*

LAME
cd /usr/local/src
wget downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar zxvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure && make clean && make && make install
Check installation:

ls /usr/local/lib/libmp3lame*
And you should see:

/usr/local/lib/libmp3lame.a /usr/local/lib/libmp3lame.so.0
/usr/local/lib/libmp3lame.la /usr/local/lib/libmp3lame.so.0.0.0
/usr/local/lib/libmp3lame.so

libopus
cd /usr/local/src
wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar zxvf opus-1.1.tar.gz
cd opus-1.1
./configure --enable-static --enable-shared
make
make install
ldconfig
Test installation:

ls /usr/local/lib/libopus*
You should see:

/usr/local/lib/libopus.a /usr/local/lib/libopus.la* /usr/local/lib/libopus.so@ /usr/local/lib/libopus.so.0@ /usr/local/lib/libopus.so.0.5.0*

libvpx
cd /usr/local/src
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --disable-examples --enable-shared && make && make install && ldconfig
Check installation:

ls /usr/local/lib/libvpx*
You should see this:

/usr/local/lib/libvpx.a /usr/local/lib/libvpx.so.1 /usr/local/lib/libvpx.so.1.1.0
/usr/local/lib/libvpx.so /usr/local/lib/libvpx.so.1.1

FFMPEG
yum install freetype.x86_64
yum install freetype-devel.x86_64

cd /usr/local/src
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp
wget https://www.ffmpeg.org/releases/ffmpeg-snapshot-git.tar.bz2
tar xjf ffmpeg-snapshot-git.tar.bz2
cd ffmpeg
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure --disable-static --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-libmp3lame --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libtheora --enable-libxvid --enable-libfdk_aac --enable-libopus --enable-libfreetype
make clean && make && make install
make tools/qt-faststart
cp tools/qt-faststart /usr/local/bin/
ldconfig

Presets
cd /usr/local/src
wget http://mirror.ffmpeginstaller.com/source/presets/presets.tar.gz
tar zxvf presets.tar.gz
cp -vrf presets/* /usr/local/share/ffmpeg/

============================================================================================

ldd which ffmpeg

find /usr/local/lib/

nano /etc/ld.so.conf

include ld.so.conf.d/*.conf
/usr/local/lib

ldconfig

====================================================================================
MPLAYER

mplayer_install
cat >/etc/yum.repos.d/linuxtech.repo <<BLOCK
[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
BLOCK

yum install mplayer

=================================================================================
MP4Box

yum -y install freetype-devel SDL-devel freeglut-devel

cd /usr/local/src/
wget http://mirror.ffmpeginstaller.com/source/gpac/gpac-0.5.0.tar.gz
wget http://mirror.ffmpeginstaller.com/source/gpac/gpac_extra_libs-0.5.0.zip
tar -zxvf gpac-0.5.0.tar.gz
unzip gpac_extra_libs-0.5.0.zip
cd gpac
chmod 755 configure
./configure
make lib
make apps
make install lib
make install
cp bin/gcc/libgpac.so /usr/lib
install -m644 bin/gcc/libgpac.so /usr/local/lib/libgpac.so
chmod +x /usr/local/lib/libgpac.so
ldconfig

which MP4Box
/usr/local/bin/MP4Box -version

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6*.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm

Use your favorite text editor to open /etc/yum.repos.d/remi.repo. Look for the remi section and find enabled=0 and change it to enabled=1.

yum install -y gcc php-devel php-pear
yum install -y ImageMagick ImageMagick-devel

=======================================================================================


#2

Thank you, This will help a lot of new users :slight_smile:


#3

Great Guide works for me … but you missed “mediainfo”

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm18
rpm -ivh epel-release-6-8.noarch.rpm
yum install mediainfo

and also i face error on MPlayer & libfaac but video conversion still working fine… thanks for the guide you share.


#4

Libfaac

If compilation of libfaac fails, try to edit the file /usr/local/src/faac-1.28/common/mp4v2/mpeg4ip.h and delete the following line (around line 126)

char *strcasestr(const char *haystack, const char *needle);
And repeat compilation:

make clean && ./configure && make && make install

Mplayer

cat >/etc/yum.repos.d/linuxtech.repo <<BLOCK
[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
BLOCK

then
yum install Mplayer


#5

@vituga @Arman

can you please help me here i’m stuck ?

if i type ffmpeg i get this error

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

also i cannot do these next steps… nano doesnt work for me amd ldd which ffmpeg not working

centos 7 plesk panel

ldd which ffmpeg
find /usr/local/lib/
nano /etc/ld.so.conf

include ld.so.conf.d/*.conf
/usr/local/lib

ldconfig

i cannot on my machine do nano or ldd ??

how can i complete this everything else worked good other tham this error ?

awaiting someones response

=============================================================================

server1:/usr/local/src# which ffmpeg
/usr/local/bin/ffmpeg
server1:/usr/local/src# ffmpeg
ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory
server1:/usr/local/src# ldd which ffmpeg
which:
ldd: ./which: No such file or directory
ffmpeg:
ldd: ./ffmpeg: not regular file
server1:/usr/local/src# ldd
ldd: missing file arguments
Try `ldd --help’ for more information.
server1:/usr/local/src# ldd help
ldd: ./help: No such file or directory
server1:/usr/local/src# ldd --help
Usage: ldd [OPTION]… FILE…
–help print this help and exit
–version print version information and exit
-d, --data-relocs process data relocations
-r, --function-relocs process data and function relocations
-u, --unused print unused direct dependencies
-v, --verbose print all information

For bug reporting instructions, please see:
http://www.gnu.org/software/libc/bugs.html.
server1:/usr/local/src# ldd ffmpeg
ldd: ./ffmpeg: not regular file
server1:/usr/local/src# ldd --version
ldd (GNU libc) 2.17
Copyright © 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.


#6

you need to make sure the correct lib directories are setup in ldconfig. Edit the /etc/ld.so.conf file and add the following lines. After you save it, run the command ldconfig

/usr/local/lib
/usr/lib

i edit this file and added the 2 lines

then I went to /etc directory and ran ldconfig

cd /etc

ldconfig

now i do ffmpeg

==============================================================================

server1:/etc# ffmpeg
ffmpeg version N-90065-g8a8d0b3 Copyright © 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
configuration: --disable-static --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-libmp3lame --enable-
bx264 --enable-libvpx --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopencore-amrnb --ena
e-libtheora --enable-libxvid --enable-libfdk_aac --enable-libopus --enable-libfreetype
libavutil 56. 7.101 / 56. 7.101
libavcodec 58. 11.101 / 58. 11.101
libavformat 58. 9.100 / 58. 9.100
libavdevice 58. 1.100 / 58. 1.100
libavfilter 7. 12.100 / 7. 12.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…

Use -h to get full help or, even better, run ‘man ffmpeg’


#7

also i get error with your x264 so i download this one and no issues

LIBX264
cd /usr/local/src
REPLACE:
wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
WITH:
wget ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170310-2245-stable.tar.bz2
tar xvjf x264-snapshot-20170310-2245-stable.tar.bz2
cd x264-snapshot-*
make distclean
./configure --enable-shared && make clean && make && make install
Check installation:

ls /usr/local/lib/libx264*
This should show:

/usr/local/lib/libx264.so /usr/local/lib/libx264.so.124

this wored for me Centos 7

====================================================================================

wget ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170310-2245-stable.tar.bz2


#8

now to try and install CB to see if it works be back shortly


#9

nope no luck i installed every gain and still no luck converting videos

see below conversion file

================================================================================

Converion Log for file .
Reading Conversion log for file

Conversion details
Raw Conversion Log

==========================================
Pre-Check Configurations

File to be converted

Initializing File 1518796201078c8.mp4 and pre checking configurations…

System hardware Information

Unable log System hardware information, plaese install “lshw”

Temporary Uploading

File Uploaded to Temp directory successfully and video conversion file is being executed !

Video Conversion File Execution

Video Converson File executed successfully with Target File > !1518796201078c8.mp4


#10

what about imagemagick how can i enable it


#11

[File extension error. ClipBucket V5.2.0 STABLE] after uploading

and ho can i install phpshielld