mplayer Video File Properties

I was looking for some native 1080/720p HD media files and also comparing some lower resolution files played back on a new HDTV. Many times you can get some quick info on media file properties with the ‘file’ utility:

mshuler@gaea:~$ file Life.Of.Brian.1979.avi
Life.Of.Brian.1979.avi: RIFF (little-endian) data, AVI, 640 x 336, 25.00 fps, video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)

or not..:

mshuler@gaea:~$ file Three.Days.of.the.Condor.1975.mkv
Three.Days.of.the.Condor.1975.mkv: Matroska data

A quick look at the ‘mplayer’ man page gave me the options I needed to get all the properties without playback of the file:

mshuler@gaea:~$ mplayer -identify -frames 0 Three.Days.of.the.Condor.1975.mkv
MPlayer SVN-r30656 (C) 2000-2010 MPlayer Team
Playing Three.Days.of.the.Condor.1975.mkv.
ID_CHAPTER_ID=0
ID_CHAPTER_0_START=7000
ID_CHAPTER_0_NAME=The American Literary Historical Society
ID_CHAPTER_ID=1
ID_CHAPTER_1_START=557633
ID_CHAPTER_1_NAME=Out to Lunch
ID_CHAPTER_ID=2
ID_CHAPTER_2_START=1125799
ID_CHAPTER_2_NAME=Condor
ID_CHAPTER_ID=3
ID_CHAPTER_3_START=1649965
ID_CHAPTER_3_NAME=The Ansonia Hotel
ID_CHAPTER_ID=4
ID_CHAPTER_4_START=1990799
ID_CHAPTER_4_NAME=Still in Flight
ID_CHAPTER_ID=5
ID_CHAPTER_5_START=2430633
ID_CHAPTER_5_NAME=Some Safe Quiet Time
ID_CHAPTER_ID=6
ID_CHAPTER_6_START=3135166
ID_CHAPTER_6_NAME=Sam's Apartment
ID_CHAPTER_ID=7
ID_CHAPTER_7_START=3594665
ID_CHAPTER_7_NAME=Lonely Pictures
ID_CHAPTER_ID=8
ID_CHAPTER_8_START=4166199
ID_CHAPTER_8_NAME=The Mailman
ID_CHAPTER_ID=9
ID_CHAPTER_9_START=4772166
ID_CHAPTER_9_NAME=Sparrow Hawk
ID_CHAPTER_ID=10
ID_CHAPTER_10_START=5111499
ID_CHAPTER_10_NAME=The Suspicion Business
ID_CHAPTER_ID=11
ID_CHAPTER_11_START=5316665
ID_CHAPTER_11_NAME=Leonard Atwood
ID_CHAPTER_ID=12
ID_CHAPTER_12_START=5778032
ID_CHAPTER_12_NAME=Fine Qualities
ID_CHAPTER_ID=13
ID_CHAPTER_13_START=6068332
ID_CHAPTER_13_NAME=Oil Fields
ID_CHAPTER_ID=14
ID_CHAPTER_14_START=6338665
ID_CHAPTER_14_NAME=For that Day
ID_CHAPTER_ID=15
ID_CHAPTER_15_START=6653499
ID_CHAPTER_15_NAME=Telling Stories
ID_VIDEO_ID=0
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
ID_AUDIO_ID=0
ID_AID_0_LANG=eng
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang eng
ID_SUBTITLE_ID=0
ID_SID_0_LANG=eng
[mkv] Track ID 3: subtitles (S_VOBSUB), -sid 0, -slang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  704x352  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=Three.Days.of.the.Condor.1975.mkv
ID_DEMUXER=mkv
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=704
ID_VIDEO_HEIGHT=352
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=2.3693
ID_AUDIO_FORMAT=8192
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=7032.90
ID_SEEKABLE=1
ID_CHAPTERS=16
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
ID_AUDIO_BITRATE=448000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=ffac3
Starting playback...
Exiting... (End of file)
ID_EXIT=EOF