YouTube Icon

Code Playground.

How to Install and Use FFmpeg on CentOS 7

CFG

How to Install and Use FFmpeg on CentOS 7

FFmpeg is a free and open-source assortment of instruments for taking care of mixed media records. It contains a bunch of shared sound and video libraries, for example, libavcodec, libavformat, and libavutil. With FFmpeg, you can change over between different video and sound configurations, set example rates, catch web based sound/video, and resize recordings. 

This instructional exercise strolls you through introducing FFmpeg on CentOS 7. 

Prerequisites

To have the option to add new vaults and introduce bundles on your CentOS framework, you should be signed in as a client with sudo advantages . 

Installing FFmpeg on CentOS 7 

FFmpeg isn't accessible in CentOS 7 center vaults. You can decide to assemble the FFmpeg instruments from the source or to introduce it through yum from an outsider Yum storehouse. 

We'll go with the subsequent choice and introduce from the RPM Fusion storehouse: 

The RPM Fusion storehouse relies upon the EPEL programming archive. On the off chance that the EPEL isn't empowered on your framework, empower it by composing: 

sudo yum install epel-release

Next, empower the RPM Fusion storehouse by introducing the rpm bundle : 

sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm

When the archive is empowered, introduce FFmpeg: 

sudo yum install ffmpeg ffmpeg-devel

Confirm the FFmpeg establishment by checking its form: 

ffmpeg -version

At the hour of composing this article, the current form of FFmpeg accessible in the RPM Fusion archive is 3.4.7: 

ffmpeg version 3.4.7 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
...

That is it. FFmpeg has been introduced on your CentOS machine and you can begin utilizing it. 

FFmpeg Examples

In this segment, we will take a gander at some essential models on the best way to utilize the ffmpeg utility. 

Basic conversion

While changing over sound and video records utilizing ffmpeg, you don't need to indicate the info and yield designs. The info record design is auto-recognized, and the yield design is speculated from the document augmentation. 

Convert a video record from mp4 to webm: 

ffmpeg -i input.mp4 output.webm

Convert a sound document from mp3 to ogg: 

ffmpeg -i input.mp3 output.ogg

Specifying codecs

You can indicate the codecs you need to use with the - c choice. The codec can be the name of any upheld decoder/encoder or an exceptional worth duplicate that just duplicates the information stream. 

Convert a video document from mp4 to webm utilizing the libvpx video codec and libvorbis sound codec: 

ffmpeg -i input.mp4 -c:v libvpx -c:a libvorbis output.webm

Convert a sound document from mp3 to ogg encoded with the libopus codec. 

ffmpeg -i input.mp3 -c:a libopus output.ogg

Conclusion

We have told you the best way to introduce FFmpeg on CentOS 7 machines. You would now be able to visit the authority FFmpeg Documentation page and figure out how to utilize FFmpeg to change over and your video and sound records. 

In the event that you hit an issue or have input, leave a remark underneath.




CFG