FFmpeg is a free and open-source project consisting of a vast software suite of libraries and programs for handling video, audio, and other multimedia files and streams.

It contains libavcodec, libavutil, libavformat, libavfilter, libavdevice, libswscale and libswresample which can be used by applications. As well as ffmpeg, ffplay and ffprobe which can be used by end users for transcoding and playing.

FFmpeg is not available in CentOS 7 core repositories. We need to install a suitable repofile which includes this FFMPEG package.

Here, we will enable NUX repository and install FFMPEG through it.

Firstly, enable EPEL repository:

# yum install epel-release

Next, install Nux repository :

# rpm -v –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

Once the NUX repo is enabled, install FFMPEG:

# yum install ffmpeg ffmpeg-devel

Verify FFMPEG installation:

# ffmpeg -version

ffmpeg version 2.6.5 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)

Installation completed.

Below is an example of media file conversion.

Download any .mp3 audio file on the server, and use below command to convert it to .ogg format

# ffmpeg -i source.mp3 destination.ogg

You can also specify which codecs to be used while converting any media file. In below command, you can find how to convert an audio file from .mp3 to .ogg encoded with the libopus codec.

# ffmpeg -i source.mp3 -c:a libopus destination.ogg