Commands for reporting media file metadata info on a linux(Red Hat) machine

0

All,

I have a shell script running on MAC OSX that uses mdls command to report metadata information about media files (mp3, m4v, mp4, m4r etc.). I have to write a similar script for a linux machine. What are the commands available on a linux machine that provide similar information about media file ( codec, duration, bit-rate, etc.)? I have heard about ffprobe command. Are there any other options available on linux(Red Hat Distro)? Just want to know my options before I ask the admin to install a package.

smokinguns

Posted 2013-03-22T18:49:14.040

Reputation: 1 188

Which distro are you using? – Dennis – 2013-03-22T18:49:56.980

Answers

0

On Debian-based distros (e.g., Ubuntu), there's mediainfo.

Example output:

dennis-home:~$ mediainfo video.mp4
General
Complete name                            : video.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 34.4 MiB
Duration                                 : 5mn 38s
Overall bit rate mode                    : Variable
Overall bit rate                         : 851 Kbps
Encoded date                             : UTC 2012-12-17 21:23:09
Tagged date                              : UTC 2012-12-17 21:23:09
Writing application                      : Lavf53.21.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 5mn 38s
Bit rate                                 : 831 Kbps
Width                                    : 600 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 5:4
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.096
Stream size                              : 33.5 MiB (98%)
Writing library                          : x264 core 123 r2189 35cf912
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=0 / open_gop=1 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.25 / aq=1:1.00
Encoded date                             : UTC 2012-12-17 21:23:09
Tagged date                              : UTC 2012-12-17 21:23:09

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 5mn 38s
Bit rate mode                            : Variable
Bit rate                                 : 16.0 Kbps
Channel(s)                               : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 11.025 KHz
Compression mode                         : Lossy
Delay relative to video                  : 33ms
Stream size                              : 662 KiB (2%)
Encoded date                             : UTC 2012-12-17 21:23:09
Tagged date                              : UTC 2012-12-17 21:23:09

Dennis

Posted 2013-03-22T18:49:14.040

Reputation: 42 934