[MPlayer-users] Scripting MPlayer....

Jack Smith jack.delbert at gmail.com
Mon Sep 10 13:55:11 CEST 2007


On 9/10/07, Guillaume POIRIER <poirierg at gmail.com> wrote:
> Hi,
>
> On 9/10/07, pnunn <pnunn at infoteq.com.au> wrote:
> > Folks,
> >
> > I'm looking for some help setting up a system that needs to just continuously
> > play video clips in a loop.
> >
> > I need to be able to start them at boot... and change the playlist if you like
> > by uploading new files remotely to the system.
> >
> > I need to know when a new one starts so I can log some information about it.
> >
> > Can someone give me some clues as to the best way to do this?
> >
> > Not sure if I should use a play list and just change it from under mplayer, or
> > run a script that just loops through files in a directory... any input
> > greatly appreciated.
>
> Use the slave more. It's explained in DOCS/tech/slave.txt (from the
> top of my head)
>
>
> Guillaume

Or, if you want a script here's a quickie I wrote in Perl for my Linux
system.  Perl came with the O/S.

#!/usr/bin/perl -w
use strict;

while(1) {
    `mplayer *.wmv`;
}

while(1) is an infinite loop that loops over all of the WMV files in
the directory you run the script in, in alphabetical order.  You could
also add more mplayer lines between the curly brackets and make it an
actual playlist in any order you want.  Don't know how familiar you
are with scripts (or even what O/S you're running) but in Unix you
would create the script, naming it something like "repeat", make it
executable

chmod 755 repeat

and run it by

./repeat

Since it's an infinite loop, you'll have to break it to get it to
stop.  Ctrl-C worked for me.
Jack
-- 
English doesn't borrow from other languages -- English follows other
languages down dark alleys and takes what it wants.



More information about the MPlayer-users mailing list