Google Cloud Compute Engine

How to Install and Use FFmpeg on Debian 9

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we recommended.

Pinterest LinkedIn Tumblr

How to Install and Use FFmpeg on Debian 9. FFmpeg is a great tool to record, convert and stream audio and video.

This tutorial covers the steps required to install FFmpeg on Debian 9. We will use the ffmpeg command line tool to convert audio, add text to video and many more.

Not using Debian 9? Choose a different OS:

Debian 9

This tutorial is tested on Google Cloud for automatic image and video processing.


A Debian 9 system or server with sudo privileges.

If you are using Google Cloud you need to have some additional requirements fulfilled.

Install FFmpeg on Debian

01. Update the packages before starting.

sudo apt update

02. Install FFmpeg with the following command.

sudo apt install ffmpeg

03. Verify the installation.

ffmpeg -version

The output will be something similar to this.

ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516

Now, FFmpeg is installed successfully and ready to be used.

FFmpeg Examples

In this part, we will look at some basic examples to use the ffmpeg utility.

Basic conversion

While converting the audio and the video files with ffmpeg you don’t need to specify the input and output formats. The input file format is detected automatically and the output format is selected from the file extension.

Convert a video file from webm to mp4

ffmpeg -i input.webm output.mp4

Convert an audio file from ogg to mp3

ffmpeg input.ogg output.mp3

Specifying codecs

You can also specify the codecs you want to use with the -c flag option. The codec can be the name of any supported decoder/encoder or a special value copy which simply copies the input stream.

Convert a video file from webm to mp4 using the libvpx video codec and libvorbis audio codec

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

Convert an audio file from ogg to mp3 encoded with the libopus codec.

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


Now you have learned how to install FFmpeg on your Debian system.

Thanks for your time. If you face any problem or any feedback, just leave a comment below.

1 Comment

  1. Praveen Kumar M Reply

    thanks for the information
    it is very much useful for me

    could u help me to transfer the file in root directory in cloud shell to my google drive or any other cloud drive

    once again thanks for this tutorial

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.