TL;DR
To install FFmpeg on Ubuntu, you can try these methods:
- Update and upgrade your Ubuntu system:
sudo apt update, sudo apt upgrade. - Download FFmpeg source code, extract it, navigate to the extracted directory.
- Build and install FFmpeg:
./configure, make, sudo make install. - Verify the installed version of FFmpeg:
ffmpeg -version.
cc allows you to manipulate audio and video files effectively. This guide provides instructions for tasks like converting formats, resizing videos, and trimming. Installing FFmpeg offers benefits such as wide format support, powerful functionality for encoding and video editing, customizability, and the advantage of an active community for ongoing support and updates. However, it’s important to be aware of common errors, including installation dependencies, command execution, codec compatibility, and hardware limitations.
Read the guide below for a step-by-step guide to install FFmpeg on Ubuntu, how to use it, benefits of installing it, and common errors with possible solutions.
FFmpeg is an open-source multimedia framework that allows you to manipulate audio and video files using a command-line interface. It serves as the backbone for various multimedia applications and is renowned for its flexibility and efficiency in handling multimedia formats.
With FFmpeg, you can easily perform tasks like video conversion, audio extraction, video editing, video streaming, and much more. Its comprehensive set of tools and libraries make it a popular choice among developers and media professionals. In this comprehensive guide, I will walk you through the step-by-step process to install FFmpeg on Ubuntu, how to use it, benefits of installing it, and common errors when installing and using FFmpeg.
How to Install FFmpeg on Ubuntu
To install FFmpeg on Ubuntu, you’ll need a compatible Ubuntu operating system, a modern CPU, a minimum of 2GB RAM (though more is recommended for better performance), sufficient storage space for files, the necessary dependencies such as libraries and codecs, and optional graphics hardware for certain features like hardware acceleration. Follow these steps:
- Open a Terminal by pressing Ctrl+Alt+T.

- Type the following command to update your package list:
<strong>sudo apt update</strong> - This command updates the list of available packages on your Ubuntu system.

- Once the package list is updated, run the following command to upgrade your installed packages:
<strong>sudo apt upgrade</strong> - If prompted, enter your password and confirm the upgrade process. This command ensures that your system’s installed packages are up to date with the latest security patches, bug fixes, and improvements.

- Download the FFmpeg source code from the official website. Visit the FFmpeg website (https://ffmpeg.org/download.html) and choose the latest stable release or a specific version you prefer.

- Extract the downloaded source code archive to a directory of your choice.

- Navigate to the extracted directory using the Terminal.

- Run the following commands in sequence to build and install FFmpeg on Ubuntu:
<strong>./configure</strong> - The command will configure the build options.

- Now run the following command:
<strong>make</strong> - The command will compile FFmpeg make file.

- In the end run the following command:
<strong>sudo make install</strong> - This command installs ffmpeg on your system.

- To check the installed version of FFmpeg, enter the following command:
<strong>ffmpeg -version</strong> - The Terminal will display detailed information about the FFmpeg version and its configured options.

How to Use FFmpeg
FFmpeg is a powerful multimedia framework that allows you to manipulate and process audio and video files. I will walk you through the basics of using FFmpeg and provide you with some commonly used commands. By the end, you’ll have a solid foundation for utilizing FFmpeg’s capabilities in your multimedia projects.
1. Converting a Video Format
To convert a video file from one format to another, use the following command:
<strong><code>ffmpeg -i input.mp4 output.avi</code></strong> Replace input.mp4 with the name of your input file and output.avi with the desired name of the output file. FFmpeg will automatically detect the input format based on the file extension, so you don’t need to specify it explicitly.

2. Resizing a Video
To resize a video to a specific width and height, use the following command:
<strong>ffmpeg -i input.mp4 -vf "scale=640:480" output.mp4</strong> In this example, the video will be resized to a width of 640 pixels and a height of 480 pixels. Adjust the values as needed.

3. Trimming a Video
To trim a video and extract a specific portion, specify the start and end times using the -ss (start time) and -to (end time) options. Here’s an example: