How to install FFmpeg on Debian?

36

18

I would like to know how to install FFmpeg on Debian.

dksystem

Posted 2011-05-21T13:32:14.220

Reputation:

I arrived here wondering about installing ffmpeg on my Raspberry Pi (XBian, Raspbian),but now I see that Debian itself has the issue. – palswim – 2016-08-24T18:21:11.190

1

Similar guide for Ubuntu: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

– slhck – 2012-07-17T12:19:34.933

Answers

69

Current Debian (starting from stretch and also in jessie-backports) includes an ffmpeg package:

sudo apt-get update
sudo apt-get install ffmpeg

However, this version of ffmpeg not always be up-to-date. If you want a more recent version, you have 3 options for installing ffmpeg. I'd suggest trying options 1 or 2 before installing from source.

Option 1: Use the static build

Download a static build from this website:

http://johnvansickle.com/ffmpeg/

Place the binaries in /usr/local/bin and you're ready to go.

Option 2: Install ffmpeg from deb-multimedia.org

To install ffmpeg, edit /etc/apt/sources.list and add the appropriate line for your distribution as listed here: http://www.deb-multimedia.org/

To add debian testing, either manually edit the file or run..

Example for debian testing only:

sudo echo deb http://www.deb-multimedia.org testing main non-free \
                  >>/etc/apt/sources.list

After adding the line for deb-multimedia, update the package, add the keyring, and install ffmpeg.

sudo apt-get update
sudo apt-get install deb-multimedia-keyring
sudo apt-get update
sudo apt-get install ffmpeg

You will have to install the keyring as an unauthenticated package using this method.

Option 2: Install ffmpeg from source

Alternatively, you can install from source. This is how to create a .deb file using checkinstall which can then be uninstalled again. Install these packages, yasm or nasm is needed for ffmpeg specifically, the others are generally useful for building packages:

sudo apt-get install yasm nasm \
                build-essential automake autoconf \
                libtool pkg-config libcurl4-openssl-dev \
                intltool libxml2-dev libgtk2.0-dev \
                libnotify-dev libglib2.0-dev libevent-dev \
                checkinstall

Next, clone the ffmpeg package or download the latest snapshot:

git clone git://git.videolan.org/ffmpeg.git

or

wget https://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar jxvf ffmpeg-snapshot.tar.bz2

Compile ffmpeg:

cd ffmpeg
./configure --prefix=/usr
time make -j 8
cat RELEASE
sudo checkinstall

Most of the checkinstall defaults are fine, but a version number is required. The current version is displayed by "cat RELEASE". This should create a deb file in the current directory.

Finally, install the deb file you made using dpkg:

sudo dpkg --install ffmpeg_*.deb

nathan

Posted 2011-05-21T13:32:14.220

Reputation: 843

2+10 points. This answer should be up the top, as it's the most current. – Mint – 2015-05-10T23:58:30.667

2Sadly, avconv which comes with Jessie often cannot replace ffmpeg as it lacks many important features of ffmpeg. So if you want to avoid installing from source the only valid option is to get it from deb-multimedia, which is a bit sad as the deb-multimedia-keyring is not distributed by Debain, so the trust chain is broken. – Tino – 2015-10-03T19:43:33.660

2

they have switched back to ffmpeg in sid now: https://lwn.net/Articles/650495/

– Sam Watkins – 2015-10-29T16:25:02.700

1Your from-source instructions work on Debian Jessie (from master 4c2244127631da592cb4d6bbdab1d6b050ff98cb). However, the checkinstall procedure seems to have changed. I had to run sudo mkdir /usr/share/ffmpeg first to avoid it aborting. Then after successful run, it automatically installed the packages itself, so there is no need to run sudo dpkg -i. Otherwise fine. – 0__ – 2016-04-11T18:35:00.960

There is no deb package to be installed ,in the last step just do sudo make install. – it_is_a_literature – 2017-09-21T04:28:00.067

One should use apt-get update -oAcquire::AllowInsecureRepositories=true instead of sudo apt-get update otherwise you won't be able to install deb-multimedia-keyring when downloading from deb-multimedia.org. You just need this once. – TCB13 – 2019-01-17T11:36:01.693

26

It is now available for Jessy as a backport: https://packages.debian.org/jessie-backports/ffmpeg

Add something like this to /etc/apt/sources.list (with your preferred mirror):

deb http://ftp.uk.debian.org/debian jessie-backports main

Then

apt-get update
apt-get install ffmpeg

Dan

Posted 2011-05-21T13:32:14.220

Reputation: 795

Nice. I'm creating a Docker image, and it's already pretty complex. This method is the cleanest possible. – gustavohenke – 2016-09-03T20:10:12.730

4cheers, this works great and is the most current answer. just posting the debian 8 jessy message so others can find this Googling `Package ffmpeg is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'ffmpeg' has no installation candidate` – georgiecasey – 2016-10-10T23:24:22.550

8

You can install it via apt-get. If the package is simply called "ffmpeg".

sudo apt-get update
sudo apt-get install ffmpeg

If that doesn't work, you can try searching for it:

sudo apt-cache search ffmpeg

Note that this will install the packaged version of FFmpeg, therefore it will always be a little outdated. In case you experience bugs, please compile FFmpeg from source.

Bandit

Posted 2011-05-21T13:32:14.220

Reputation: 790

7

FFMPEG uses git so you will need to use the terminal. See here for the current location

There's a pretty comprehensive walkthrough on doing it here. Have extracted pertinent code for the lazy (myself included).

One thing to note, you may get some errors when configuring that you are missing packages. I needed to use RPM to get a couple of them when running Fedora 14 but your mileage may vary on Debian.

Checkout FFmpeg:

git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg

Configure [add your own preferences if you want]

./configure

Build and install

make
sudo make install

James

Posted 2011-05-21T13:32:14.220

Reputation: 1 185

3

static builds (works)

Go to this page and pick the build for your architecture:

http://johnvansickle.com/ffmpeg/

Grab the url to the build file

# download it
wget <url>
# unpack it
tar xf <file>

# add path to $PATH
vi ~/.bashrc

# add the path to your unpacked build
export PATH="~/src/ffmpeg-2.8.3-src:$PATH"

# source your bashrc to update your path
. ~/.bashrc

chovy

Posted 2011-05-21T13:32:14.220

Reputation: 1 017

pretty common knowledge bash here. but i added some comments – chovy – 2015-12-02T02:22:34.940

You can use ~/bin or /usr/local/bin instead of ~/src and not need to mess around with the PATH. (For ~/bin you will need to re-login or run source ~/.profile however). – llogan – 2017-11-18T17:59:18.473

or just ln -s /unpacked/ffmpeg /usr/bin/ffmpeg – Hayden Thring – 2018-01-23T20:39:49.437

1

I downloaded the latest snapshot of ffmpeg from here http://ffmpeg.org/download.html. Then I followed Kdenlive's ffmpeg build instructions http://www.kdenlive.org – but run

sudo apt-get update

before installing dependencies. They are:

sudo apt-get install subversion git cmake build-essential yasm libqt4-dev kdelibs5-dev libsdl1.2-dev libsdl-image1.2-dev libxml2-dev libx264-dev libtheora-dev libxvidcore-dev libogg-dev libvorbis-dev libschroedinger-dev libmp3lame-dev libfaac-dev libfaad-dev libgsm1-dev libopencore-amrnb-dev libopencore-amrwb-dev libsamplerate0-dev libjack-dev libsox-dev ladspa-sdk swh-plugins libmad0-dev libpango1.0-dev

mozerella

Posted 2011-05-21T13:32:14.220

Reputation: 43

0

This is what I did by nov-2017:

 apt-get update
 apt-get install libav-tools


#List all plugins associated with ffmpeg
apt-cache search ffmpeg 

#cmus-plugin-ffmpeg - lightweight ncurses audio player (FFmpeg plugin)
apt-get install -y cmus

#ffmpeg2theora - Theora video encoder using ffmpeg
apt-get install -y ffmpeg2theora

#ffmpegthumbnailer - fast and lightweight video thumbnailer
apt-get install -y ffmpegthumbnailer

#ffmpegthumbnailer-dbg - debugging informations for ffmpegthumbnailer
apt-get install -y ffmpegthumbnailer-dbg

#libffmpegthumbnailer-dev - development files for ffmpegthumbnailer
apt-get install -y libffmpegthumbnailer-dev

#libffmpegthumbnailer4 - shared library for ffmpegthumbnailer
apt-get install -y libffmpegthumbnailer4

#ffmpegthumbs - video thumbnail generator using ffmpeg
apt-get install -y ffmpegthumbs

#libffms2-3 - Cross platform ffmpeg wrapper library
apt-get install -y libffms2-3

#gmerlin-encoders-ffmpeg - ffmpeg encoders for Gmerlin
apt-get install -y gmerlin-encoders-ffmpeg

#libpostproc-dev - FFmpeg derived postprocessing library - development headers
apt-get install -y libpostproc-dev

#libpostproc52 - FFmpeg derived postprocessing library
apt-get install -y libpostproc52

#moc-ffmpeg-plugin - ncurses based console audio player - ffmpeg plugin
apt-get install -y moc-ffmpeg-plugin

#libtaoframework-ffmpeg-cil-dev - Tao CLI binding for FFmpeg - development files
apt-get install -y libtaoframework-ffmpeg-cil-dev

#libtaoframework-ffmpeg0.4-cil - Tao CLI binding for FFmpeg
apt-get install -y libtaoframework-ffmpeg0.4-cil

#winff - graphical video and audio batch converter using ffmpeg or avconv
apt-get install -y winff

#libxine2-ffmpeg - MPEG-related plugins for libxine2
apt-get install -y libxine2-ffmpeg

zwitterion

Posted 2011-05-21T13:32:14.220

Reputation: 185

For Jessie oldstable and older libav-tools refers to tools offered by the fork Libav, not FFmpeg. One of those tools was called "ffmpeg" (now dead and gone upstream) but it's not the ffmpeg from FFmpeg. For newer Debian libav-tools is a transitional package and you can just use the ffmpeg package instead. – llogan – 2017-11-17T18:05:14.550

-1

This repository gives you the package:

sudo add-apt-repository ppa:mc3man/trusty-media

Then

sudo apt-get update
sudo apt-get install ffmpeg

Németh Zsigmond

Posted 2011-05-21T13:32:14.220

Reputation: 1

1That's specifically for Ubuntu 14.04. – llogan – 2016-06-24T17:45:45.407

-1

I see this is a pretty old thread but since I just ran across it I will try to add some clarity. I used a combination of answers already stated to get ffmpeg installed. I edited the /etc/apt/sources.list adding deb http://ftp.uk.debian.org/debian jessie-backports main. Then apt-get update. Then apt-get install ffmpeg.

That worked for me.

TomH

Posted 2011-05-21T13:32:14.220

Reputation: 1

Welcome to [su]! This is a useful comment, but not really an answer. Once you have enough rep, you'll be able to leave comments on the exsiting answers or question, instead of adding non-answers. – jpaugh – 2017-06-07T23:18:53.530