Install FFMpeg in CentOS 6 / CentOS 7

Blaine's picture
Audio Conversion with FFMpeg on CentOS 6 and CentOS 7

Installing FFmpeg on CentOS without a lot of trouble

From time to time, I have to fire up my good friend (major search engine) to remember how to do certain tasks.  For example, today I was in the process of migrating a website from one web host to another.  In order to do so, I needed to make sure that FFMpeg was installed and working on the new host before migrating the site, or all of the cool website multimedia features (e.g. audio blogs) would stop working.  Using FFMpeg is really a quick way to convert massive files into managable, portable, web ready files.  I digress.

To install FFMpeg on CentOS 6 or CentOS 7, you will need to follow a couple steps.

Prerequisites

  • Running CentOS 6 / CentOS 7
  • Root Access (typical on a VPS) or have a sudo user (typical on a shared hosting environment or other VPS environments)
  • Comfortable with YUM and RPM commands (Please don't blindly copy and paste code, understand it!)

Update your system before anything

yum install epel-release -y && yum update -y

This will install the EPEL Repository which contains updated packages over the base packages provided with CentOS out of the box.  Many of these updated packages also contain security updates, so I would highly suggest installing and using the EPEL Repository as default behavior.  After the EPEL Repository is installed, an update command will be issued.  Notice the -y after each yum command, which means force yes to any questions (read: automatic, no prompts).  

If after the update, there was any updates to the kernel, you will want to restart your machine.  To do so, issue a restart command:

shutdown -r now

Install the Nux Dextop YUM repository for FFMpeg packages

FFMpeg

 

Since there is not an official release of FFMpeg in RPM packages, we need to use the Nux Dextop repository which does contain FFMpeg.  Don't be concerned with the name of the repository, as we are not installing any GUI on your server, instead only using the repository for the FFMpeg packages bundled with it.

 

With CentOS 7, you can install the GPG Key and Repository with the following:

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

With CentOS 6, the same can be accomplished with the following:

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

Install FFmpeg Packages

Now that we have the repository installed for our version of CentOS, we can now install FFMpeg.  Typically, most installs you will want to install the base FFMpeg and the FFMpeg Development packages.  To do this, simply issue the following command:

yum install ffmpeg ffmpeg-devel -y

Check that FFMpeg installed without issues

To check that FFMpeg is installed correctly, you can issue a simple ffmpeg command:

ffmpeg

This should result in something very similar to the following output:

ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.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'

You are ready to go, and FFMpeg is now installed.  Congratulations, you can now start converting your audio and video files on your server.

Recent Posts

Installing FFmpeg on CentOS without a lot of trouble From time to time, I have to fire up my good... Read more
Video creation 101 The video is an electronic method for recording, playback, copying, broadcasting, and display of visuals. It was... Read more
Video Marketing in the Modern World Building a well informing video takes time, talent and passion. It is time-consuming and... Read more

Need Support?


Every video, every website, every chatbot, every client - 100% custom products and solutions to make your business run successfully

145 Pine Haven Shores Road #1205 Shelburne, VT

Recent Tweets

Socialize with us

               


Go to top