[MPlayer-users] MPlayer PHP exec

James Goddard jamesg at taglim.com
Thu Sep 8 16:04:53 CEST 2005


I'm trying to write a PHP script that makes a thumbnail of an video on
upload.  The first step is to extract a jpeg with mplayer.  I've run
into two issues:

Home directory support:

1.  MPlayer insists on creating files in the $HOME/.mplayer directory.
Since the apache user has no HOME directory this is problematic.  I can
solve this problem by prepending "HOME=/dir" to the command but that's a
kludge.  Is there anyway to prevent MPlayer from saving the
config/registry files?

2.  MPlayer hangs when processing a wmv file.  This works great from the
command line but fails every time when run from within my PHP script.
If I turn off the quiet mode flags, the last thing output is "Called
unk_GetThreadPriority" which leads me to believe there is a missing
function in it's internal wine code to deal with the Windows DLL's.

Here is the command line:

exec( "/usr/bin/mplayer -really-quiet -nolirc -nortc -noconsolecontrols
-nojoystick -slave -ss 200000 " . $source . " -vo jpeg:outdir=/dir -ao
null");

I've tried various command line options (i.e. with/without -slave, etc)
with no luck.

Any suggestions?






More information about the MPlayer-users mailing list