JeffHoogland
Posts: 22
Joined: Tue Jun 12, 2012 7:13 pm

OMXPlayer Controls

Fri Aug 03, 2012 3:32 am

Am I correct in assuming OMXPlayer currently has zero support for play/pause/exit while it is playing a media file?

If I am incorrect in this assumption please enlightenment me on how I can go about doing this :)

~Jeff

User avatar
MrSwashplate
Posts: 5
Joined: Thu Jul 12, 2012 12:31 pm
Location: Cambridge, UK

Re: OMXPlayer Controls

Fri Aug 03, 2012 9:51 am

JeffHoogland wrote:Am I correct in assuming OMXPlayer currently has zero support for play/pause/exit while it is playing a media file?

If I am incorrect in this assumption please enlightenment me on how I can go about doing this :)

~Jeff
Jeff - it took me a while to figure it out too - there are quite a few controls available - here are the key bindings published on the OMXBuilds web page. (I don't have access to a system to confirm these at the moment.) I think these will help you.

Key bindings
Key Action
1 Increase Speed
2 Decrease Speed
j Previous Audio stream
k Next Audio stream
i Previous Chapter
o Next Chapter
n Previous Subtitle stream
m Next Subtitle stream
s Toggle subtitles
q Exit OMXPlayer
Space or p Pause/Resume
- Decrease Volume
+ Increase Volume
Left Seek -30
Right Seek +30
Down Seek -600
Up Seek +600

JeffHoogland
Posts: 22
Joined: Tue Jun 12, 2012 7:13 pm

Re: OMXPlayer Controls

Fri Aug 03, 2012 1:35 pm

I'm using a version compiled from GIT yesterday and none of those commands are working when I launch omxplayer with:

omxplayer -o hdmi videofile.mp4

Do I need to do something special for the keys to work?

~Jeff

JeffHoogland
Posts: 22
Joined: Tue Jun 12, 2012 7:13 pm

Re: OMXPlayer Controls

Fri Aug 03, 2012 3:05 pm

I was unaware those key controls only function when OMXPlayer is launched via a CLI.

Here is my solution -> http://jeffhoogland.blogspot.com/2012/0 ... a-gui.html

~Jeff

framil
Posts: 9
Joined: Sun May 06, 2012 5:46 pm

Re: OMXPlayer Controls

Fri Aug 10, 2012 9:17 am

I could not JeffHoogland's solution to work in Raspbian, but a couple of changes made it work for me:

sudo nano /usr/share/applications/omxplayer.desktop

For it's contents paste:

[Desktop Entry]
Type=Application
Name=OMXPlayer
Categories=AudioVideo;Player;
Exec=lxterminal --command "omxplayer -o hdmi %f"
Terminal=false
Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png

Save and close the file (ctrl+x in nano)

You can choose your own icon. Note that 'lxterminal' is the default terminal on Pi - change that if you are using something else.

RPiNN1
Posts: 5
Joined: Wed Aug 08, 2012 6:13 pm

Re: OMXPlayer Controls

Fri Aug 10, 2012 11:48 pm

I've tried framil's solution on Raspbian Wheezy but it doesn't work for me.

I don't have an icon in the desktop 'start' menu and if I right-click a file and choose 'open with' omxplayer isn't listed. The omxplayer.desktop file does appear in the correct directory.

I can launch a file by passing it the 'omxplayer -o hdmi' parameter via the command line box in the custom command tab, but once launched. I don't have any keyboard controls.

~Gary

User avatar
dan_in_sd
Posts: 35
Joined: Tue Jul 10, 2012 11:19 pm
Location: San Diego, CA, USA

Re: OMXPlayer Controls

Sun Aug 12, 2012 11:25 pm

tried framil's solution on my copy of Raspian wheezy. it worked as described.


thanks framil. ;-)


they only thing i changed was adding the -y option to the command line arguments. i have a 1680x1050 monitor I connected with an DVI-to-HDMI cable. for some reason nothing plays with omxplayer unless I use the -y option.


-dan

JeffHoogland
Posts: 22
Joined: Tue Jun 12, 2012 7:13 pm

Re: OMXPlayer Controls

Mon Aug 13, 2012 2:41 pm

It's really odd that LXDE doesn't support the Terminal=true option. One of you LXDE users should really go file a bug report about that ;)

~Jeff

framil
Posts: 9
Joined: Sun May 06, 2012 5:46 pm

Re: OMXPlayer Controls

Tue Aug 14, 2012 8:04 pm

RPiNN1 wrote:I've tried framil's solution on Raspbian Wheezy but it doesn't work for me.

I don't have an icon in the desktop 'start' menu and if I right-click a file and choose 'open with' omxplayer isn't listed. The omxplayer.desktop file does appear in the correct directory.

I can launch a file by passing it the 'omxplayer -o hdmi' parameter via the command line box in the custom command tab, but once launched. I don't have any keyboard controls.

~Gary
If you typed the contents of the .desktop file (not 'cut & pasted'), check there are no typos! For example, if you misspell the word 'Application', you will not get an icon, and there's no warning that the .desktop file is not valid.

RPiNN1
Posts: 5
Joined: Wed Aug 08, 2012 6:13 pm

Re: OMXPlayer Controls

Thu Aug 16, 2012 9:57 pm

I've tried again by simply cutting/pasting framil's script into a new file, and now I'm getting somewhere.

My next question is - what do I do with it now?

I'm okay with invoking omxpalyer from a command line but if I click on the desktop icon that's been created a terminal appears for about a second and disappears.

What should be happening?

~Gary

framil
Posts: 9
Joined: Sun May 06, 2012 5:46 pm

Re: OMXPlayer Controls

Fri Aug 17, 2012 7:47 am

RPiNN1 wrote:I've tried again by simply cutting/pasting framil's script into a new file, and now I'm getting somewhere.

My next question is - what do I do with it now?

I'm okay with invoking omxpalyer from a command line but if I click on the desktop icon that's been created a terminal appears for about a second and disappears.

What should be happening?

~Gary
Just clicking on OMXPlayer from your desktop start menu will give the result you describe - same as if you type only 'omxplayer' on a command line. But if you right-click on the file you wish to play, you should see the OMXPlayer icon (or select 'Open With') - click on that. Should work - and you still have the keyboard controls.

User avatar
KONEY
Posts: 7
Joined: Wed Aug 15, 2012 10:12 am
Location: Venice, Italy
Contact: Website Facebook

Re: OMXPlayer Controls

Sat Aug 18, 2012 7:23 pm

framil variant works well for me!

I'm just stuck on how to extend the menu option to .mpg files...

Code: Select all

Categories=AudioVideo;Player;
is a bit generic, I wonder if it supports extension regex or what else shall I do...

thanx for the help
framil wrote:I could not JeffHoogland's solution to work in Raspbian, but a couple of changes made it work for me:
--
Regards
KONEY

abheeshs
Posts: 1
Joined: Fri Oct 25, 2013 3:40 am

Re: OMXPlayer Controls

Fri Oct 25, 2013 3:45 am

You can directly use "xterm".

Code: Select all

[Desktop Entry]
Type=Application
Name=OMXPlayer-HDMI
Categories=AudioVideo;Player;
Exec=xterm -fullscreen -fg black -bg black -e omxplayer -o hdmi -r %f
Terminal=false
Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
And for playing using audio jack:

Code: Select all

[Desktop Entry]
Type=Application
Name=OMXPlayer
Categories=AudioVideo;Player;
Exec=xterm -fullscreen -fg black -bg black -e omxplayer -o local -r %f
Terminal=false
Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png

assistanceneeded
Posts: 86
Joined: Wed Dec 04, 2013 1:06 am
Location: Couch

Re: OMXPlayer Controls

Tue Dec 10, 2013 7:27 am

Hi, can anyone help me? I have been trying for days to get an easy to use mp3 player for my Raspbian desktop. ( I have the OMXPlayer working, but I want an easy method of using it) I paid money and bought the "OMX GUI" from the Pi Store, but the GUI is rubbish..... a big hassle to set-up and almost useless...... so I am trying to set-up something like shown above, that allows me to right click on an audio file and choose "play with omxplayer".

I have tried and tried to do as the people above have done, but nothing works for me. I have tried to modify the text in the file, but with no result. Could anyone PLEASE advise me how I can make the desktop icon I have created actually do as it should and enable right click "omxplayer" option for audio files?

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: OMXPlayer Controls

Tue Dec 10, 2013 9:04 am

my gui tboplayer will use omxplayer to play audio and video https://github.com/KenT2/tboplayer
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

assistanceneeded
Posts: 86
Joined: Wed Dec 04, 2013 1:06 am
Location: Couch

Re: OMXPlayer Controls

Tue Dec 10, 2013 10:15 am

Hi, thanks for the assistance......BUT...... I am noob, and I an stuck at the very last step!!!!

My LXTerminal is at /home/pi, and I need it to be at /home /pi/pexpect-2.3


How do I open a directory in pexpect-2.3?

assistanceneeded
Posts: 86
Joined: Wed Dec 04, 2013 1:06 am
Location: Couch

Re: OMXPlayer Controls

Tue Dec 10, 2013 10:20 am

Ok, LXTerminal says:

[email protected] ~ $


So do I type: cd/home/pi/pexpect-2.3?

that seems logical to me, but the pi says "no such file or directory"

assistanceneeded
Posts: 86
Joined: Wed Dec 04, 2013 1:06 am
Location: Couch

Re: OMXPlayer Controls

Tue Dec 10, 2013 10:32 am

OK<OK<OK

I found it YAY

I now have a GUI for OMXPlayer on my desktop, and I learnt some basic navigation as well.

Thanks for the free GUI, I wish I had given you the $5 that I gave to the Pi store for their useless OMX GUI.

assistanceneeded
Posts: 86
Joined: Wed Dec 04, 2013 1:06 am
Location: Couch

Re: OMXPlayer Controls

Tue Dec 10, 2013 10:52 am

Hi Ken T,

I am so happy with the TBOplayer GUI.

This is exactly what I have been looking for. I had found some links to this same GUI, but the post on the internet was old, and the link to pexpect was denying me permission, or sometimes just not replying.

So THANKS THANKS THANKS, your GUI is great. The one that I bought yesterday needed me to be logged into the Pi Store, get a secret web address, open a web browser, then a GUI was there, but path names had to be typed in, and mp3 and wma files had difficulty working, and the whole thing was slow and clunky......and it cost about $5.

And your GUI is FREE and WORKS SO WELL, smooth, fast, easy, everything I could ask for....THANKS AGAIN!!!!

blockh34d
Posts: 57
Joined: Tue Jan 07, 2014 1:49 pm

Re: OMXPlayer Controls

Tue Feb 25, 2014 8:59 pm

Hello everyone I made some very minimal scripts to allow playing single / multiple files from X11 right-click. There is no GUI and only the standard keyboard shortcuts, but it loads very fast and seems to work well. One version plays video fullscreen, the other in a small window. They appear as separate right-click options. Option 'omxplayer-SmallWindow' is also great for mp3s. Just select one or more audio/video files in the file browser and press enter to open, dead simple.

Install instructions and necessary files at link below:
http://www.raspberrypi.org/forum/viewto ... 91&t=70459

I think I'm going to add shuffle and flatfile playlist functionality soon.

with these scripts I can easily have one playlist of mp3's playing and another of video files playing over the desktop while I work in Geany on python scripts. Barely uses 50-60% of cpu for all at once.

zorch
Posts: 23
Joined: Tue Jul 22, 2014 5:56 pm

Re: OMXPlayer Controls

Tue Jul 22, 2014 6:09 pm

The following post by framil worked perfectly for me! I just received the Pi B+ and love it. omxplayer works perfectly via the command line but I wanted to be able to select the video file in the file folder and play it. I am using the default lxterminal. In the file folder I used the solution to right click the file name, then open, selected omxplayer, the clicked the box use as default. The omxplayer keyboard commands work as advertised above. Thank you framil for taking the time to post your solution! ;) ;) ;)

BTW - I am using VLC for the audio files - it works perfectly for audio but not for video.

by framil » Fri Aug 10, 2012 1:17 am
I could not JeffHoogland's solution to work in Raspbian, but a couple of changes made it work for me:

sudo nano /usr/share/applications/omxplayer.desktop

For it's contents paste:

[Desktop Entry]
Type=Application
Name=OMXPlayer
Categories=AudioVideo;Player;
Exec=lxterminal --command "omxplayer -o hdmi %f"
Terminal=false
Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png

Save and close the file (ctrl+x in nano)

You can choose your own icon. Note that 'lxterminal' is the default terminal on Pi - change that if you are using something else.

ClepCidre
Posts: 2
Joined: Sat Nov 01, 2014 10:16 pm
Location: Belgium

Re: OMXPlayer Controls

Sat Nov 01, 2014 10:22 pm

Hi all,

I install omx and everythings was fine util this evenings
I can not use the command anymore.

I dont want to install the gui i prefere typing line to lunch the movies.

So how can i get back the controler command from the keyboard.
editing the desktop file like framil could help me.
And why is it not working anymore ? Yesterday it was fine.
See you

julienVDM
Posts: 2
Joined: Mon Dec 01, 2014 10:07 pm

Re: OMXPlayer Controls

Mon Dec 01, 2014 10:17 pm

Hi,

I do have the same problem, Any ideas ?

electriac
Posts: 2
Joined: Sat Feb 14, 2015 10:13 pm

Re: OMXPlayer Controls

Wed Feb 18, 2015 3:36 pm

From Python compiler I have a program x.py I have:

Code: Select all

videoPlayer = '/usr/bin/lxterminal -e /usr/bin/omxplayer '
command = videoPlayer + '\x22' + <mediafile> + '\x22'
subprocess.Popen(command, shell=True)
omxplayer runs without problem and responds to keys (space,esc,q etc.)
but if I run the program

/usr/bin/python3.2 x.py

The program omxplayer runs but without keys.

notorious.dds
Posts: 3
Joined: Tue Jun 30, 2015 1:20 am

Re: OMXPlayer Controls

Tue Jun 30, 2015 2:01 am

I think the confusion with why this solution seems to work sometimes and not others is that the [desktop entry] file passes the entire file name to the terminal via the %f variable, but there's no consideration for file names that have spaces or other special characters. If one tries to add quotes around %f in the [desktop entry] file to deal with this issue, the desktop entry won't work at all due to limitations of the desktop entry file with regards to quotes and variables.

Solution:
Create a bash script that adds the quotes around the file name and call the bash script from the desktop entry file.

For Example...
/home/pi/.local/share/applications/OMXlauncher.desktop

Code: Select all

[Desktop Entry]
Type=Application
Name=OMXPlayer
Exec=bash /home/pi/scripts/videoplayer %f
Categories=AudioVideo;
MimeType=video/mp4
Terminal=false
Encoding=UTF-8
Icon=applications-multimedia
NoDisplay=false
/home/pi/scripts/videoplayer

Code: Select all

#!/bin/bash
lxterminal -t "OMXPlayer (Video Control)" -e "omxplayer -b --display :0 \"$1\""

Return to “General discussion”