Get Media information of audio and video files – Mediainfo

Please share it on

Mediainfo package helps you get the information of media files like video codec, audio codec, bitrate, etc., . This guide helps you to install mediainfo package on centos, Amazon AMI linux images , Redhat linux.

My linux architecture is x86_64.

Download the following packages.

wget http://mediaarea.net/download/binary/mediainfo/0.7.64/mediainfo-0.7.64-1.x86_64.CentOS_6.rpm
wget http://mediaarea.net/download/binary/libmediainfo0/0.7.64/libmediainfo0-0.7.64-1.x86_64.CentOS_6.rpm
wget http://mediaarea.net/download/binary/libmediainfo0/0.7.64/libmediainfo-devel-0.7.64-1.x86_64.CentOS_6.rpm
wget http://mediaarea.net/download/binary/libzen0/0.4.29/libzen0-0.4.29-1.x86_64.CentOS_6.rpm
wget http://mediaarea.net/download/binary/libzen0/0.4.29/libzen-devel-0.4.29-1.x86_64.CentOS_6.rpm

Install the packages

[root@ip-10-251-98-2 mediainfo]# rpm -ivh libmediainfo0-0.7.64-1.x86_64.CentOS_6.rpm mediainfo-0.7.64-1.x86_64.CentOS_6.rpm libmediainfo-devel-0.7.64-1.x86_64.CentOS_6.rpm libzen0-0.4.29-1.x86_64.CentOS_6.rpm libzen-devel-0.4.29-1.x86_64.CentOS_6.rpm
warning: libmediainfo0-0.7.64-1.x86_64.CentOS_6.rpm: Header V3 DSA/SHA1 Signature, key ID 0c9a6ded: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:libzen0-0.4.29-246.1 ################################# [ 20%]
2:libmediainfo0-0.7.64-4.1 ################################# [ 40%]
3:libzen-devel-0.4.29-246.1 ################################# [ 60%]
4:libmediainfo-devel-0.7.64-4.1 ################################# [ 80%]
5:mediainfo-0.7.64-7.1 ################################# [100%]

Mediainfo help

[root@ip-10-251-98-2 mediainfo]# mediainfo –help
MediaInfo Command line,
MediaInfoLib – v0.7.64
Usage: “MediaInfo [-Options…] FileName1 [Filename2…]”

Options:
–Help, -h
Display this help and exit
–Help-Output
Display help for Output= option
–Help-AnOption
Display help for “AnOption”
–Version
Display MediaInfo version and exit

–Full , -f
Full information Display (all internal tags)
–Output=HTML
Full information Display with HTML tags
–Output=XML
Full information Display with XML tags
–Output=…y
Template defined information Display
–Info-Parameters
Display list of Inform= parameters

–Language=raw
Display non-translated unique identifiers (internal text)
–LogFile=…
Save the output in the specified file
–BOM
Byte order mark for UTF-8 output

–Ssl_CertificateFileName=…
File name of the SSL certificate.
The default format is “PEM” and can be changed
with –Ssl_CertificateFormat.
–Ssl_CertificateFormat=…
File format of the SSL certificate.
Supported formats are “PEM” and “DER”
–Ssl_PrivateKeyFileName=…
File name of the SSL private key.
The default format is “PEM” and can be changed
with –Ssl_PrivateKeyFormat.
Note: private key with a password is not supported.
–Ssl_PrivateKeyFormat=…
File format of the SSL private key.
Supported formats are “PEM” and “DER”
–Ssl_CertificateAuthorityFileName=…
File name of the SSL certificate authorities
to verify the peer with.
–Ssl_CertificateAuthorityPath=…
Path of the SSL certificate authorities
to verify the peer with.
–Ssl_CertificateRevocationListFileName=…
File name of the SSL certificate revocation list.
The format is “PEM”
–Ssl_IgnoreSecurity=…
Does not verify the authenticity of the peer’s certificate
Use it at your own risks
–Ssh_PublicKeyFileName=…
File name of the SSH private key.
Default is $HOME/.ssh/id_rsa.pub or $HOME/.ssh/id_dsa.pub
if the HOME environment variable is set, and just
“id_rsa.pub” or “id_dsa.pub” in the current directory
if HOME is not set.
Note: you need to set both public and private key.
–Ssh_PrivateKeyFileName=…
File name of the SSH private key.
Default is $HOME/.ssh/id_rsa or $HOME/.ssh/id_dsa
if the HOME environment variable is set, and just
“id_rsa” or “id_dsa” in the current directory
if HOME is not set.
Note: you need to set both public and private key.
Note: private key with a password is not supported.
–Ssh_KnownHostsFileName=…
File name of the known hosts
The format is the OpenSSH file format (libssh2)
Default is $HOME/.ssh/known_hosts
if the HOME environment variable is set, and just
“known_hosts” in the current directory
if HOME is not set.
–Ssh_IgnoreSecurity=…
Does not verify the authenticity of the peer
(you don’t need to accept the key with ssh first)
Use it at your own risks

Example : Get the information of a videofile

[root@ip-10-251-98-2 videos]# mediainfo sample.mp4
General
Complete name : sample.mp4
Format : MPEG-4
Format profile : QuickTime
Codec ID : qt
File size : 37.3 MiB
Duration : 9mn 56s
Overall bit rate mode : Variable
Overall bit rate : 525 Kbps
Writing application : Lavf52.73.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3.0
Format settings, CABAC : No
Format settings, ReFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 9mn 56s
Bit rate : 400 Kbps
Width : 424 pixels
Height : 240 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 24.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.164
Stream size : 29.9 MiB (80%)
Writing library : x264 core 98 r1629 9d1c441
Encoding settings : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=64 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=90 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=400 / ratetol=10.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / vbv_maxrate=768 / vbv_bufsize=3000 / ip_ratio=1.41 / aq=1:1.00 / nal_hrd=none
Language : English

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 9mn 56s
Bit rate mode : Variable
Bit rate : 99.1 Kbps
Channel count : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 7.04 MiB (19%)
Language : English

Please share it on

Leave a Reply

Your email address will not be published. Required fields are marked *