How to Install FFmpeg 5.0 in Ubuntu 20.04 or Ubuntu 18.04 via PPA

Last updated: February 18, 2022 — 6 Comments

The popular FFmpeg multi-media library released version 5.0 recently. Here’s how to install it in Ubuntu 20.04, Ubuntu 18.04 and/or Ubuntu 16.04 via PPA.

FFmpeg 5.0, codename “Lorentz”, is a new major release that features:

  • remove the old encode/decode APIs and replace them with an N:M-based API.
  • new easy to use AVframe-based API for libswscale.
  • remove the entire libavresample library.
  • Many new filters.
  • ADPCM IMA Westwood encoder, Apple Graphics (SMC) encoder, VideoToolbox ProRes encoder
  • ADPCM IMA Acorn Replay decoder, GEM Raster image decoder.
  • DoVi support, and more in ffmpeg.org.

Install FFmpeg 5.0 in Ubuntu:

IMPORTANT: Upgrading FFmpeg is not recommended for beginners! It may conflict with other packages in your system. Use it at your own risk!

Rob Savoury has built the FFmpeg 5.0 packages into PPA for all the current Ubuntu LTS releases. Though the updates is suspend due to lack of donations. The PPA still works, and if you find it’s useful you may help by making donations (see the previous link).

1.) Add the PPAs

Firstly, press Ctrl+Alt+T on keyboard to open a terminal window. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:savoury1/ffmpeg5

Also add the FFmpeg4 PPA which contains the dependency libraries:

sudo add-apt-repository ppa:savoury1/ffmpeg4

2.) Update package cache:

If you’re running Ubuntu 18.04 or Ubuntu 16.04, you need to manually refresh the system package cache by running command:

sudo apt update

3.) Upgrade FFmpeg to 5.0:

Finally, run the command below to install all the available updates including FFmpeg 5:

sudo apt full-upgrade

NOTE: This command may remove some apps on your system due to package conflict! DO CHECK the terminal output before typing ‘y‘ to confirm installation!

When everything’s done successfully, verify via ffmpeg -version command.

How to Restore:

You may purge the two PPAs which also downgrade all the installed packages. Firstly, install the ppa-purge tool via command:

sudo apt install ppa-purge

Then purge the PPAs via the commands below one by one:

sudo ppa-purge ppa:savoury1/ffmpeg5
sudo ppa-purge ppa:savoury1/ffmpeg4

NOTE: The downgrade process may also remove some other apps. Keep an eye on terminal output before performing the action!

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

6 responses to How to Install FFmpeg 5.0 in Ubuntu 20.04 or Ubuntu 18.04 via PPA

  1. Thanks for the guide, but this doesn’t work. There seems to be a missing dependency on:
    “`
    libavcodec59 : Depends: libx264-163 (>= 2:0.163.3060+git5db6aa6) but it is not installable
    “`

    see:

    “`
    $ sudo apt 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: libavcodec59 (= 7:5.0-2ubuntu0~20.04.sav1)
    Depends: libavdevice59 (= 7:5.0-2ubuntu0~20.04.sav1) but it is not going to be installed
    Depends: libavfilter8 (= 7:5.0-2ubuntu0~20.04.sav1)
    Depends: libavformat59 (= 7:5.0-2ubuntu0~20.04.sav1)
    E: Unable to correct problems, you have held broken packages.
    “`
    and more specifically:
    “`
    sudo apt-get install libavcodec59
    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:
    libavcodec59 : Depends: libx264-163 (>= 2:0.163.3060+git5db6aa6) but it is not installable
    E: Unable to correct problems, you have held broken packages.
    “`

    • Gwyneth Llewelyn July 30, 2022 at 10:14 am

      In my case, to make sure I got all the dependencies right, first I uninstalled ffmpeg; then I added Savory’s PPA and installed both ffmpeg4 and ffmpeg5 PPAs, as suggested in this article (as well as on Savory’s own instructions).

      This ensured that there were no ‘dangling dependencies’ around, as seems to be your case.

  2. NOTE FOR ALL: This PPA depends on the FFmpeg 4.4 PPA for building and also install. So do the following steps for successfully installing FFmpeg 5.0:

      sudo add-apt-repository ppa:savoury1/ffmpeg4
      sudo add-apt-repository ppa:savoury1/ffmpeg5
      sudo apt-get update
      sudo apt-get upgrade && sudo apt-get dist-upgrade
      sudo apt-get install ffmpeg

    Read notes at https://launchpad.net/~savoury1/+archive/ubuntu/ffmpeg4 for more information about various multimedia packages that FFmpeg depends on.

  3. @ck: Does not work.
    The following packages have unmet dependencies:
    ffmpeg : Depends: libavcodec59 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    Depends: libavdevice59 (= 7:5.1.3-0ubuntu1~20.04.sav0) but it is not going to be installed
    Depends: libavfilter8 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    Depends: libavformat59 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    E: Unable to correct problems, you have held broken packages.
    u

  4. Raul Guerrero June 6, 2023 at 10:02 pm

    Not working at all
    “The following packages have unmet dependencies:
    ffmpeg : Depends: libavcodec59 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    Depends: libavdevice59 (= 7:5.1.3-0ubuntu1~20.04.sav0) but it is not going to be installed
    Depends: libavfilter8 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    Depends: libavformat59 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    E: Unable to correct problems, you have held broken packages.”

  5. @Gwyneth Llewelyn I did also uninstall ffmpeg and added the ffmpeg4 and ffmpeg5 repositories :
    $ apt policy ffmpeg
    ffmpeg:
    Installed: (none)
    Candidate: 7:5.1.3-0ubuntu1~20.04.sav0
    Version table:
    7:5.1.3-0ubuntu1~20.04.sav0 500
    500 http://ppa.launchpad.net/savoury1/ffmpeg5/ubuntu focal/main amd64 Packages
    7:4.4.4-0ubuntu1~20.04.sav0 500
    500 http://ppa.launchpad.net/savoury1/ffmpeg4/ubuntu focal/main amd64 Packages
    7:4.2.7-0ubuntu0.1 500
    500 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
    500 http://fr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
    7:4.2.2-1ubuntu1 500
    500 http://fr.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

    and then I did the apt upgrade and dist-upgrade steps.

    However, ffmpeg cannot be installed :
    sudo apt install -V ffmpeg
    [sudo] password for sebastien:
    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: libavcodec59 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    Depends: libavdevice59 (= 7:5.1.3-0ubuntu1~20.04.sav0) but it is not going to be installed
    Depends: libavfilter8 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    Depends: libavformat59 (= 7:5.1.3-0ubuntu1~20.04.sav0)
    E: Unable to correct problems, you have held broken packages.

    By re-reading https://launchpad.net/~savoury1/+archive/ubuntu/ffmpeg5 , I noticed that it now says :

    *** Install ***

    FFmpeg builds here depend on the public FFmpeg PPA (ppa:savoury1/ffmpeg4), and the new private FFmpeg PPA (ppa:savoury1/ffmpeg) for installation. Any who have donated can contact me requesting access to the private PPA. Once you have been granted private PPA access do these steps for installation:

    sudo add-apt-repository ppa:savoury1/ffmpeg4
    sudo add-apt-repository ppa:savoury1/ffmpeg5
    sudo apt-get update
    sudo apt-get upgrade && sudo apt-get dist-upgrade
    sudo apt-get install ffmpeg

    I guess us guys need to donate in order to add the new “ppa:savoury1/ffmpeg” private PPA to make this work.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*