Friday, August 3, 2012

HOWTO: Launch OMXPlayer via a GUI

I'm going to be on an ARM kick for the next two weeks before my fall classes start up. In addition to porting Bodhi to the Pi one of my goals is also to replace my media PC with a Pi. Even though the processor in the Pi is fairly weak, it can decode HD video using it's GPU chip if you use the proper media player. This means that your old favorites like VLC and mPlayer will not work, so we must turn to a tool designed just for the Pi: OMXPlayer.

Now because OMXPlayer is still very new, it is still very basic. So basic in fact it's key bindings (for play/pause/stop/quit) only function if the program is launched via the CLI. Knowing my Fiance and friends who often use the media PC would give me no end of grief if they had to open a terminal to play movies - I set about finding a solution. Today I'd like to share that fairly simple solution with you!

To allow users to simply "double click" on a media file via the file manager and have it open in OMXPlayer you need to create a .desktop file for OMXPlayer. Open a terminal on your pi and run:

Save and close the file (ctrl+x in nano) and you should be good to go! When you double click on a media file in your file browser simply select Open With: OMXPlayer! Please note some users have reported this doesn't work with LXDE - I cannot confirm this though as I only use E17 and it works fine there :)

The OMXPlayer icon appears indeed in the audio&video group, and if I click it directly it shows the black terminal shortly. However If I use a video file with "open with" OMXPlayer, nothing happens. No terminal window appears as well. This video file plays OK when I play it using the command line.

OK, I flashed this bodhi on my Pi. Looking good. Strange, no raspi-config on first boot? Which left me with a qwerty layout :-( I need azerty. Ok, ran the raspi-config to fix that. But to my horror I saw this nice looking shell suddenly behaving very buggy, when exploring some config menus. Double mouse cursor, mouse-overs leaving all sort of garbage on the opened panels and on top of that extremely sluggish responsiveness due to all those fancy animations. The pi REALLY needs a lean-and-mean GUI, so I like the Wheezy LXDE shell much more. Due to the erratic behavior I didnt even get to the OMXPlayer trick. Exit Bodhi...

Well, LXDE does not animate menu's in, it just flashes them up which is more desirable on a slow CPU.

But the real culprit of this E17 shell is the buggy mouse arrow behaviour, its trashing the window underneath the cursor and making the cursor image itself jumping and duplicating so i don't even see where to click on and it leaves all sort of garbage on the screen. LXDE does not have this behavior. I still have it on the flashcard, I could make a screenshot if that could help you...

The menu animation is new to E and is awful. I'm working on disabling/changing it in future updates.

As for screen tearing/mouse garbage I haven't seen that/can't produce it myself. Can you please post a screen shot and maybe try a different E theme to see if that fixes it? Your image md5sum was good right?

That works fine for me thanks alot for the headscratching! I can't however get my keyboard to control any aspect of the OMXplayer playback. It wont pause or stop and start or anything for that matter any suggestions ?

Everything works fine on my end I have controls and they respond except when I hit q to quit I get a blank screen and my picture is not full screen. I spent many, many hours trying to resolve this but I have no solution.

Search Blog

About Me

My name is Jeff Hoogland and you've landed on one of my Google pages. I currently work as adjunct faculty teaching mathematics at ITT Technical Institute in Springfield IL. I am a free software advocate and part time code jockey. You can learn more about me from my personal website.

Contact

About this Website

Thoughts on Technology is a collection of my own original writings about computers, hardware, software, and all forms of technology in the world around us today. I ask that you please do not repost my works without permission, but if you wish to please feel free to link back to my website here.

Donate

If you would like to support my projects with a financial donation you can do so via the button below.