mplayer: display filename on osd with lirc

I’ve been playing with MPlayer, Freevo and LIRC most of all day today, and made some small progress. For one, I found a lovely nasty bug in the latest Freevo, where if I hit the right or left buttons on my remote while watching a movie in mplayer, the event gets sent to both freevo and mplayer. At least I think that’s what it’s doing. What actually happens is that mplayer quits, and I’m blaming Freevo since it works fine by itself outside of that.

Of course, the way Freevo hides and then adds it’s own set of mplayer commands drives me absolutely bonkers. One it has in the latest release is to add -nolirc meaning none of my remote commands are going to work at all. However, I worked around that with mplayer-resume, and I’ll write about that later.

This is the cool thing I stumbled on. Among mplayer’s slave commands is one called osd_show_property_text which will display on screen (osd = on-screen display) the property text of something. In this case, I wanted to display the filename that was playing, since with dvd-bend, I eventually rip all my files to the title of the show. The problem I ran into was I couldn’t figure out how to get it to display the filename. Here’s how, though: just map the command to osd_show_property_text “${filename}” in your LIRC rc file.

Here’s an example from my ~/.mplayer/lircrc that I added:

begin
prog = mplayer
button = green
config = osd_show_property_text “${filename}” 500
end

In the case above, my StreamZap USB remote has four colored buttons on the bottom, and I have an event press called ‘green’. So when I press the green button, it tells MPlayer to display the filename. I added 500ms as an optional duration time, since the default is really short.

A picture is worth a thousand words, though, so here’s what it looks like on your display.

I should mention that I’m sure that there are lots of other variables you could display on screen, but I can’t figure it out. Actually, now that I think about it … Okay, I figured it out. Run mplayer -input cmdlist (by the way, I hope by now you’re running either SVN of MPlayer or a really recent snapshot, you always should), and at the bottom you’ll have a table called available properties. Just do the same command as above, putting the variables in the same format. Another example, would be to display the time position: osd_show_property_text “${time_pos}” I don’t know if they all work, but I tried about half a dozen and they all did, so go wild. 🙂

One last thing to mention … if you’re just using the keyboard, press capital I to get the same thing.

Now if I could only get my Freevo + MPlayer + LIRC issues solved, I’d really be good to go .. I’ll have to post another time on my issues / updates with that arena, though. For now, it’s fun enough just to get MPlayer decked out. 😀

2 comments on “mplayer: display filename on osd with lirc

    1. nospellforlife

      If you press the letter I in current version of mplayer (4.6.3), it displays the name of the file and it does so with this line from input.conf:

      I osd_show_property_text “${filename}” # display filename in osd

      Reply

Leave a Reply