HOWTO: compiling mediainfo (CLI & GUI) on Ubuntu

Published: 2009-01-04
Today, I will cover a must-have tool for anyone who likes to play with audio / video transcoding : mediainfo.

Indeed, mediainfo will tell you everything you need to know about the format and properties of basically any type of picture, audio or video file.

For instance:
ubuntu% mediainfo video.mpg 
General
Complete name : video.mpg
Format : MPEG-PS
File size : 41.8 MiB
Duration : 2mn 59s
Overall bit rate : 1 954 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 1
Format settings, Matrix : Default
Duration : 2mn 59s
Bit rate mode : Constant
Bit rate : 1 594 Kbps
Nominal bit rate : 1 700 Kbps
Width : 352 pixels
Height : 288 pixels
Display aspect ratio : 4/3
Frame rate : 25.000 fps
Scan type : Progressive
Bits/(Pixel*Frame) : 0.629

Audio
ID : 192 (0xC0)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2mn 59s
Bit rate mode : Constant
Bit rate : 224 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Resolution : 16 bits
Video delay : 280ms
And the '-f' flag (for full) will tell you even more! Now you that you're convinced, let's install it :) mediainfo is available both as a command-line tool and as a graphical tool, so I'll show you both installations on Ubuntu 8.04.

1) Installing the command-line version

This is very straightforward:

ubuntu% wget http://ovh.dl.sourceforge.net/sourceforge/mediainfo/MediaInfo_CLI_0.7.8_GNU_FromSource.tar.bz2
ubuntu% bzip2 -d MediaInfo_CLI_0.7.8.tar.bz2
ubuntu% tar xvf MediaInfo_CLI_0.7.8_GNU_FromSource.tar

ubuntu% cd MediaInfo_CLI_0.7.8_GNU_FromSource
ubuntu% sh CLI_Compile.sh
ubuntu% cd MediaInfo/Project/GNU/CLI
ubuntu% sudo make install

Done :) You can now invoke the 'mediainfo' command.

2) Installing the graphical version

The GUI of mediainfo is based on wxWindows, a cross-platform toolkit for GTK (the X Window toolkit), Windows and MacOS.

In our case, we will use GTK, so let's start with the installation of the GTK development library:

ubuntu% sudo apt-get install libgtk2.0-dev

Then, let's install the wxWidgets library, used by the mediainfo GUI. First, we need to update the list of APT repositories by adding the following line to /etc/apt/sources.list:
deb http://apt.wxwidgets.org/ hardy-wx main
Now, let's update the package list and fetch the wxWidgets package:

ubuntu% sudo apt-get update
ubuntu% sudo apt-get install libwxgtk2.8-0


Now we're ready to build the GUI version of mediainfo:

ubuntu% wget http://ovh.dl.sourceforge.net/sourceforge/mediainfo/MediaInfo_GUI_0.7.8_GNU_FromSource.tar.bz2
ubuntu% bzip2 -d MediaInfo_GUI_0.7.8.tar.bz2
ubuntu% tar xvf MediaInfo_GUI_0.7.8_GNU_FromSource.tar

ubuntu% cd MediaInfo_GUI_0.7.8_GNU_FromSource
ubuntu% sh GUI_Compile.sh
ubuntu% cd MediaInfo/Project/GNU/GUI
ubuntu% sudo make install

The GUI version of mediainfo is now available using the 'mediainfo-gui' command.

That's it for the installation of mediainfo. I'm sure you'll find this tool extremely useful and I'll definitely use it in future posts to illustrate audio & video formats.

About the Author

Julien Simon is the Chief Evangelist at Arcee AI , specializing in Small Language Models and enterprise AI solutions. Recognized as the #1 AI Evangelist globally by AI Magazine in 2021, he brings over 30 years of technology leadership experience to his role.

With 650+ speaking engagements worldwide and 350+ technical blog posts, Julien is a leading voice in practical AI implementation, cost-effective AI solutions, and the democratization of artificial intelligence. His expertise spans open-source AI, Small Language Models, enterprise AI strategy, and edge computing optimization.

Previously serving as Principal Evangelist at Amazon Web Services and Chief Evangelist at Hugging Face, Julien has helped thousands of organizations implement AI solutions that deliver real business value. He is the author of "Learn Amazon SageMaker," the first book ever published on AWS's flagship machine learning service.

Julien's mission is to make AI accessible, understandable, and controllable for enterprises through transparent, open-weights models that organizations can deploy, customize, and trust.