FFmpeg is a free and open source tool set for processing multimedia files. It contains a series of audio and video libraries, such as: libavcodec, libavformat, and libavutil. Using FFmpeg, you can convert between various video and audio formats, set the bit rate, edit audio, video, and scale video.
This article mainly describes how to install FFmpeg on CentOS 8.
FFmpeg is not provided in the default CentOS 8 source repository. You can choose to compile and install FFmpeg from source files, or use the dnf
tool to install from the Negativo17
source repository. We will use the second option.
Complete the following steps to install FFmpeg on CentOS 8:
sudo dnf install epel-release
sudo yum config-manager --set-enabled PowerTools
sudo yum-config-manager --add-repo=https://negativo17.org/repos/epel-multimedia.repo
sudo dnf install ffmpeg
ffmpeg -version
At the time of writing this article, the current version of FFmpeg in the Negativo17 software source is 2.8.15
.
ffmpeg version 4.2.2Copyright(c)2000-2019 the FFmpeg developers
built with gcc 8(GCC)...
This command will also print out FFmpeg configuration options.
that's it. FFmpeg has been installed on your CentOS machine, and you can start using it.
In this chapter, we will look at a basic example on how to use ffmpeg
.
When using ffmpeg
to convert audio and video files, you do not need to specify the input and output formats. The input file format will be automatically detected, and the output format will be guessed from the file extension.
ffmpeg -i input.mp4 output.webm
ffmpeg -i input.mp3 output.ogg
When converting files, use the -c
option to specify the codec. It can be the name of any supported encoder or decoder, or a special value copy
means that only the input stream is copied.
libvpx
video codec and the libvorbis
audio codec:ffmpeg -i input.mp4 -c:v libvpx -c:a libvorbis output.webm
ffmpeg -i input.mp3 -c:a libopus output.ogg
We have shown how to install FFmpeg on CentOS 8. You should now browse official FFmpeg documentation page and learn how to use FFmpeg to convert your video and audio files.
Recommended Posts