I try to use uix.camera widget and show some wideo from my web-camera.
I looked into the documentation and try to use this simply code. But it's just show me a white creen withoud any video (I enabled playing).
What I'm doing wrong?
Maybe some useful docs\tutorial exist (because from official documentation I understanding a little from many). Thanks for any help.
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.camera import Camera
class MainApp(App):
def build(self):
return Camera(play=True)
if __name__== "__main__":
MainApp().run()
解决方案
You need to specify resolution. In my case, I also needed to specify index=1, that is the second camera plugged in my computer.
Example:
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.camera import Camera
class MainApp(App):
def build(self):
return Camera(play=True, index=1, resolution=(640,480))
if __name__== "__main__":
MainApp().run()