This brief tutorial shows students and new users how to install the FFmpeg tool on Ubuntu 20.04 | 18.04.
FFmpeg is a free, open-source, cross-platform multimedia framework that anyone can use to record, convert, and stream audio and video online or via any application.
It contains libraries like libavcodec, libavutil, libavformat, libavfilter, libavdevice, libswscale, libswresample, and others.
Applications and other tools can use FFmpeg libraries for transcoding and playing multimedia files, providing the best technically possible solution.
For more about FFmpeg, please visit its homepage.
When you’re ready to install FFmpeg, follow the steps below:
Install FFmpeg on Ubuntu
FFmpeg comes via Ubuntu’s official repositories. It can be installed via Ubuntu default package manager, apt.
This is the easiest way to install FFmpeg on Ubuntu. However, the version included in the repositories may not be the latest.
When writing this article, the current version of FFmpeg available in the Ubuntu 18.04 | 16.04 repositories is 3.4.6.
The current latest version from the FFmpeg website is version 4.2.2.
To install the stable version that comes in Ubuntu default repositories, simply run the commands below:
sudo apt update sudo apt install ffmpeg
Use the FFmpeg- version command to validate that the package is installed and working correctly.
ffmpeg -version
The command above should output something similar to the lines below:
Output: ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
That’s it.
FFmpeg stable version is now installed on your system, and you can start using it.
Installing FFmpeg via Repository
You may want to add a third-party PPA repository to get the latest version of FFmpeg, which includes several new filters, encoders, and decoders.
To do that, simply run the commands below:
sudo apt install software-properties-common sudo add-apt-repository --yes ppa:jonathonf/ffmpeg-4 sudo apt update sudo apt install ffmpeg
To verify if FFmpeg is installed, run the commands below:
ffmpeg -version
It should output similar lines as shown below:
Output: ffmpeg version 4.2.2-0york0~18.04 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened
That’s what you install via a third-party PPA.
Install via Snap
The snappy packaging system is the easiest way to install FFmpeg latest on Ubuntu.
Snaps are applications packaged with dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.
First, run the commands below to install the snap package manager and then install FFmpeg.
sudo apt update sudo apt install snapd sudo snap install ffmpeg
After installing, use the command to verify the FFmpeg version.
This is how one installs FFmpeg on Ubuntu.
Use FFmpeg
After installing FFmpeg, you can convert multimedia files to different formats.
For example, simply run the commands below to convert from mp4 format to WebM.
ffmpeg -i input.mp4 output.webm
To convert an audio file from MP3 to Ogg, run the commands below:
ffmpeg -i input.mp3 output.ogg
There are more examples on the developer’s site. Go there and learn how to use FFmpeg.
Conclusion:
- FFmpeg is a powerful multimedia framework that enables easy recording, converting, and streaming of audio and video.
- Installation on Ubuntu can be done via official repositories, third-party PPAs, or the Snap package manager, catering to different user needs.
- Each installation method offers access to varying versions of FFmpeg, ensuring users can choose based on their requirements.
- Once installed, FFmpeg allows for versatile multimedia file conversion between various formats, enhancing media handling capabilities.
- For more advanced usage and functionalities, users are encouraged to explore the FFmpeg documentation and community resources.
Leave a Reply to TL Cancel reply