How do I install ffmpeg on Debian Jessie?

My installation of Debian Jessie is seemingly doing everything it can to prevent me from installing ffmpeg.

I have read How to install FFmpeg on Debian?, but avconv is not an option and adding deb http://www.deb-multimedia.org stable main non-free to my sources.list didn't really help. I did apt-get install libav-tools, thinking it would get rid of ffmpeg's dependency problems.

Here's what trying to install ffmpeg gets me now:

    $ sudo apt-get install ffmpeg
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ffmpeg : Depends: libavcodec56 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavdevice56 (>= 10:2.6.8) but it is not going to be installed
          Depends: libavfilter5 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavformat56 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavresample2 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavutil54 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libpostproc53 (>= 10:2.6.8) but it is not going to be installed
          Depends: libswresample1 (>= 10:2.6.8) but it is not going to be installed
          Depends: libswscale3 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
E: Unable to correct problems, you have held broken packages.

What is apt-get trying to tell me and how do I get rid of this problem?


Try using aptitude to install it because it will give you possible solutions. Just make sure you look over each one carefully.

sudo aptitude install ffmpeg

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

Fix broken package

sudo apt-get install -f

Add the following lines to /etc/apt/sources.list

deb http://www.deb-multimedia.org jessie main non-free
deb-src http://www.deb-multimedia.org jessie main non-free

Update:

apt-get update

Add the key

apt-get install deb-multimedia-keyring

update

apt-get update

Remove ffmpeg Debian packge

apt-get remove ffmpeg

As root Install library packages and build tools:

apt-get install build-essential libmp3lame-dev libvorbis-dev libtheora-dev libspeex-dev yasm pkg-config libfaac-dev libopenjpeg-dev libx264-dev

Download the latest ffmpeg from here

wget https://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2

Extract it

tar xvjf ffmpeg-3.0.2.tar.bz2

Move into the directory

cd ffmpeg-3.0.2

Configure, build and install:

./configure --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-libfaac --enable-nonfree
make -j 16
sudo make install