[MPlayer-users] Re: -slave and perl
Angel
angel at knight-industries.com
Wed Jan 15 11:10:52 CET 2003
> Any Perl hackers out there know how to send commands to
> mplayer in slave mode from within a script?
Here is most of the relevant code to do that. I've copied and pasted from a
gtk perl program I wrote for a settop type box.
-------------------------------------------------------------------------------------------------
# Create file handle for playing movie
# and set it to autoflush.
local *PLAYING_MOVIE_H;
my $oldfh = select PLAYING_MOVIE_H;
$| = 1;
select ($oldfh);
open PLAYING_MOVIE_H, "| mplayer -aid 128 -alang en -slave -fs -dvd 1";
---------------------------------------------------------------------------------------------------
To send commands to mplayer you simply print to the PLAYING_MOVIE_H file
handle ie..
print PLAYING_MOVIE_H "seek 60 0\n";
> Specifically, I'd like to do something like:
>
> wait 5 seconds
> skip forward
> wait 5 seconds
> skip forward
> wait 5 seconds
> quit
With the code above.. this is trivial.
-Angel
More information about the MPlayer-users
mailing list