0

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?

  • Have you tried https://stackoverflow.com/a/51656688/6646710? It did certainly work for me. Please show us a minimal example which is more than just one line of code, becuause than we can rerun your example and hopefully reproduce your problem. I most certainly started this from terminal as well, since it behaves strangely if you are still running the gui in the background – PalimPalim Sep 09 '19 at 17:43
  • Yes, I ran exactly the same code and the kivy app don't get transparent. Did you try it in raspbian lite or with GUI? Maybe it's because I'm trying in a linux terminal. – Joaquín Bozzalla Sep 09 '19 at 22:54
  • I ran it with the full version of raspbian, but not in gui mode, just in terminal mode, since kivy and gui mode don't work well together – PalimPalim Sep 10 '19 at 19:12
  • 1
    I tried in full version but it didn't work. I'm using Raspbian buster. I was searching in google and I found that in Rpi there are different layers of screens controlled by dispmanx. There is a way to select a specific layer for omxplayer? Because in that way I can run omxplayer in a higher layer. – Joaquín Bozzalla Sep 14 '19 at 13:14
  • Cool, so you made it work? If yes, please post it as an answer so others can benefit from it. – PalimPalim Sep 14 '19 at 13:33

1 Answers1

1

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.

  • Great answer! Your assumptions about the layers are right, and there's a cool way to check it: `vcgencmd dispmanx_list`. It displays all the layers being rendered. [More info here.](https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md) – mushycow May 14 '21 at 21:06