[MPlayer-users] Re: -slave and perl

Mark Zealey mark at zealos.org
Wed Jan 15 17:06:49 CET 2003


On Wed, Jan 15, 2003 at 04:10:52AM -0600, Angel wrote:

> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> > 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";

Here is the problem - you can only put commands to it using this method, whereas
i would imagine that he wishes to get output from it too (ie what the crop
determines...). This is why IPC::Open2 is required. I believe it also auto
flushes the fh's automatically.


-- 

Mark Zealey (aka JALH on irc.oftc.net: #zealos and many more)
mark at zealos.org; mark at itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a17! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ !w--- r++ !t---?@ !X---?  !R- !tv b+ G+++ e>+++++ !h++* r!-- y



More information about the MPlayer-users mailing list