[MPlayer-users] Bash mplayer slave

Floris jkfloris at dds.nl
Sun May 20 21:34:15 CEST 2012


Op Sun, 20 May 2012 21:25:01 +0200 schreef Oliver Seitz <info at vtnd.de>:

> 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

Can you give me an example?
I hope it can be done without rebuilding mplayer,
because I write a bash script for some one else.

Flo


More information about the MPlayer-users mailing list