[MPlayer-users] mplayer -identify under a PHP script

Andrew Pritchard videodb at teppic.homeip.net
Thu Sep 9 23:13:43 CEST 2004


I've been writing a PHP script which examines a directory for 
[avi|mpeg|mpg|ra|wmv] etc. It then grabs the names of the video files 
from IMDB and plonks it all into a DB.

Included in the rest of the project is a perl script which uses mplayer 
to get attributes of the video file like video/audio codecs. It's not a 
very good solution for a number of reasons which I won't go into here 
(they're mainly a matter of personal taste). What the perl script does 
is this:
mplayer -identify $filename
And then filters the output looking for the lines starting with 'ID'.

So I did the same thing with the PHP script and got:

MPlayer 1.0pre5-3.3.4 (C) 2000-2004 MPlayer Team

CPU: Intel Celeron Covington/Pentium II Deschutes,Tonga/Pentium II Xeon 349.9 MHz (Family: 6, Stepping: 2)
Detected cache-line size is 32 bytes
CPUflags:  MMX: 1 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX

Reading config file /etc/mplayer/mplayer.conf
font: can't open file: (null)
Font /usr/share/mplayer/font/font.desc loaded successfully! (206 chars)
Using usleep() timing
Terminal type `unknown' is not defined.

And then it dies. All I want is the information. I don't actually want 
to watch the movie.

I've done various searches on Google and in the mailing lists here, but 
to no avail.

Am I using the right program for the job? (Do you have a better 
suggestion. eg 'file' doesn't work properly with mpeg encoded files)
How can I persuade it to just give me the information and not try to 
play the movie?
I looked at the 'TOOLS/midentify' perl script, but I get the same results.

Thanks in advance,

Andrew

PS: The project is called videodb available here: 
http://www.splitbrain.org/Programming/PHP/VideoDB/index.php




More information about the MPlayer-users mailing list