Identify multimedia file(s)

$ mplayer -vo null -ao null -frames 0 -identify <filespec>

SUBREADER: SUB: Could not determine file format
  CPLAYER: Cannot load subtitles: ./testmovie.txt
 IDENTIFY: ID_VIDEO_ID=0
 IDENTIFY: ID_AUDIO_ID=1
 IDENTIFY: ID_FILENAME=testmovie.avi
 IDENTIFY: ID_DEMUXER=avi
 IDENTIFY: ID_VIDEO_FORMAT=DX50
 IDENTIFY: ID_VIDEO_BITRATE=1250296
 IDENTIFY: ID_VIDEO_WIDTH=640
 IDENTIFY: ID_VIDEO_HEIGHT=480
 IDENTIFY: ID_VIDEO_FPS=29.970
 IDENTIFY: ID_VIDEO_ASPECT=0.0000
 IDENTIFY: ID_AUDIO_FORMAT=85
 IDENTIFY: ID_AUDIO_BITRATE=192000
 IDENTIFY: ID_AUDIO_RATE=0
 IDENTIFY: ID_AUDIO_NCH=0
 IDENTIFY: ID_LENGTH=7201.64
 IDENTIFY: ID_VIDEO_CODEC=ffodivx
 IDENTIFY: ID_AUDIO_BITRATE=192000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
 IDENTIFY: ID_AUDIO_CODEC=mp3

/usr/bin/midentify

#!/bin/sh
#
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.
 
if [ -z "$1" ]; then
        echo "Usage: midentify <file> [<file> ...]"
        exit 1
fi
 
mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
        sed -ne '/^ID_/ {
                          s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
                        }'
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.