mrioso
Posts: 18
Joined: Sat Dec 01, 2012 1:20 am

omxplayer does not listen to keyboard bindings

Sun Jan 12, 2014 11:22 pm

Hello all.
I am currently working on a raspberry pi Karaoke station. I will post the full source code when I am done :)

Right now I have a weird problem. Let me explain first what I have:
- c++ application using QT
- external call to Omxplayer to play a video

when I launch the omxplayer from I application, the video player does not listen to any keyboard inputs, neither does the application get them. The problem is, that I cannot close the player..
when I execute the command in a terminal everything works fine and it closes on Esc and q.

Any ideas what causes this and how to fix it?

Btw. Is there another good video player for raspberry? I tried mplayer, but it is way too slow..


Thank you!!

Reinhard

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

Re: omxplayer does not listen to keyboard bindings

Mon Jan 13, 2014 1:00 am

I assume your c++ app is capturing the keyboard inputs.
If all you need to do is close it you could use pkill omxplayer.

All though a better solution would be to redirect the keyboard input from your app to omxplayer

gkreidl
Posts: 5924
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: omxplayer does not listen to keyboard bindings

Mon Jan 13, 2014 9:56 am

Or call it via a terminal like that;

xterm -fn fixed -fullscreen -maximized -bg black -fg black -e omxplayer args path

(only possible if running from X, of course).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

mrioso
Posts: 18
Joined: Sat Dec 01, 2012 1:20 am

Re: omxplayer does not listen to keyboard bindings

Mon Jan 13, 2014 6:57 pm

Hello.

I can confirm that you both are right. The keys end up in the keylistener of the caller, where I do kill the process.
Unfortunately omxplayer calls siletly omxplayer.bin which does the actual work and killing the omxplayer process does not kill the .bin thing.

The xterm solution is also pretty nice; onfortunately it does not work for me..

Thank you guys anyway!!

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

Re: omxplayer does not listen to keyboard bindings

Mon Jan 13, 2014 7:32 pm

People have used pipes for this https://github.com/KenT2/pyomxplayer might give you some ideas.

killall omxplayer omxplayer.bin to kill both. Much better to send 'q' through a pipe though.
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

mrioso
Posts: 18
Joined: Sat Dec 01, 2012 1:20 am

Re: omxplayer does not listen to keyboard bindings

Mon Jan 13, 2014 8:45 pm

Hi,

yes that was it!

I actually already was on this track before reading your reply.
This is the setup:

1) Launch omxplayer
2) Key events end still in the caller's event handler
3) Listen to Key_Esc
4) killall omxplayer omxplayer.bin

Thank you all again! It was of great value!

whise
Posts: 4
Joined: Tue Jan 21, 2014 8:53 pm

Re: omxplayer does not listen to keyboard bindings

Tue Jan 21, 2014 8:55 pm

Can i try this app? i am interested in this

dynamitemedia
Posts: 30
Joined: Sun Dec 01, 2013 9:12 pm

Re: omxplayer does not listen to keyboard bindings

Wed Jan 29, 2014 8:16 am

i have a similar problem but i can not get past the black screen.... it will stop on "Q" but then will flash and get stuck at the black screen and it wont go away unless i ssh into it and hist "startx" which gives me other issues but will get rid of the black screen but that gives me other issue... any ideas?

Return to “Troubleshooting”