简体   繁体   English

如何在aspbian lite中将omxPlayer放在Kivy应用程序之上?

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

I need to run a omxplayer into a kivy application. 我需要在kivy应用程序中运行omxplayer。 The problem is that when I start the omxplayer its appearance behind the kivy app, so it is not visible. 问题是,当我启动omxplayer时,它的外观在kivy应用程序后面,因此它不可见。

I tried using: Window.clearcolor = (0,0,0,0) but it doesn't work. 我尝试使用: Window.clearcolor = (0,0,0,0)但是它不起作用。 I think that is because I'm running the app in a linux terminal. 我认为这是因为我正在linux终端中运行该应用程序。

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. Raspberry视频核心将不同应用程序的屏幕置于不同的层中。 The terminal is in layer -127 and, according to kivy docs, kivy run in layer 0 by default. 终端位于-127层,根据kivy文档,默认情况下kivy在第0层运行。 In my python code I run omxplayer with the next line of code: 在我的python代码中,我使用下一行代码运行omxplayer:

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. importart是--layer 100000 ,这是一个允许我们选择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. 就我而言,以128层运行它,但是它没有用,所以我怀疑kivy不在零层中。 I ended putting 100000 and it works. 我结束了投入100000的工作。

Its good to say that the kivy app keeps running in a lower layer, so every input signal (keyboard, buttons, etc.) is still working. 可以说kivy应用程序始终在较低层运行,因此每个输入信号(键盘,按钮等)仍在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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