Widgets on top of picamera framebuffer?

62 views
Skip to first unread message

Luke Ollett

unread,
Jun 2, 2018, 2:28:09 PM6/2/18
to Kivy users support
I am trying to have the picamera running in the background with an interface on top of it. Buttons and inputs etc with a slightly see through background on top of the full screen camera running in the background.

Now I can do this using the Camera widget, but the latency is not as good as with the framebuffer that I get using the picamera python module. I know the picamera utilizes the opengl stuff and is on top of everything, but before I cry myself to sleep, I wanted to ask here to see if this is something that can be done in an alternative way. 

I saw https://kivy.org/docs/api-kivy.graphics.fbo.html but not really sure how to use it. Sorry, pretty new to Kivy as I thought a python interface is necessary to get to this picamera module to get the best zero latency product.

Thank you in advance for any help or advice or (unfortunately) bad news.

Luke

Luke Ollett

unread,
Jun 2, 2018, 2:38:16 PM6/2/18
to Kivy users support
Here is a simple way to show the problem i am having...

from kivy.app import App

from kivy.uix.floatlayout import FloatLayout

from kivy.uix.camera import Camera

from kivy.uix.button import Button

from picamera import PiCamera


class OhComeOn(App):

   def build(self):

       root = FloatLayout()

       button = Button(text='Start', size_hint=(0.3, 0.2), pos_hint={'x': 0.5, 'y': 0.2}, background_color=(10,10,10,0.5), color=(0,0,0,1)))

       root.add_widget(button)

       camera = PiCamera()

       camera.resolution = (1024, 768)

       camera.start_preview()


       return root


OhComeOn().run()

Reply all
Reply to author
Forward
0 new messages