(Update 2018) Installing FFMPEG, MENCODER, MPLAYER, YAMDI, MEDIAINFO, EXIF TOOL, FLVTOOL2, MP4BOX & IMAGEMAGIC Part-1

0 4,012

Get real time updates directly on you device, subscribe now.

FFMPEG is the best and most used multimedia framework which can decode, encode, transcode, mux, demux, stream, filter and play almost anything. There are lots of users specially beginners around the world who don’t want to pay for professional server setup for running their streaming service, but can’t find a working tutorial for compiling/installing all these packages, and mess up their server following wrong or old tutorials posted on several sites which are actually copied from other sites. So here at WASY TUTS, today i am writing this tutorial to help those. Just Follow the tutorial with open mind and everything will be fine. Its really easy to setup and run many top level scripts by following this tutorial. You can easily run your own YouTube Clone Script.
Top scripts that can be easily run with this configuration:
Adult Video Script | ClipShare | Clip Bucket | PHPVibe | MediaShare | VideoWatch | PHP Melody | Alstrasoft Video Sharing | PHPmotion |
CumulusClips and a lots more…

Installing FFMPEG, MENCODER, MPLAYER, YAMDI, MEDIAINFO, EXIFTOOL, FLVTOOL2, MP4BOX & IMAGEMAGIC

Important Note: We / WASY TUTS, don’t take any responsibility if anything goes wrong with your server. This tutorial is only tested on Debian 8 & Ubuntu 14.04, but it may work on other versions too.

First of all you need to have a VPS or Dedicated Server with root privilege plus minimum 2GB RAM (Recommended 4GB+), and Must be already setup with LAMP or LEMP stack.

Now i suppose Apache, PHP & MySQL is running on your Server, you should first know the recommended versions of all these: We recommend PHP version 5.6 with MySQL 5.5, Lets get started now.

Note: All the commands in this section must be run as root

1. Configure APT to use the deb-multimedia repository:

1.1) Open source.list in your favorite editor, I recommend nano , but you can use whatever editor you want.
~~~~~~~~~~~~~~~~
[email protected]:~# sudo nano /etc/apt/sources.list
~~~~~~~~~~~~~~~~

Add the following to the bottom of /etc/apt/sources.list:

~~~~~~~~Insert the below two lines only~~~~~~~~
deb http://www.deb-multimedia.org jessie main non-free
deb-src http://www.deb-multimedia.org jessie main non-free
~~~~~~~~Insert the above two lines only~~~~~~~~

1.2) Refresh apt’s package database, by typing:
~~~~~~~~~~~~~~~~
[email protected]:~# apt-get update
~~~~~~~~~~~~~~~~

1.3) Allow apt to trust deb-multimedia’s key, by typing:
~~~~~~~~~~~~~~~~
[email protected]:~# apt-get install deb-multimedia-keyring
~~~~~~~~~~~~~~~~

1.4) Refresh apt’s package database again, by typing:
~~~~~~~~~~~~~~~~
[email protected]:~# apt-get update
~~~~~~~~~~~~~~~~

Optional Step: Remove ffmpeg if already installed

Remove the ffmpeg package, if it is installed, to avoid confusion caused by having two versions of ffmpeg installed and potential conflicts with the packages that will be installed in the next step:
~~~~~~~~~~~~~~~~
[email protected]:~# apt-get remove ffmpeg
~~~~~~~~~~~~~~~~

2. Install Libraries:

Install library packages and build tools by issuing below command:
~~~~~~~~~~~~~~~~
[email protected]:~# apt-get install build-essential libmp3lame-dev libvorbis-dev libtheora-dev libspeex-dev yasm pkg-config libfaac-dev libopenjpeg-dev libx264-dev
~~~~~~~~~~~~~~~~

3. Install FFMPEG:

3.1) Download and extract the ffmpeg source code, type the below commands one by one:
~~~~~~~~~~~~~~~~
[email protected]:~# mkdir software
~~~~~~~~~~~~~~~~
[email protected]:~# cd software
~~~~~~~~~~~~~~~~
[email protected]:~# wget http://ffmpeg.org/releases/ffmpeg-2.7.2.tar.bz2
~~~~~~~~~~~~~~~~
[email protected]:~# cd ..
~~~~~~~~~~~~~~~~
[email protected]:~# mkdir src
~~~~~~~~~~~~~~~~
[email protected]:~# cd src
~~~~~~~~~~~~~~~~
[email protected]:~# tar xvjf ../software/ffmpeg-2.7.2.tar.bz2
~~~~~~~~~~~~~~~~

3.2) Move into the source directory by typing the below command:
[email protected]:~# cd ffmpeg-2.7.2
~~~~~~~~~~~~~~~~

3.3) Configure, build and install:

~~~~~~~~~~~~~~~~
[email protected]ww:~# ./configure –enable-gpl –enable-postproc –enable-swscale –enable-avfilter –enable-libmp3lame –enable-libvorbis –enable-libtheora –enable-libx264 –enable-libspeex –enable-shared –enable-pthreads –enable-libopenjpeg –enable-libfaac –enable-nonfree
~~~~~~~~~~~~~~~~
[email protected]:~# make
~~~~~~~~~~~~~~~~
[email protected]:~# sudo make install
~~~~~~~~~~~~~~~~

3.4) Run “/sbin/ldconfig” as root.

Finally check the installed ffmpeg version:
~~~~~~~~~~~~~~~~
[email protected]:~# ffmpeg -version
~~~~~~~~~~~~~~~~

Update: FFMPEG v3.4.1 Latest till Jan 2018
follow previous steps till 3.1
3.1) Download and extract the ffmpeg source code, type the below commands one by one:
~~~~~~~~~~~~~~~~
[email protected]:~# mkdir software
~~~~~~~~~~~~~~~~
[email protected]:~# cd software
~~~~~~~~~~~~~~~~
[email protected]:~# wget wget http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.bz2
~~~~~~~~~~~~~~~~
[email protected]:~# cd ..
~~~~~~~~~~~~~~~~
[email protected]:~# mkdir src
~~~~~~~~~~~~~~~~
[email protected]:~# cd src
~~~~~~~~~~~~~~~~
[email protected]:~# tar xvjf ../software/ffmpeg-3.4.1.tar.bz2
~~~~~~~~~~~~~~~~

3.2) Move into the source directory by typing the below command:
[email protected]:~# cd ffmpeg-3.4.1
~~~~~~~~~~~~~~~~

3.3) Configure, build and install:

~~~~~~~~~~~~~~~~
[email protected]:~# ./configure –enable-gpl –enable-postproc –enable-swscale –enable-avfilter –enable-libmp3lame –enable-libvorbis –enable-libtheora –enable-libx264 –enable-libspeex –enable-shared –enable-pthreads –enable-libopenjpeg –enable-nonfree
~~~~~~~~~~~~~~~~
[email protected]:~# make
~~~~~~~~~~~~~~~~
[email protected]:~# sudo make install
~~~~~~~~~~~~~~~~

3.4) Run “/sbin/ldconfig” as root.

Finally check the installed ffmpeg version:
[email protected]:~# ffmpeg -version

Note: On ffmpeg 3.x you will get error: “ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory”
Now try :
[email protected]:~# ldd `which ffmpeg`

result: libavdevice.so.52 => not found
libavfilter.so.1 => not found
libavformat.so.52 => not found………..and so on

run:
[email protected]:~# find /usr/local/lib/ | grep -E “libavdevice.so.52|libavfilter.so.1|libavcodec.so.52|libavcore.so.0”

now to fix this all follow:
edit /etc/ld.so.conf
[email protected]:~# nano /etc/ld.so.conf
and add the blow lines:

include ld.so.conf.d/*.conf
/usr/local/libevent-1.4.14b/lib
/usr/local/lib

now run:
[email protected]:~# ldconfig

now check:
[email protected]:~# ffmpeg -version
done

At this point the FFMPEG should be installed properly, Continue reading to Next Part in order to learn how to install rest of the packages,

Click here to goto Part 2 >

80%
Awesome
  • Design

Get real time updates directly on you device, subscribe now.

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More