I want to add button functions to my night vision PiCamera. I have a custom script that outputs the screen to spilt screen because I want to make night vision goggles with it. `

from picamera import mmalobj as mo, mmal
from signal import pause

camera = mo.MMALCamera()
splitter = mo.MMALSpiltter()
render_l = mo.MMALRenderer()
redner_r = mo.MMALRenderer()

camera.outputs[0].framesize = (420,240)
camera.outputs[0].framesize = 30

p = render_l.inputs[0].params[mmal.MMAL_PARAMETER_DISPLAYREGION]
p.fullscreen = False
p.dest_rect = mmal.MMAL_RECT_T(0, 180, 420, 240)
render_l.inputs[0].params[mmal.MMAL_PARAMETER_DISPLAYREGION] = p
p.dest_rect = mmal.MMAL_RECT_T(420, 180, 420, 240)
render_r.inputs[0].params[mmal.MMAL_PARAMETER_DISPLAYREGION] = p



I would like the button to capture an image and record a video, anybody know how? (using raspberry pi 4)

  • What have you tried to capture an image or record a video? I ask because your question strikes me as a bit "open-ended", which may lead to general (rather than specific) answers. The Help section here is worth reviewing, and in particular, the topic of "How to Ask a Good Question" offers specific advice on how to scope your question to improve your prospects for getting a useful answer.
    – Seamus
    Nov 1 at 18:03
  • 1
    anybody know how? is not a question about your project ... please ask a clear, answerable question about the project ... what good is it to you if I answer yes?
    – jsotola
    Nov 1 at 19:16
  • To add a button you might want to look at the recipe from GPIO Zero. Have a go and if you are still having problems, then update your question with what you have done.
    – ukBaz
    Nov 8 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.