简体   繁体   中英

How to put omxPlayer on top of Kivy application in raspbian lite?

I need to run a omxplayer into a kivy application. The problem is that when I start the omxplayer its appearance behind the kivy app, so it is not visible.

I tried using: Window.clearcolor = (0,0,0,0) but it doesn't work. I think that is because I'm running the app in a linux terminal.

How can I show the player in front of all applications?

I finally did it. Here the explanation.

Raspberry video core put the different application's screens in differents layers. The terminal is in layer -127 and, according to kivy docs, kivy run in layer 0 by default. In my python code I run omxplayer with the next line of code:

Popen(['omxplayer', '--layer', '100000', '--live', '--refresh', '--video_queue', '4', '--fps', '30', '--win', '"0 0 800 480"', 'rtsp://192.168.0.88'])

The importart thing is --layer 100000 , that is an option that allows us to choose the layer of omxplayer.

In my case, ran it in layers like 128 but it didn't work, so I suspect that kivy is not in layer zero. I ended putting 100000 and it works.

Its good to say that the kivy app keeps running in a lower layer, so every input signal (keyboard, buttons, etc.) is still working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM