[MPlayer-users] Quoting and manipulating variables in mplayer slave mode

Lobster lobo at lobs.sytes.net
Wed Apr 27 13:39:27 CEST 2011


On 27/04/2011 10:54 p.m., David Liontooth wrote:
> On 04/25/2011 12:02 AM, Reimar Döffinger wrote:
>> On Sun, Apr 24, 2011 at 11:27:44PM +0200, David Liontooth wrote:
>>> On 04/24/2011 11:56 AM, Reimar Döffinger wrote:
>>>>> Is this correct? And there's no way to do on-the-fly string
>>>>>>   manipulations in this second case?
>>>> Of course there is, probably something like
>>>> echo "osd_show_property_text \"\${filename}\" 1000 0"
>>>> But that is exclusively a propert of your shell and has nothing
>>>> at all to do with MPlayer, just look at the output of just
>>>> running the "echo" without redirecting it to MPlayer.
>>>> Either way this is rather the wrong place to ask since it
>>>> doesn't really have much to to with MPlayer itself.echo 
>>>> "osd_show_text '${FIL//_/ }' 1000 0">   $FIFO
>>> Reimar is missing the point here -- we're talking about retrieving a
>>> property value from mplayer by passing a variable (and outputting to
>>> OSD); I can't reproduce that in the shell.
>> You can reproduce the "learning how to use shell quoting" tutorial
>> without MPlayer.
>> And by all I can tell your problem is that you have little of an
>> idea about shell quoting and the MPlayer lists aren't the
>> right place to learn about it.
>>
>>> Passing these commands to mplayer via fifo gives these results:
>>>
>>>      echo 'osd_show_property_text "${filename}" 1000 0'>  $FIFO
>>>
>>> Expands variable (property value is retrieved and displayed in OSD)
>> $ echo 'osd_show_property_text "${filename}" 1000 0'
>> osd_show_property_text "${filename}" 1000 0
>>
>>>    echo "osd_show_property_text "${filename}" 1000 0">  $FIFO
>> $ echo "osd_show_property_text "${filename}" 1000 0"
>> osd_show_property_text  1000 0
>>
>> Hardly MPlayer's fault it doesn't work, or what?
>>
>>>    echo "osd_show_property_text "${filename//_/ }" 1000 0">  $FIFO
>> $ echo "osd_show_property_text "${filename//_/ }" 1000 0"
>> osd_show_property_text  1000 0
>>
>> No idea what you were trying but you failed to make a difference
>> even before anything reaches MPlayer.
>>
>>> Again, is there a way to manipulate these property values on the
>>> fly? I'm feeling pretty confident the answer is no.
>> You know, you could at least have tried the variant I suggested.
>> Asking questions is rather pointless if you just ignore the answers 
>> given.
>
> Just for the record, Reimar, you still haven't understood what I'm 
> trying to do, and you have not given a meaningful answer. I'm not 
> ignoring you suggestions, but they don't address the question.
>
> I'll give it one more try: I want to retrive a variable (property 
> value) from mplayer and display it in OSD, using the 
> osd_show_property_text command, but format the content of the string 
> before it reaches OSD. I no longer think this is possible, but you 
> continue to say it's trivial. Give me an example in any shell. Even a 
> failed example would demonstrate you at least understand the question.
>
> What you suggested initially and repeat is a possible answer:
>
>   echo "osd_show_property_text \"\${filename}\" 1000 0"
>
> is simply not a possible solution to what I'm asking, no matter 
> whether it works or not, since it does not format the variable 
> (property value). It clearly shows you still have not understood the 
> question.
>
> The feature I'm asking about would necessarily need to be built into 
> mplayer, in spite of your repeated insistence this cannot be the case. 
> It would be fun if you slowed down for once and actually tried to 
> understand what I'm asking. Don't tell me it's the wrong place to ask 
> a question you never understood.
>
> Again, mplayer does not appear to support what I'm asking about, and I 
> don't particularly think it should; it's easy enough to work around. 
> But if it does, that would be cool.
>
> Cheers,
> Dave

Just to confirm you are wanting the OSD to show a internal variable of 
MPlayer and
not one you have within your shell script right?

I.E you `MPlayer *.mkv` and then try to put $filename (which you assume 
MPlayer
knows as the file currently being plaid) on the OSD to show the 
currently playing
filename?




More information about the MPlayer-users mailing list