How to Install FFmpeg on Debian 9

Table of Contents
Install FFmpeg on Debian 9
FFmpeg is one the free and open source cross-platform solution for converting, recording and streaming media. FFmpeg is also used for converting media files to different formats, resize video, change sample rates for video and audio files. In this tutorial, you are going to learn how to install FFmpeg on Debian 9.
In this tutorial we will install FFmpeg in the following two ways:
- Install FFmpeg 4 using External Repository. (recommended)
- Install FFmpeg 3 using Debian Repository.
Prerequisites
Before you start to install FFmpeg on Debian 9. You must have a non-root user account on your server with sudo privileges.
Here we are going to use add-apt-repository
command so to install this command type:
sudo apt install software-properties-common
Method 1: Install FFmpeg 4 using External Repository
After every three months, a new version of FFmpeg comes with new features and bug fixes. Here in this method, we are going to install the current latest version (at the time of writing this article) FFmpeg 4.x version on Debian 9. Follow below instructions to install FFmpeg.
Update the apt package manager using the following command:
sudo apt update
Now add JonathanF’s ffmpeg-4
repository to your Debian system by using below command:
sudo add-apt-repository ppa:jonathonf/ffmpeg-4
Now you are ready to install FFmpeg-4 on Debian, Type following command to install FFmpeg:
sudo apt install ffmpeg
Confirm the installation and check FFmpeg version typing below command:
ffmpeg -version
The output should be:
ffmpeg version 4.1.1-1~deb9u1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7.0.0 (Debian 7.0.0-18+deb9u1) 20170516
Method 2: Install FFmpeg 3 using Debian Repository
Use the following instructions to install FFmpeg using Debian Repository.
First, Update the apt
package manager index typing following command:
sudo apt update
To install FFmpeg type following command in the terminal:
sudo apt install ffmpeg
Confirm the installation and check FFmpeg version typing below command:
ffmpeg -version
The output should be:
ffmpeg version 3.4.4-1~deb9u1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7.0.0 (Debian 7.0.0-18+deb9u1) 20170516
Basic FFmpeg Examples
Below are some basic examples to use FFmpeg:
To check the media file information run following command:
ffmpeg -i filename.mp3
To convert an audio .amr
file to .mp3
run the following command:
ffmpeg -i filename1.amr filename2.mp3
Similarly, you can convert video file like to convert .mp4
file to avi
run below command:
ffmpeg -i inputvideo.mp4 outputvideo.mkv
You can also remove the audio stream from the video file using below command:
ffmpeg -i inputvideo.mp4 -vn outputaudio.mp3
Conclusion
You have successfully learned how to install FFmpeg on Debian 9. If you have any queries please don’t forget to comment out.
LATEST POSTS
-
How to Install CMake on Linux Mint 19
-
How to Install Opera Browser on Debian 10
-
How to Setup UFW firewall on Debian 9
-
How to Set Up Cron Job on CentOS 7
-
How to install Skype on Ubuntu 18.04
-
How to install Nginx on Ubuntu 18.04
-
How to Install IntelliJ IDEA IDE on Fedora 29
-
How to install LEMP Stack on Ubuntu 18.04
-
How to Install phpMyAdmin on Linux Mint 19
-
How to grep All Sub-Directories for Files
-
Chown Command in Linux
-
Secure Apache with Let’s Encrypt SSL on CentOS 7