Install and Use FFmpeg on Debian 11

In this article, we want to teach you How To Install and Use FFmpeg on Debian 11.

FFmpeg is a collection of different projects for handling multimedia files. It’s often used behind the scenes in many other media-related projects.

It is a great tool for quickly changing an AV file’s format or quality, extracting audio, creating GIFs, and more.

How To Install and Use FFmpeg on Debian 11

To install FFmpeg on Debian 11, you need to log in to your server as a non-root user with sudo privileges. To do this, you can follow our article about the Initial Server Setup with Debian 11.

Now follow the steps below to install FFmpeg.

Installing FFmpeg on Debian 11

FFmpeg packages are available in the default Debian repository. First, update and upgrade your local package index with the following command:

sudo apt update && sudo apt upgrade

Then, you can use the following command to install FFmpeg:

sudo apt install ffmpeg

When your installation is completed, you can verify it by checking the FFmpeg version:

ffmpeg -version

In your output you will see:

Output
ffmpeg version 4.3.3-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)

The version of your FFmpeg on Debian 11 may be different as shown above.

You can see the FFmpeg’s encoders type with the following command:

ffmpeg -encoders
Output
Encoders:
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
------
V..... a64multi Multicolor charset for Commodore 64 (codec a64_multi)
V..... a64multi5 Multicolor charset for Commodore 64, extended with 5th color (colram) (codec a64_multi5)
V..... alias_pix Alias/Wavefront PIX image
...

Also, you can list the available FFmpeg decoders type with the following command:

ffmpeg -decoders
Output
Decoders:
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
------
V....D 012v Uncompressed 4:2:2 10-bit
V....D 4xm 4X Movie
...

Here you have FFmpeg installed on Debian 11. Now you can start using it.

Using FFmpeg on Debian 11

At this point, we will show you how to use FFmpeg on Debian 11 with some basic examples. The basic syntax of the FFmpeg command is like this:

ffmpeg [global_options] {[input_file_options] -i input_url} …{[output_file_options] output_url} …

You don’t have to specify the input and output formats when you are converting the audio and video files with FFmpeg on Debian 11.

For example, to convert a video file from mp4 to webm you can use the following command:

ffmpeg -i input.mp4 output.webm

And to convert an audio file from mp3 to ogg you can use the following command:

ffmpeg -i input.mp3 output.ogg

Also, you can use the –c parameter to specify the codecs when you are converting the files.

For example, you can convert a video file from mp4 to webm using the libvpx video codec and the libvorbis audio codec:

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

And to convert an audio file mp3 to ogg encoded with the libopus codec, you can use the following command:

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

More often than you’d like, the file you have is partially correct with only a single stream in the wrong format. It can be very time-consuming to re-encode the correct stream. FFmpeg can help with this situation, run the following command on Debian 11:

ffmpeg -i input.webm -c:v copy -c:a flac output.mkv

For more details and information about the FFmpeg, you can visit the official FFmpeg documentation page.

Conclusion

FFmpeg is a great library to have in your video processing and compression toolbox.

Hope you enjoy this article about How To Install and Use FFmpeg on Debian 11.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular