[MPlayer-dev-eng] [RFC][PATCH] New option -identify

Alex Beregszaszi alex at naxine.org
Sat Oct 19 00:38:04 CEST 2002


Hi,

> I use mplayer in two scripts to get file information (wxh, samplerate,
> etc.). Until now I used awk to extract that data from normal mplayer
> messages, but because they change every now and then, I thought it would
> be nice to have an "-identify" option, which would output this
> information in shell-compatible format. So here is a patch.
> 
> After applying this,
> mplayer -identify <file>
> will produce output similar to the following:
> 
> |Using GNU internationalization
> |Original domain: messages
> |Original dirname: /usr/share/locale
> |Current domain: mplayer
> |Current dirname: /usr/local/share/locale
> |
> |
> |MPlayer CVS-021018-23:00-2.95.4 (C) 2000-2002 Arpad Gereoffy (see DOCS)
> [...]
> |Detected AVI file format!
> |VIDEO:  [DIV3]  640x480  24bpp  23.98 fps  500.9 kbps (61.1 kbyte/s)
> |Clip info: 
> | Software: Nandub v1.0rc2
> |==========================================================================
> |Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
> |AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 16000->192000 (128.0 kbit)
> |Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
> |==========================================================================
> |ID_VIDEO_WIDTH=640
> |ID_VIDEO_HEIGHT=480
> |ID_VIDEO_FPS=23.98
> |ID_VIDEO_ASPECT=0.00
> |ID_AUDIO_RATE=48000
> |ID_AUDIO_NCH=2
> |
> |Exiting... (End of file)

You could add ID_FILE_NAME= too (as i see you're repeating that in a playlist)

Anyway, nice patch.

> 
> I prefixed the lines with ID_ to make them easyly extractable with grep,
> e.g. "eval `mplayer -identify <file> 2>/dev/null | grep "^ID_"`" will
> set shell variables for the file's parameters.
> 
> The patch itself is really simple.
> 
> Any suggestions to make this better or in a different way ?
> 
> -- 
> Tobias								PGP: 0x9AC7E0BC
> This mail is made of 100% recycled bits
> Now playing: Okui Masami: S-mode #1 15 - LOVE IS FIRE
> 

-- 
Alex Beregszaszi  <alex at naxine.org>



More information about the MPlayer-dev-eng mailing list