Install FFmpeg Ubuntu
What is FFmpeg?
FFmpeg is an open-source and free software project composed of a suite of programs and libraries to handle audio, video, and other multimedia streams and files. At its core is a command-line tool itself, i.e., ffmpeg, designed to process audio and video files. It's widely used for video scaling, basic editing (concatenation and trimming), format transcoding, video post-production standards, and effects compliance (ITU, SMPTE).
Also, FFmpeg includes some other tools like ffplay, which is a normal media player, and ffprobe, which is a tool of command-line to show media information. Between added libraries are libavcodec, a video/audio codec library used by several free and commercial software products, libavformat, a video/audio demux library, and container mux, and libavfilter, a library to enhance and edit filters from a Gstreamer-like filtergraph.
It is a segment of the workflow of several other software projects and all libraries are a core segment of software media players like VLC and it has been added in core processing for BiliBili and YouTube. Decoders and encoders for several video and audio file formats are added, making it very helpful for the transcoding of uncommon and common media files. FFmpeg is released under the GPL-2.0 or later or LGPL-2.1 or later, relying on which option is enabled.
History of FFmpeg
This project was begun by Fabrice Bellard in 2000 and was directed by Michael Niedermayer from 2004 to 2015. Also, a few developers of FFmpeg were a part of the project of MPlayer.
The project name is derived by the MPEG video standards group, well-synced with "FF" which stands for "Fast Forward". Its logo applies a zigzag pattern that displays how the video codec of MPEG manages entropy encoding.
Two employees of Google announced that 1000+ bugs had been solved in FFmpeg during the past two years by fuzz testing in 2014 January 10.
A command-line program, i.e., ffserver, a long-time element of FFmpeg, was deleted in 2018 January. Previously, the developers had deprecated this program citing much maintenance efforts because of its internal application programming interfaces usage.
The project releases a new version every three months. While published versions are present for download from the website. The developers of FFmpeg suggest that users use the software using the source with the current build from the source code GIT version control system.
History of Codec
Two formats of video coding with related codecs and one format of the container have been developed in the FFmpeg project. These two codecs of video are the lossless FFV1, and the lossy Snow and lossless codec. Snow development has been delayed, while its format of bit-stream hasn't been yet finalized, making it experimental from 2011. The format of the multimedia container, which is known as NUT, is not being developed actively but is still organized.
The developers of FFmpeg, David Conrad, Ronald Bultje, Fiona Glazer, announced the decoder of ffvp8 in 2010 summer. They decided through testing that ffvp8 was quick as compared to the libvpx decoder of Google. Beginning with the 0.6 version, FFmpeg also supported VP8 and WebM.
Components of FFmpeg
Tools of Command-line
Libraries of FFmpeg
Supported hardware of FFmpeg
FFmpeg envelopes software implementations of audio and video decompressing and compressing algorithms. These could be compiled and executed on diverse sets of instruction. Several widespread sets of instruction are offered by FFmpeg, including MIPS, SPARC, DEC Alpha, ARM, PPC PowerPC and, x86 (x86-64 and IA-32).
Unique purpose hardware
There is a range of application-specific integrated circuits (short for ASIC) for video/audio decompression and compression. These can completely or partially e offload the computation process through the host CPU. Rather than a full implementation of the algorithms, the API is only needed to use like an ASIC.
Apply with the FFmpeg utility
The acceleration decoding of the internal hardware is activated from the option, i.e., -hwaccel. Normally, it begins decoding, but when a decodable stream is found in hardware, the decoder creates every significant processing for that hardware, hence accelerating the process of decoding.
Hardware acceleration would be skipped and it will be still decoded in software, whereas when no decodable streams are found (as happens on an unsupported profile for codec). The option, i.e., -hwaccel_device is used when the hardware needs a specific device for functioning especially if there are various graphic cards are exist.
Supported formats and codecs
FFmpeg provides its support for a few uncommon and several common image formats. The image format, i.e., PGMYUV is a homebrew version of the binary (P5) PGM Netpbm format. Also, it supports PPM and PGM 16-bit depth formats, and the binary (P7) PAM format without or with alpha channel, depth 16 bit or 8 bit for pix_fmts rgb64be, rgba, ya8, rgb48be, rgb24, gray16be, gray, monob.
The resulting formats (many container formats and other ways to create result streams) in FFmpeg are known as "muxers". Some of the muxers which are supported by FFmpeg are listed below:
FFmpeg provides its support for several pixel formats. A few of these formats are supported as many input formats only. It doesn't support Log RGB, RGBE, CYMK, AI44, IMC1-IMC4, and other formats. Also, it doesn't yet support ARGB 2:10:10:10, 1:5:5:5, or other formats of BMP bitfield that aren't used commonly.
Supported Protocols of FFmpeg
De facto standards
Supported interfaces and media
FFmpeg supports the below devices by external libraries:
Screen output and capture
Supported Filter of FFmpeg
FFmpeg supports the following filters:
Supported test patterns
Supported LUT formats
Applications of FFmpeg
FFmpeg includes 100+ codecs, almost all of which apply compression methods of one type or another. several such compression methods might be subject to legal claims corresponding to software patents. These claims might be enforceable in some countries such as the United States which have achieved software patents but are examined void or unenforceable in some European Union member countries.
Patents for several older codecs, like all MPEG-2 and MPEG-1 codecs and AC3, have concluded. FFmpeg is licensed upon the LGPL license, however, if a specific FFmpeg build is connected against a GPL library, then the whole binary is licensed upon the GPL.
Projects with FFmpeg
FFmpeg is applied by FFmpeglnterop, OpenMAX IL, Perian, and Gstreamer FFmpeg plug-in for expanding the decoding and encoding capabilities of the corresponding multimedia platform.
FFmpeg is applied by software like MPC-HC, VirtualDub fork, VirtualDub2, YouTube, HandBrake, Blender, Kodi, Plex, Cinelerra-GG video editor, Shotcut, xine, and VLC media player. It manages audio and video playback media in Google Chrome and the Firefox Linux version. For FFmpeg, graphical user interface front-ends have been integrated, with XMedia Recode.
As a part of the Mars 2020 mission of NASA, FFmpeg is applied by Perseverance rover over Mars for video and Image compression before being transferred back to earth.
How we can install FFmpeg in Ubuntu?
FFmpeg is an open-source and free tool of command-line to transcode multimedia files. It includes a group of shared video and audio libraries like libavutil, libavformat, and libavcodec. We can convert between several video and audio formats, resize videos, and set sample rates with FFmpeg.
It is a very famous software project, which is a group of libraries and programs that are used for handling video and audio file conversion, recording other files of multimedia, and streams as well. It's a toolbox present in the command line for converting, streaming, and manipulating multimedia content.
In this article, we will explain how we can install FFmpeg in the 20.04 version of Ubuntu.
There are several days for installing FFmpeg in the 20.04 version of Ubuntu, like installing it using the official package repository of Ubuntu, using the source, and using the snap store.
The most convenient and easiest way for installing the stable FFmpeg version is to install it using the package manager of APT.
We are going to install the 4.2.4 version of and FFmpeg and it's available on the APT package repository of Ubuntu.
1. We need to first update the APT cache repository of the system for installing it. The command is mentioned below to update the system:
2. After updating the APT cache repository of the system, we can install the FFmpeg software with the help of a command which is mentioned below:
3. It might ask to take extra disk space for the installation process, we need to type "y" and click on the Enter button.
4. FFmpeg is now installed on our 20.04 LTS version of Ubuntu.
5. The next thing we should do is to check the FFmpeg version with the help of the command after approving its installation. The command is mentioned below:
Print/see Decoders and Encoders
We need to enter the following command in the terminal window to print/see decoders and encoders available in FFmpeg:
FFmpeg is perfectly working and installed on our system. Let's try some other tasks such as extracting the information of the file, audio using a video file, and converting an audio or video file to other formats.
Extracting the File Info
We can use the following command in the terminal Window for or getting every information of any media file in the 20.04 LTS version of the Ubuntu system with FFmpeg:
Make sure to substitute the "audio_file_mp3" with our video or audio file name. We can obtain the information of a video file with the help of the same command which is mentioned above.
Extracting Audio using a Video File
We can use the following command in the terminal window for extracting the audio using any video file with ffmpeg:
We can obtain the audio using any video file with the help of the above command. We need to substitute the "video_file_mp4" with the name of our video file, and later give the name of a new audio file that we are about to extract.
Converting any Media File to Other Formats
If we wish to convert our video or audio file to another format of our requirement, we can do so by entering the following command in the terminal window. For instance, to convert a video (MP4 format), WEBM format, let's say.
It is how we can convert our media files to other file formats.
The command would be similar to the above to convert an audio file to any other format. We need to first give the name of the file to which we wish to convert and after that give the new name of that file with the file format.