FFmpeg is a free and open-source collection of tools for handling multimedia files. It contains a set of shared audio and video libraries such as libavcodec, libavformat, and libavutil. With FFmpeg, you can convert between various video and audio formats, set sample rates, capture streaming audio/video, and resize videos.
This article describes how to install and use FFmpeg on Debian 10 Linux.
Installing FFmpeg on Debian #
The official Debian repositories contain FFmpeg packages that can be installed with the
apt package manager. At the time of writing this article, the current version of FFmpeg available in the Debian 10 repositories is
The following steps describe how to install FFmpeg on Debian 10:
- Start by updating the packages list as root or user with sudo privileges:
sudo apt update
- Enter the following command to install the FFmpeg package:
sudo apt install ffmpeg
- Verify the FFmpeg installation by printing its version:
ffmpeg -versionThe output should look something like the following:
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’s encoders and decoders you can use:
That’s it. FFmpeg is now installed on your system, and you can start using it.
The version included in the Debian repositories always lags behind the latest version of FFmpeg. If you want to install the latest version of FFmpeg you’ll need to build the FFmpeg tools from source.
Using FFmpeg #
In this section, we will look at some basic examples on how to use the
Basic conversion #
When converting audio and video files with
ffmpeg you do not have to specify the input and output formats. The input file format is auto-detected, and the output format is guessed from the file extension.
- Convert a video file from mp4 to webm:
ffmpeg -i input.mp4 output.webm
- Convert an audio file from mp3 to ogg:
ffmpeg -i input.mp3 output.ogg
Using codecs #
When converting files, use the
-c option to specify the codecs. It can be a name of any supported decoder/encoder or a special value
copy that simply copies the input stream.
- Convert a video file from mp4 to webm using the
libvpxvideo codec and
ffmpeg -i input.mp4 -c:v libvpx -c:a libvorbis output.webm
- Convert an audio file from mp3 to ogg encoded with the
ffmpeg -i input.mp3 -c:a libopus output.ogg
We’ve shown you how to install FFmpeg on Debian 10. You should now visit the official FFmpeg Documentation page and learn how to use FFmpeg to convert and your video and audio files.
If you hit a problem or have feedback, leave a comment below.