[MPlayer-users] Bash mplayer slave

Oliver Seitz info at vtnd.de
Sun May 20 21:25:01 CEST 2012


Am 20.05.2012 21:21, schrieb Floris:
> Maybe this is a stupid question, but I can't find an answer.
>
> #!/bin/bash
> mkfifo /tmp/phone/pipe
> mplayer -slave -quiet -idle -input file=/tmp/phone/pipe music.mp3 &
>
> while [ i > 1 ]; do
> sleep 1
> echo get_percent_pos > /tmp/phone/pipe | cut -d= -f2
> done
>
> or
> while [ 1 = 1 ]; do
> sleep 1
> echo get_percent_pos > /tmp/phone/pipe | awk -F\= '{print $2}'
> done
>
> The output is the same:
> ...
> ANS_PERCENT_POSITION=1
> ANS_PERCENT_POSITION=1
> ANS_PERCENT_POSITION=2
> ANS_PERCENT_POSITION=2
> ...
>
> Is it possible to have this:
> 1
> 1
> 2
> 2
>

It is possible - it's useless to modify the output of the "echo", 
though. You have to modify MPlayer's output.

Greets,
Kiste


More information about the MPlayer-users mailing list