If you are looking to add video encoding or video streaming feature on your website, you should set up your server accordingly. Most of the time you may just need to have FFmpeg installed on your server, but if you are planning to run video sharing service like Vimeo or YouTube, you should also have other modules/extension installed on your Server.

Most of the ready to run video sharing scripts or YouTube clone scripts require these modules and extensions required on the Server.

  • FFmpeg
  • flvtool2
  • mp4box
  • ImageMagick

Install FFmpeg, flvtool2, mp4box, and ImageMagick on CentOS7

CentOS 7 requires a tweak to the process I’d used for CentOS 6. The links below are generally suitable for EL7.

Installing FFmpeg on CentOS 7

If you don’t have the EPEL repo installed already:

sudo yum -y install epel-release

Import a repo from Nux :

sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Install FFmpeg from this repo:

sudo yum -y install ffmpeg ffmpeg-devel

Confirm it’s working:

How To Install ffmpeg, flvtool2, mp4box and ImageMagick on CentOS 7 5
FFmpeg reporting back

Install flvtool2 on CentOS 7

This is easiest to grab via RubyGems.

Install Ruby and RubyGems

yum install -y ruby rubygems

And then it’s a simple gem install:

gem install flvtool2

And we’re done.

How To Install ffmpeg, flvtool2, mp4box and ImageMagick on CentOS 7 6
flvtool2 – done.

Install mp4box (GPAC) on CentOS 7

This one is quite easy on CentOS 7:

yum install -y gpac mediainfo

Install ImageMagick on CentOS 7

This package is much more common, so the install is also more straightforward.

Install any prerequisites:

yum install -y gcc php-devel php-pear

Install the package itself:

yum install -y ImageMagick ImageMagick-devel

Install it in PHP:

pecl install imagick
echo "extension=imagick.so" > /etc/php.d/imagick.ini

Finishing up.

Last, but not least:

service httpd restart