omxplayer for MMS on Raspberry Pi

omxmplayerSince mplayer doesn’t support accelerated video playback on Raspberry Pi, we have to use omxplayer. This HowTo describes how you can make omxplayer work for MMS on a Raspberry Pi, since MMS won’t handle the omxplayer very well. Actually MMS wasn’t designed to use Mplayer (at least in my constellation). But luckily it’s not that hard to make it work, although I didn’t tested it very thoroughly yet.
Basically it needs three steps to make it work:

  • Create a omxplayer launch script
  • Reflect this change in the /etc/mms/MplayerConfig file
  • Create a key-config file, so you can control omxplayer from within MMS

Read the details below:

HowTo

Omxplayer Launch Script

Create a omxplayer launch script. E.g. /usr/local/bin/mms-omxplayer.sh and populate it with this content:

!/bin/bash
omxplayer --blank -p -o hdmi "${@: -1}" --key-config=/home/pi/.mms/omxplayer-keys.conf

Adjust MplayerConfig

Now tell MMS in /etc/mms/MplayerConifig to use this newly created launch script. Make the following parameters look like this:

mplayer_opts =
mplayer_path = /usr/local/bin/omxplayer.sh

The Key-Config file

If you omit this last step, you won’t be able to control the omxplayer. I’ve mapped the keys more or less the same way, like you would get, if you invoke $ omxplayer -k on the command line.
Create the following file: /home/pi/.mms/omxplayer-keys.conf with this content:

DECREASE_SPEED:1
INCREASE_SPEED:2
REWIND:<
FAST_FORWARD:>
SHOW_INFO:z
PREVIOUS_AUDIO:j
NEXT_AUDIO:k
PREVIOUS_CHAPTER:i
NEXT_CHAPTER:o
PREVIOUS_SUBTITLE:n
NEXT_SUBTITLE:m
TOGGLE_SUBTITLE:s
DECREASE_SUBTITLE_DELAY:d
INCREASE_SUBTITLE_DELAY:f
EXIT:esc
PAUSE:p
DECREASE_VOLUME:-
INCREASE_VOLUME:+
SEEK_BACK_SMALL:left
SEEK_FORWARD_SMALL:right
SEEK_BACK_LARGE:down
SEEK_FORWARD_LARGE:up
STEP:.

Adjust the keys to your needs. If you are looking for mapping media-keys from your keyboard, than you have to google it up. It’s possible, but you have to use hex-codes, which I can not provide here, since it depends on the type of keyboard you have.

One thought on “omxplayer for MMS on Raspberry Pi

  1. There are a set of key-presses and effects in omxplayer.cpp, including p and space to pause, arrow keys to move, q to quit, s for subtitles and more that you can RTFS for.

Leave a Reply

Your email address will not be published. Required fields are marked *