We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

How to Install and Use FFmpeg on Ubuntu 18.04

How to Install and Use FFmpeg on Ubuntu 18.04. FFmpeg is a great tool to record, convert and stream audio and video.

This tutorial covers the steps required to install FFmpeg on Ubuntu 18.04. We will use the ffmpeg command line tool to convert audio, add text to video and many more.

Not using Ubuntu 18.04? Choose a different OS:

Ubuntu 18.04 LTS

This setup instructions works on Ubuntu 16.04 and any Ubuntu based distribution, including Linux Mint and Elementary OS. This tutorial is tested on Google Cloud for automatic image and video processing.

Prerequisites

A Ubuntu system with sudo privileges.

If you are using Google Cloud you need to have some additional requirements fulfilled.

Install FFmpeg 4.x on Ubuntu

FFmpeg 4 is available from the Jonathon F’s PPA.

01. Start by adding the jonathonf/ffmpeg-4 PPA

sudo add-apt-repository ppa:jonathonf/ffmpeg-4

02. Now you can install FFmpeg with the following command.

sudo apt install ffmpeg

03. Verify the installation.

ffmpeg -version

The output will be something similar to this.

Output
ffmpeg version 4.1-1~16.04.york1 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609

Now, FFmpeg is installed successfully and ready to be used.

FFmpeg Examples

In this part, we will look at some basic examples to use the ffmpeg utility.

Basic conversion

While converting the audio and the video files with ffmpeg you don’t need to specify the input and output formats. The input file format is detected automatically and the output format is selected from the file extension.

Convert a video file from webm to mp4

ffmpeg -i input.webm output.mp4

Convert an audio file from ogg to mp3

ffmpeg input.ogg output.mp3

Specifying codecs

You can specify the codecs you want to use with the -c flag option. The codec can be the name of any supported decoder/encoder or a special value copy which simply copies the input stream.

Convert a video file from webm to mp4 using the libvpx video codec and libvorbis audio codec

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

Convert an audio file from ogg to mp3 encoded with the libopus codec.

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

Conclusion

Now you have learned how to install FFmpeg on your Ubuntu system.

Thanks for your time. If you face any problem or any feedback, just leave a comment below.

Cart

Your Cart is Empty

Back To Shop