Star Wars: The Legacy Revealed.mpg
ID_FILENAME=Star Wars: The Legacy Revealed.mpg
Offhand I don't know how to interpret some of the parameters (e.g. ID_VIDEO_ID), but I find others very useful (like ID_VIDEO_ASPECT, ID_VIDEO_HEIGHT, ID_VIDEO_FPS).
while [ $# -gt 0 ]; do
mplayer -identify -vo null -ao null -frames 1 "$i" 2>&1 | grep ID_
As you can see, this is a very simple wrapper around mplayer. In fact, mplayer's man page refers to a "standard" wrapper called midentify found in the TOOLS directory of the mplayer distribution, but that script isn't included in the mplayer package for Ubuntu. The -identify flag is the important one causing the parameters to be printed. The -vo null -ao null part makes sure mplayer doesn't try to render video or play audio, important because this is intended to be a command-line tool not a GUI/multimedia tool. Similarly, without the -frames 1 option mplayer will happily play the entire file, even with audio and video output set to null.
mplayer prints some stuff to standard error and other stuff to standard output, so the '2>&1' construct redirects all error to output, making sure it all gets piped to the grep command. As it turns out, none of the ID information is on error, so redirecting it to /dev/null would have been just as effective, but I find this approach more elegant, should I ever want to extend the grep pattern or even process it with some other command. Finally, the grep command filteres out everything but the informational parameters.