Home Audio/Video Tools Display Media Files Information On Linux Using MediaInfo
Display Media Files Information On Linux Using MediaInfo

Display Media Files Information On Linux Using MediaInfo

By sk
1152 Views

MediaInfo is a free and open source program used to display media files information on Linux, BSD, Mac OS and Microsoft Windows. It is also available for mobile platforms such as Android and iOS. It displays complete technical information as well as tag information for audio and video files. It can be easily integrated with other programs. Mediainfo has both command line interface (CLI) and graphical user interface (GUI), so you can get the details of a media file either from a Desktop or server system.

List of information provided by MediaInfo

Mediainfor provides an extensive list of technical and tag information of a media file as listed below.

General:

  • Name of the media file
  • Format E.g. Mkv, Mpeg
  • File size
  • Duration
  • Bit rate
  • Encoded date
  • Writing application E.g. mkvmerge
  • And more.

Video:

  • Video format
  • Format Info E.g. Advanced Video Codec
  • Format settings E.g. CABAC / 8 Ref Frames
  • Codec id
  • Width
  • Height
  • Display aspect ratio
  • Frame rate
  • Color space
  • And many.

Audio:

  • Audio format
  • Channel
  • Codec id
  • Frame rate
  • Compression mode
  • Sample rate
  • And few more.

Text:

  • Format E,g. UTF-8
  • Codec id
  • Language of sub title
  • And few more.

Chapters:

  • Total count of chapters
  • List of chapters

Supported formats

Mediainfo supports the following media formats.

  • Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1, MPEG-2, MPEG-4, DVD (VOB) and more.
  • Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC and more.
  • Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF and more.
  • Subtitles: SRT, SSA, ASS, SAMI.

More on project's official website given at the end of this guide.

Install MediaInfo On Linux

Mediainfo is packaged to most popular Linux operating systems and is available in the default repositories.

On Arch Linux, make sure you have enabled [Community] repository and install Mediainfo using Pacman like below.

$ sudo pacman -S mediainfo mediainfo-gui

On Debian:

$ sudo apt-get install mediainfo mediainfo-gui

On CentOS, RHEL, enable [EPEL] Repository:

$ sudo yum install epel-release

And then install Mediainfo using command:

$ sudo yum install mediainfo mediainfo-gui

On Fedora:

$ sudo dnf install mediainfo mediainfo-gui

On openSUSE:

$ sudo zypper install mediainfo mediainfo-gui

On Ubuntu, enable [Universe] repository:

$ sudo add-apt-repository universe

And then install Mediainfo:

$ sudo apt install mediainfo mediainfo-gui

Display Media Files Information On Linux Using MediaInfo

The typical usage of Mediainfo is:

$ mediainfo <path_to_media_file>

Display Video file information using Mediainfo

For instance, to find the information about an Matroska file, simply run:

$ mediainfo King\ kong.mkv

Sample output:

General
Unique ID                                : 235919701764564560562801819231992137181 (0xB17C7B57E53C1E03A43059E6AC7FC5DD)
Complete name                            : King kong.mkv
Format                                   : Matroska
Format version                           : Version 1
File size                                : 851 MiB
Duration                                 : 3 h 12 min
Overall bit rate                         : 618 kb/s
Movie name                               : King Kong
Encoded date                             : UTC 2011-01-11 11:25:57
Writing application                      : mkvmerge v2.2.0 ('Turn It On Again') built on Mar  4 2008 13:20:25
Writing library                          : libebml v0.7.7 + libmatroska v0.8.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings                          : CABAC / 8 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 8 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 3 h 12 min
Width                                    : 1 280 pixels
Height                                   : 544 pixels
Display aspect ratio                     : 2.35:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Title                                    : King Kong
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Format settings                          : Explicit
Codec ID                                 : A_AAC-2
Duration                                 : 3 h 12 min
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz / 24.0 kHz
Frame rate                               : 23.438 FPS (1024 SPF)
Compression mode                         : Lossy
Title                                    : King Kong
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Title                                    : King Kong
Language                                 : English
Default                                  : Yes
Forced                                   : No

Display Audio file information using Mediainfo

Mediainfo can list technical details of a audio file, for example .mp3, as shown below.

$ mediainfo My\ heart\ will\ go\ on.mp3

Sample output:

General
Complete name                            : My heart will go on.mp3
Format                                   : MPEG Audio
File size                                : 3.07 MiB
Duration                                 : 3 min 38 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 118 kb/s
Track name                               : 2432768786941406
Writing library                          : LAME3.100
major_brand                              : isom
minor_version                            : 512
compatible_brands                        : isomiso2mp41

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Format settings                          : Joint stereo / MS Stereo
Duration                                 : 3 min 38 s
Bit rate mode                            : Variable
Bit rate                                 : 118 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Frame rate                               : 38.281 FPS (1152 SPF)
Compression mode                         : Lossy
Stream size                              : 3.07 MiB (100%)
Writing library                          : LAME3.100

To display full information including all internal tags, use -f flag.

$ mediainfo -f King\ kong.mkv

Display specific details of a media file

It is also possible to list a specific information, for example audio/video formats, frame rate and bit rate etc., about a media file using various parameters.

To display the aspect ratio of the given media file, run:

$ mediainfo King\ kong.mkv --Inform="Video;%DisplayAspectRatio%" 
2.353

To display the audio format of the media file:

$ mediainfo King\ kong.mkv --Inform="Audio;%Format%"
AAC

Display format settings:

$ mediainfo King\ kong.mkv --Inform="Video;%Format_Settings%"
CABAC / 8 Ref Frames

Display frame rate:

$ mediainfo King\ kong.mkv --Inform="Video;%FrameRate%"
23.976

Play time (duration) of the media file in format HH:MM:SS:FF:

$ mediainfo King\ kong.mkv --Inform="Video;%Duration/String4%"
03:12:26;07

To find list of all available parameters of a media file, run:

$ mediainfo --info-Parameters King\ kong.mkv

To get help, run:

$ mediainfo -h

Suggested read:


Display Media Files Information Using MediaInfo GUI

If you're not comfortable with command line way, you can use Mediainfo graphical user interface to display information about a media file.

Launch Mediainfo GUI from Dash or Menu.

Click File -> Open -> Open File(s) option from menu bar and choose a media file from your local drive.

Display Media Files Information On Linux Using Mediainfo GUI

It is also possible to display information about multiple files or all files in a directory. To display information about all files in a directory, choose File -> Open -> Open directory option.

You can change the default view to some other layout, for example Text, HTML, XML etc. To do so, click View from menu bar and choose your view layout.

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More