2

After searching different forums for integrating omxplayer with LIRC, still I haven't found answers to my problem.

I have successfully set up LIRC on my Raspberry Pi B+, and now I want to create a lircrc file for it, in order to actually begin controlling the device remotely. The following is an example I've written on lircrc file:

begin
    prog = irexec
    button = KEY_POWER
    config = omxplayer my_video.mp4 &
    repeat = 0
end

This file works OK; whenever I run irexec and press KEY_POWER on my IR remote controller, the omxplayer starts to play the video.

Now I want to add some features like increase volume, decrease volume, next, previous, etc. to the lircrc file. I know that pressing some keys like +, -, arrows, etc. on keyboard control the video playback on omxplayer; but I don't want to use the keyboard. I just want to do them all by my IR remote controller. (Although I don't want to use keyboard, I just found out that keyboard shortcuts like +, -, etc. don't work at all when omxplayer is running on irexec !!)

So what commands should I use to control omxplayer video playback?

I tried something like the following in the lircrc file to increase the volume:

begin
    prog = irexec
    button = KEY_POWER
    config = +
    repeat = 0
end

or even

begin
    prog = irexec
    button = KEY_POWER
    config = INCREASE_VOLUME
    repeat = 0
end

but unfortunately, neither worked!

How can I set my LIRC to control omxplayer?

What are the true commands for controlling the playback options in omxplayer?

Thanks for your time and support.

  • Anybody has any ideas on this? – Omid1989 Feb 1 '15 at 13:00
  • I'm surprised to see that nobody is aware of the omxplayer commands! – Omid1989 Feb 1 '15 at 19:30
  • Since you have an answer from your post on the Raspberry Pi forums, I would suggest you add the answer here as well or delete this question. Second I would add the same caution to you as they did regarding the comment "nobody cares" and for exactly the same reasons. – Steve Robillard Feb 16 '15 at 5:36
2

You should setup up omxplayer to use a named pipe, then have lirc talk to omxplayer over the pipe.

mkfifo /tmp/cmd
omxplayer my_video.mp4 < /tmp/cmd
echo . > /tmp/cmd #(initial wait for input via the fifo)
echo p > /tmp/cmd #(p will pause playback)

List all options:

omxplayer --help && omxplayer --keys

It's optional but a good idea to wrap it in a script and have lirc call the script (omxp.sh play my_video.mp4, omxp.sh pause, etc)

0

I installed omxd

https://github.com/subogero/omxd

which is a playlist daemon for omxplayer. It works great!

It is very helpful, and I recommend it to all omxplayer users.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.