Command to see media file info in terminal?

I need a command to quickly see in terminal essential information about an audio or video file.

(Then I'll consider adding that to Thunar's custom actions, etc.)


avprobe from the package libav-tools is pretty good.

Sample output avprobe somefile.mp4

avprobe version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2007-2012 the Libav developers
  built on Nov  6 2012 16:51:33 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'somefile.mp4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: isomavc1
    creation_time   : 2012-08-10 15:01:14
  Duration: 00:01:02.55, start: 0.000000, bitrate: 682 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1904x1040 [PAR 1:1 DAR 119:65], 680 kb/s, 19.18 fps, 20 tbr, 20 tbn, 40 tbc
    Metadata:
      creation_time   : 2012-08-10 15:01:14

To add to Thunar custom action, in relation to what was suggested here, the analog formula to add would be:

gnome-terminal --window-with-profile=new1 -e "avprobe %f"

I use mediainfo to get all properties of media files ( audio and video files )

root@server:Videos::08:47 PM# mediainfo Vazquez.mp4 
General
Complete name                            : Vazquez.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42
File size                                : 103 MiB
Duration                                 : 3mn 52s
Overall bit rate mode                    : Variable
Overall bit rate                         : 3 730 Kbps
Encoded date                             : UTC 2011-11-10 07:30:57
Tagged date                              : UTC 2011-11-10 07:30:57
gsst                                     : 0
gstd                                     : 232083
gssd                                     : B7AA66E45HH1322313268839354
gshh                                     : o-o.preferred.bhartibb-blr1.v12.lscache7.c.youtube.com

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=24
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3mn 52s
Bit rate                                 : 3 576 Kbps
Maximum bit rate                         : 5 947 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 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.072
Stream size                              : 98.9 MiB (96%)
Tagged date                              : UTC 2011-11-10 07:30:58

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 3mn 52s
Bit rate mode                            : Variable
Bit rate                                 : 152 Kbps
Maximum bit rate                         : 188 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 4.20 MiB (4%)
Title                                    : IsoMedia File Produced by Google, 5-11-2011
Encoded date                             : UTC 2011-11-10 07:30:58
Tagged date                              : UTC 2011-11-10 07:30:58

mediainfo is now in Ubuntu repositories and can be installed by running

sudo apt install mediainfo

Previously it was necessary to use a PPA but this has no packages for current Ubuntu versions.


exiftool

This might be a surprise, but exiftool from libimage-exiftool-perl Install libimage-exiftool-perl has this capability as well.

It supports showing info from a lot of media file formats, and can write metadata too for some of these formats.

Example output for an audio file:

# exiftool The\ Police\ -\ Live\!\ Disc\ 2\ -\ Atlanta\ -\ 01.\ Synchronicity\ I.mp3 
ExifTool Version Number         : 9.13
File Name                       : The Police - Live! Disc 2 - Atlanta - 01. Synchronicity I.mp3
Directory                       : .
File Size                       : 3.9 MB
File Modification Date/Time     : 2012:03:23 19:44:23+01:00
File Access Date/Time           : 2012:12:26 11:44:38+01:00
File Inode Change Date/Time     : 2012:03:23 19:44:23+01:00
File Permissions                : rw-------
File Type                       : MP3
MIME Type                       : audio/mpeg
MPEG Audio Version              : 1
Audio Layer                     : 3
Sample Rate                     : 44100
Channel Mode                    : Joint Stereo
MS Stereo                       : On
Intensity Stereo                : Off
Copyright Flag                  : False
Original Media                  : True
Emphasis                        : None
VBR Frames                      : 6660
VBR Bytes                       : 4044318
VBR Scale                       : 57
Encoder                         : LAME3.96
Lame VBR Quality                : 4
Lame Quality                    : 3
Lame Method                     : VBR (old/rh)
Lame Low Pass Filter            : 18 kHz
Lame Bitrate                    : 32 kbps
Lame Stereo Mode                : Joint Stereo
Track                           : 1/15
Disc                            : 2/2
Artist                          : The Police
Title                           : Synchronicity I
Album                           : Live!
Year                            : 2003
Genre                           : Rock
Comment                         : Atlanta
Discid                          : c611270f
ID3 Size                        : 128
Audio Bitrate                   : 186 kbps
Date/Time Original              : 2003
Duration                        : 0:02:53 (approx)

Depending on what you consider essential, you might want to use the file utility for this, which gives general information on any file. Its primary purpose is to tell you what type of file you have, but it may provide the level of detail you need.

$ file '01 - Nina Simone - Mood Indigo.mp3'
01 - Nina Simone - Mood Indigo.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo

However, if you need to know the contents of tags--title, artists, etc.--file will not tell you that.