Install FFmpeg with dependencies on Ubuntu

By on July 11th, 2020

FFmpeg is an open-source, free software project with a wide variety of libraries and programs to handle multimedia data. The FFmpeg includes a libavcodec, libavformat, and a command-line program for the multimedia files transcode. The libavcodec is an audio/video codec library, and the libavformat is an audio or video container demux and mux library.

The MPlayer is an open-source, free, multi-platform media player software. The MPlayer supports a wide variety of media formats that are supported by the FFmpeg libraries. It can also save all the streamed content into a local file. The MEncoder is a companion program of MPlayer that can convert the input stream and files into several different formats with the help of the transcode. The MEncoder is a free command-line transcoding tool that can convert all the supported formats of MPlayer into a variety of uncompressed and compressed formats with the help of different codecs.

The MP4Box is an open-source multimedia packager that helps to perform manipulations of multimedia files, such as MPG, TS, AVI, ISO media files, and more. Manipulation means adding and removing the files. It helps to multiplex audio and video, and also helps to present data from a source format to another format. The MP4Box offers the encoding and decoding of the presentation languages into or from binary formats, such as LASeR or MPEG-4 BIFS. This tool also offers encryption of streams. The MP4Box helps to repack the existing content into a compliant ISO media file formats, such as MP4, 3GP, 3G2, and OMA DCF.

The FLVTool2 is an open-source manipulation tool for video files, mainly the Macromedia Flash Video files (FLV), and this tool calculates the metadata of a file and then inserts an on-Metadata tag to the same. The output of the print command in this tool gets saved in either YAML or XML format. Some of the features offered by the FLVTool2 are directory recursion, batch processing, command chaining, FLV file cutting, and more.

In this knowledgebase, you learn how to install the FFmpeg, MPlayer, MEncoder, MP4Box, and FLVTool2 on your Ubuntu server.

Install FFmpeg

Before the installation of FFmpeg, the ‘rpmforge’ should be up-to-date. To install FFmpeg on your Ubuntu server, follow the below steps:

First, Log in to the server as an ssh user with sudo privileges.

Update all the packages by executing the following command.

$ sudo apt update

Next, run the following command to install FFmpeg.

$ sudo apt install ffmpeg

To check the version installed on the server, run the following command.

$ sudo ffmpeg --version

To check all the available decoder and encode types in FFmpeg, execute the following command.

$ sudo ffmpeg --decoders
$ sudo ffmpeg --encoders

 

Install MPlayer

To install MPlayer on your Ubuntu server, follow the below steps:

Log in to the server as an ssh user with sudo privileges.

First, enable the universe repository of Ubuntu by executing the following command.

$ sudo add-apt-repository universe

To update the repository packages, run the following command.

$ sudo apt update

Execute the following command to install the MPlayer.

$ sudo apt install mplayer mplayer-gui

To start a video from the terminal, execute the following command. Replace the <path/to/video/file> flag in the following command with the actual path of the file which you want to play from the terminal. After executing the following command, you can see all the encoding and decoding in the terminal.

$ sudo mplayer <path/to/video/file>

 

Install MEncoder

To install MEncoder on your Ubuntu server, follow the below steps:

Log in to the server as an ssh user with sudo privileges.

First, check if you have the universe repository enabled. If not, follow the below steps:

Open the ‘/etc/apt/sources.list’ file with any of the text editors.

$ sudo vim /etc/apt/sources.list

Then, add the following line at the end of the file. After that, save and close the file.

deb http://us.archive.ubuntu.com/ubuntu trusty main universe

Then, update the apt package by using the following command.

$ sudo apt update

To install the MEncoder on your server, execute the following command.

$ sudo apt install mencoder

To check all the available video and audio codes after the installation, run the following commands.

$ sudo mencoder -ovc help
$ sudo mencoder -oac help

 

Install MP4Box

To install MP4Box (GPAC) on your Ubuntu server, follow the below steps:

Log in to the server as an ssh user with sudo privileges.

First, you need to install subversion. For the same, execute the following command.

$ sudo apt install subversion

Then, execute the following svn command to install the latest GPAC.

$ sudo svn co https://svn.code.sf.net/p/gpac/code/trunk/gpac gpac

After that, execute the following commands to configure the MP4Box.

$ sudo cd gpac
$ sudo ./configure --disable-opengl --use-js=no --use-ft=no --use-jpeg=no --use-png=no --use-faad=no --use-mad=no --use-xvid=no --use-vorbis=no --use-ffmpeg=no --use-ogg=no --use-theora=no --use-openjpeg=no
$ sudo make
$ sudo make install
$ sudo cp bin/gcc/libgpac.so /usr/lib

After that, execute the following command to verify the installation.

$ sudo MP4Box --version

 

Install FLVTool2

The FLVTool2 helps to cut and add cue points on FLV files. To install FLVTool2 on your Ubuntu server, follow the below steps:

First, log in to the server as an ssh user with sudo privileges.

Then, execute the following command to update the apt packages.

$ sudo apt update

Run the following command to install FLVTool2 on your Ubuntu server.

$ sudo apt install flvtool2

After that, execute the following command to verify the installation.

$ sudo flvtool2 --version
or
$ sudo which flvtool2

We hope that this knowledge base was helpful to you. Please comment below for any questions or queries. If you are an InterServer customer, please reach out to our support team for further help.

Leave a Reply