Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5091

Camera board • Re: Switching between colour and mono while streaming - how?

$
0
0
Is there any way to enable the ability to send commands while the script is running?
All guidance welcome.....
You could try putting the .set_controls inside the StreamingHandler Class.
Something like this snippet:-

Code:

            try:                while True:                                        if IRcut_out:                        picam2.set_controls({"Saturation":0})                    else:                        picam2.set_controls({"Saturation":1})                    if randint(0,100)>98:                         # Toggle state                           IRcut_out = not IRcut_out                                            with output.condition:                        output.condition.wait()                        frame = output.frame
Not GPIO triggered but demonstrates a random switch between Saturation levels.
(Will also need these other code changes ....)

Code:

from random import randint

Code:

IRcut_out = Falseclass StreamingHandler(server.BaseHTTPRequestHandler):    def do_GET(self):        global IRcut_out

Statistics: Posted by sandyol — Mon Nov 25, 2024 2:02 pm



Viewing all articles
Browse latest Browse all 5091

Trending Articles