How to Install FFmpeg on Ubuntu 24.04


FFmpeg is an open-source command-line tool that allows you to convert your media files from one format to another. FFmpeg can handle a wide variety of video and audio-related tasks using the decode (read) and encode (write) concepts. It works similarly to a language interpreter, but instead of converting the language, it converts your media files into a format of your choice. FFmpeg can also handle live-streaming, and filter audio, video, and image files efficiently.

If you have installed Ubuntu 24.04 and need a media customization tool for your system, install FFmpeg.

Follow the guide to learn:

How to Install FFmpeg on Ubuntu 24.04

You can install FFmpeg on Ubuntu 24.04 from:

How to Install FFmpeg on Ubuntu 24.04 Using Apt Package Manager

The apt repository of Ubuntu 24.04 makes it easy for the users to install FFmpeg updated version from the apt package manager. However, before you install FFmpeg on Ubuntu from the apt package manager, update the system repository using the following command:

sudo apt update && sudo apt upgrade -y

Note: Updating your system repository is crucial to ensure the installation of updated packages on the system.

Once you have updated your system repository, you can install FFmpeg on Ubuntu 24.04 from the command provided below:

sudo apt install ffmpeg -y

After completing the installation, you can check the FFmpeg version installed on Ubuntu from the following command:

ffmpeg --version

Note: You can remove FFmpeg from Ubuntu 24.04 by using the below-given command:

sudo apt remove ffmpeg -y

How to Install FFmpeg on Ubuntu 24.04 Using App Center

You can also install FFmpeg on Ubuntu 24.04 through the built-in App Center using the following steps:

Step 1: Open App Center from the desktop or Application menu:

Step 2: Search FFmpeg in the search box and click on the application:

Step 3: Then click the Install button to begin FFmpeg installation on Ubuntu:

Note: Enter the default Ubuntu username and password to begin the installation.

This completes the FFmpeg installation on Ubuntu from the App Center:

Note: To remove FFmpeg from Ubuntu through the App Center, simply use the Uninstall button from the Ellipsis:

How to Install FFmpeg on Ubuntu 24.04 Using Snap Store

Snap Store is the external package manager pre-installed on the Ubuntu system. It allows users to install applications from Snap that don’t interfere with the default apt repository applications. You can install FFmpeg on Ubuntu 24.04 using Snap Store by first ensuring Snap is installed on the system. The following command will ensure and install Snap on Ubuntu if required:

sudo apt install snapd -y

After ensuring Snap is installed on Ubuntu, use the following command to install FFmpeg:

sudo snap install ffmpeg

Once you install FFmpeg on Ubuntu, you can run the FFmpeg command using:

sudo snap run ffmpeg [options]

Here, replace [options] with the flags you want to use to run FFmpeg commands on Ubuntu. Here, we have opened the FFmpeg help section by using:

sudo snap run ffmpeg -h

Note: If you want to remove FFmpeg from Ubuntu 24.04, use the following command:

sudo snap remove ffmpeg

How to Use FFmpeg on Ubuntu 24.04

There are multiple FFmpeg uses on Ubuntu 24.04, some of them are given below:

How to Use FFmpeg on Ubuntu 24.04 to Get Media Information

To get media information using FFmpeg on Ubuntu, follow the following syntax:

ffmpeg -i file_name.format

Replace the file_name.format with the media file name to get information about the specified file: FFmpeg supports different file formats, such as mov, mp4, 3gp, avi, and more.

By default, the FFmpeg command provides too much information, but you can limit it to display only the relevant information by adding the -hide-banner flag at the end:

ffmpeg -i file_name.format -hide_banner

How to Use FFmpeg on Ubuntu 24.04 to Convert Media Files

You can also use the FFmpeg command on Ubuntu to convert media files, it can be done by using the following syntax:

ffmpeg -i orig_file_name.format conv_file_name.format

Ensure replacing the orig_file_name.format and conv_file_name.format with the media file name, including the format.

For example, here we have converted the mp4 file to mp3 file:

How to Use FFmpeg on Ubuntu 24.04 to Extract Audio and Images from Media Files

To extract audio from media files using FFmpeg on Ubuntu, you can follow the below-given syntax:

ffmpeg -i orig_file_name.format -vn conv_file_name.format

Here, -vn flag specifies no video, it will instruct the FFmpeg to skip the video and retrieve only the audio part from the file.

For extracting the images from a media file using FFmpeg, you can follow the below-given syntax:

ffmpeg -i orig_file_name.format -r 1 -f image2 image-%3d.png

Here, -r 1 flag specifies the frame rate (number of frames extracted in 1 second), and -f specifies the format of the output. image2 is the image2 sequence, while %3d is used with the image to give numbers to your extracted images with three digits.

How to Use FFmpeg on Ubuntu 24.04 to Change the Resolution of Video File

If you want to change the resolution of a video file using FFmpeg on Ubuntu, follow the below-given syntax:

ffmpeg -i file_name.format -s 1024x576 conv_res.format

How to Use FFmpeg on Ubuntu 24.04 to Reduce or Compress Media File Size

For reducing or compressing the media file size using FFmpeg, you can follow the below-given syntax:

ffmpeg -i audio_input.mp3 -b:a 192k audio_output.mp3

Here, -b:a 192k is the bit rate, the higher the bit rate is the higher the file size will be.

Conclusion

FFmpeg is a lightweight utility used for converting media files into any format. You can install FFmpeg on Ubuntu 24.04 through the apt package manager, and Snap Store. The apt package manager is recommended because it allows you to install the updated version of FFmpeg on Ubuntu. On the other hand, App Center and Snap Store will install the older version of FFmpeg on Ubuntu. Once you have managed to install FFmpeg on Ubuntu, you can use it to get media information, convert video files, change resolutions, and more. The complete instructions can be followed from the above section of this guide, it will help you start working with media customization on the Ubuntu system.

Print Friendly, PDF & Email
Categories