[MPlayer-users] problems with slave mode in Windows
Alec Bennett
wrybread at gmail.com
Mon Jul 24 13:12:29 CEST 2006
>
> The problem is that MPlayer under windows can not accept input from
> stdin but only from a console input buffer. No idea how you can work
> around that.
I think I found a way to make stdin work in Windows. I found some mention of
being able to use Msys (or I suppose Cygwin) to write to stdin in Windows,
when you launch mplayer like this:
c:\msys\1.0\bin\sh -c 'c:/mplayer/mplayer.exe -slave -quiet c:/whatever.wav'
The problem now is I simply don't know how to write to stdin. Does anyone
have a code example if, say, I want to mute mplayer? Do I simply write
"mute\n"? I'm aware of the docs on this, but they don't have any examples,
as far as I could find.
Here's what I'm trying in Python:
import process
command = "c:\\msys\\1.0\\bin\\sh -c 'c:/mplayer/mplayer.exe -slave -quiet
c:/whatever.wav'"
p = process.ProcessOpen(command)
p.stdin.write("mute\n")
p.stdin.write("mute")
Or using the more standard OS module:
import os
command = "c:\\msys\\1.0\\bin\\sh -c 'c:/mplayer/mplayer.exe -slave -quiet
c:/whatever.wav'"
sout,sin=os.popen2('command)
sout.write('mute\n')
Am I writing the right command to stdin?
More information about the MPlayer-users
mailing list