• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install FFmpeg on Ubuntu 18.04 & 16.04

Written by Rahul, Updated on March 12, 2020

FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. It’s also useful to convert multimedia files between various formats. FFmpeg includes libavcodec audio/video codec library in it.

install ffmpeg on Ubuntu

This tutorial will help you to install FFmpeg on Ubuntu 18.04 LTS & 16.04 LTS systems with easy steps.

Step 1 – Setup FFmpeg PPA

FFmpeg 4 is the latest available version for installation on Ubuntu. To install the latest version, you need to configure PPA on your system. Execute below command to add FFmpeg PPA on Ubuntu system.

sudo add-apt-repository ppa:jonathonf/ffmpeg-4

This PPA contains packages for Ubuntu 18.04 (Bionic) and 16.04 LTS (Xenial) only.

Step 2 – Install FFmpeg on Ubuntu

After enabling the PPA, Lets exec below commands to install ffmpeg on Ubuntu system. This will also install many packages for the dependencies.

sudo apt-get update
sudo apt-get install ffmpeg

Step 3 – Check FFmpeg Version

After successfully install FFmpeg, let’s check the version installed on the system.

ffmpeg -version

ffmpeg version 4.2.2-0york0~16.04 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609
...

Step 4 – FFmpeg Basic Commands

Here is the list of the FFmpeg basic command options used with FFmpeg command-line tool.

FFmpeg command examples
    ffmpeg -version: show version ffmpeg -formats: show available formats ffmpeg -codecs: show available codecs ffmpeg -decoders: show available decoders ffmpeg -encoders: show available encoders ffmpeg -bsfs: show available bit stream filters ffmpeg -protocols: show available protocols ffmpeg -filters: show available filters ffmpeg -pix_fmts: show available pixel formats ffmpeg -layouts: show standard channel layouts ffmpeg -sample_fmts: show available audio sample formats

Click here to read more about ffmpeg on its official site.

Step 5 – Basic Examples

Below are some examples of uses of ffmpeg command line.

Reduce .mov File Size:

ffmpeg -i in.mov -c:v libx264 -c:a copy -crf 20 out.mov

Convert .move To .mp4

ffmpeg -i in.mov -vcodec copy -acodec aac -strict experimental -ab 128k out.mp4

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

8 Comments

  1. Avatar Shane Reply
    August 15, 2018 at 7:16 am

    just change the /etc/apt/sources.list.d for the ppa:jonathonf/ffmpeg-4 to xenial within the .list file and list.save file. you may need to obtain the gpg key again, google: “checkaptgpg .deb” its from mx-linux, it’s a fantastic script for filling in missing repository keys within ubuntu, etc.

  2. Avatar Bill Reply
    June 27, 2018 at 3:59 am

    Even ppa:jonathonf/ffmpeg-4 doesn’t work on 18.04

  3. Avatar seerak Reply
    June 10, 2018 at 5:30 am

    This is broken now for ubuntu 18.04

    E: Package ‘libav-tools’ has no installation candidate

  4. Avatar Jamshid Reply
    May 28, 2016 at 5:32 am

    If you don’t necessarily need ffmpeg, and aconv will do (e.g. for youtube-dl), you can install aconv on CentOS7 using http://thelinuxfaq.com/258-how-to-install-avconv-on-centos-rhel-7-6.

  5. Avatar Hitesh Reply
    December 2, 2014 at 12:29 pm

    Hi ,

    I have tried above steps successfully done everything , I am able to check FFMPEG verion and basic command as well but when I check when I am checking the extension ” extension_loaded(‘ffmpeg’) or die(‘Error in loading ffmpeg’);” — it throws error “Error in loading ffmpeg” .

    Also I tried checking “phpinfo();” , but it does not shows that ffmpeg is installed. What else I need to do to configure FFMPEG in cent OS 6.5 , PHP 5.5 .

    Question : http://stackoverflow.com/questions/27226157/how-to-setup-ffmpeg-for-centos-release-6-5-server

  6. Avatar someone Reply
    October 10, 2014 at 12:27 am

    Dear sysadmin

    Thank you very much, i tried a lot of site to install the new ffmpeg those code were not working, maybe old or mine had problem.
    but this code you posted i tried this and it worked the new ffmpeg install to my vps.
    thanks for your help

  7. Avatar sysadmin Reply
    October 3, 2014 at 12:35 pm

    I finally found a solution which allows to install ffmpeg in Centos 7:

    1. wget ftp://rpmfind.net/linux/centos/6.5/os/x86_64/Packages/libdc1394-2.1.2-3.4.el6.x86_64.rpm
    2. yum -y localinstall libdc1394-2.1.2-3.4.el6.x86_64.rpm
    3. rpm -ivh http://dl.atrpms.net/el7-x86_64/atrpms/stable/atrpms-repo-7-7.el7.x86_64.rpm
    4. yum -y install ffmpeg

    I hope it will help somebody.

    • Avatar srinath Reply
      January 26, 2016 at 8:32 am

      @sysadmin thank you. Now I am compiling all the things to install. Installing the 6.5 version is not affecting?

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How To Install Python 3.9 on Ubuntu 18.04 0
  • How to Use AppImage on Linux (Beginner Guide) 2
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy