Install FFmpeg on CentOS 7
FFmpeg is one the free and open source cross-platform solution for converting, recording and streaming media. FFmpeg is also used for converting media files to different formats, resize video, change sample rates for video and audio files. In this tutorial, you are going to learn how to install FFmpeg on CentOS 7.
Before you start to install FFmpeg on CentOS 7. You must have a non-root user account on your server with sudo privileges.
Install FFmpeg on CentOS
After every three months, a new version of FFmpeg comes with new features and bug fixes. Follow below instructions to install FFmpeg on CentOS 7.
Enable EPEL repository on CentOS 7 by running below command:
sudo yum install epel-release
Now we need to enable Nux repository to do this import GPG key using below command:
sudo rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
Let’s enable Nux repository typing following line in the terminal:
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Now you are ready to install FFmpeg on CentOS, to install FFmpeg on CentOS 7 type:
sudo yum install ffmpeg ffmpeg-devel
Confirm the installation and check FFmpeg version typing below command:
The output should be:
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-28)
Basic FFmpeg Examples
Below are some basic examples to use FFmpeg:
To check the media file information run following command:
ffmpeg -i filename.mp3
To convert an audio
.amr file to
.mp3 run the following command:
ffmpeg -i filename1.amr filename2.mp3
Similarly, you can convert video file like to convert
.mp4 file to
avi run below command:
ffmpeg -i inputvideo.mp4 outputvideo.mkv
You can also remove the audio stream from the video file using below command:
ffmpeg -i inputvideo.mp4 -vn outputaudio.mp3
You have successfully learned how to install FFmpeg on CentOS 7. If you have any queries please don’t forget to comment out.