debian ffmpeg

FFmpeg is a free open source toolset for working with multimedia files. It contains a set of shared audio and video libraries such as libavcodec, libavformat and libavutil. Using FFmpeg, you can convert between various video and audio formats, set sample rates, capture streaming audio/video and resize video.

This article describes how to install and use FFmpeg on Debian 10 Linux.

Installing FFmpeg on Debian

The official Debian repository contains the FFmpeg package, which can be installed using the apt package manager. At the time of writing, the current version of FFmpeg available in the Debian 10 repository is 4.1.4.

The following steps describe how to install FFmpeg on Debian 10, first updating the package list as root or as a user with sudo privileges.

1
sudo apt update

Enter the following command to install the FFmpeg package.

1
sudo apt install ffmpeg

Verify that the installation was successful by printing the FFmpeg version.

1
ffmpeg -version

The output should be similar to the following.

1
2
ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)

To print all available FFmpeg encoders and decoders, the following command can be used.

1
ffmpeg -encoders

FFmpeg is now installed on your system and you can start using it.

The version included in the Debian repository is always behind the latest version of FFmpeg. If you want to install the latest version of FFmpeg, you will need to build the FFmpeg tools from source.

Using FFmpeg

In this section we will present some basic examples on how to use the ffmpeg utility.

Basic conversions

When converting audio and video files with ffmpeg, it is not necessary to specify the input and output formats. Automatically detects the input file format and guesses the output format from the file extension.

To convert video files from mp4 to webm.

1
ffmpeg -i input.mp4 output.webm

Convert audio files from mp3 to ogg.

1
ffmpeg -i input.mp3 output.ogg

Using codecs

When converting files, use the -c option to specify a codec. It can be the name of any supported codec/encoder, or a special value copy that just copies the input stream.

Use the libvpx video codec and the libvorbis audio codec to convert video files from mp4 to webm.

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

Convert audio files from mp3 to ogg encoded using the libopus codec.

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

Conclusion

We have shown you how to install FFmpeg on Debian 10. You can now visit the official FFmpeg documentation and learn how to use FFmpeg to convert video and audio files.