• Assistance Needed for Standalone Streaming Setup on Multiple OAK PoE Cameras

Thank you for your response @jakaskerl , Really Appreciate.I
I need assistance with the following code.

  1. I am trying to get the object of desired IP (desired_ip) and trying to perform flash() and flasClear() on the object. However i am getting error depthai.DeviceInfo object has no attribute 'flashClear'. I am assuming flash() also won't work. Here is snap of my code.


    desired_ip = "0.0.0.0"

    device_infos = dai.Device.getAllAvailableDevices()

    device_infos = [device_info for device_info in device_infos if device_info.name == desired_ip]

    if device_infos:

        device_info = device_infos[0]

        print(device_info)

        if device_info.state != dai.XLinkDeviceState.X_LINK_BOOTLOADER:

            print("Device already in FLASH state, removing existing flash...")

            device_info.flashClear()

            print('Successfully cleared bootloader flash')

        progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

        # device_info.flash(progress, pipeline)

        print("Flashing completed.")

    else:

        print(f"No device with IP address {desired_ip} found.")

  1. I am trying to make the device stand alone. it will stream the camera on IP address using MJPEG. Now I am in situation where I might have to change the camera configuration. Right now what planning is I will clearing flash. and reassign it to the device was wondering if there's any optimal way.

Thanks,
Nikul

Hi @nikul

  1. dai.DeviceBootloader(devInfo=device_info).flashClear()
  2. Flashing a different app will override the already flashed app, so you don't have to manually clear the flash.

Thanks,
Jaka

Hi @jakaskerl Thank you for your response.
I have been successfully able to Flash the script on to the desired device using IP address.
I was wondering If i can show both the views since I have OAK-D Pro PoE camera which can produce Active/Passive Stereo view. I want to produce two URL. For example given script make steaming run on 0.0.0.0:0000/img. I want to make two different URL for two different views for example 0.0.0.0:0000/normal and 0.0.0.0:0000/stereo.
Since it is complex for me to marge the functionality your assistance will be really appreciated.
Code
import depthai as dai

import time

# Start defining a pipeline

pipeline = dai.Pipeline()

# Define a source - color camera

cam = pipeline.create(dai.node.ColorCamera)

cam.setFps(30)

cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)

# VideoEncoder

jpeg = pipeline.create(dai.node.VideoEncoder)

jpeg.setDefaultProfilePreset(cam.getFps(), dai.VideoEncoderProperties.Profile.MJPEG)

# Script node

script = pipeline.create(dai.node.Script)

script.setProcessor(dai.ProcessorType.LEON_CSS)

script.setScript("""

import time

import socket

import fcntl

import struct

from socketserver import ThreadingMixIn

from http.server import BaseHTTPRequestHandler, HTTPServer

PORT = 0000

def get_ip_address(ifname):

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

return socket.inet_ntoa(fcntl.ioctl(

s.fileno(),

-1071617759, # SIOCGIFADDR

struct.pack('256s', ifname[:15].encode())

)[20:24])

class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):

pass

class HTTPHandler(BaseHTTPRequestHandler):

def do_GET(self):

if self.path == '/':

self.send_response(200)

self.end_headers()

self.wfile.write(b'<h1>[DepthAI] Hello, world!</h1><p>Click <a href="img">here</a> for an image</p>')

elif self.path == '/img':

try:

self.send_response(200)

self.send_header('Content-type', 'multipart/x-mixed-replace; boundary=--jpgboundary')

self.end_headers()

fpsCounter = 0

timeCounter = time.time()

while True:

jpegImage = node.io['jpeg'].get()

self.wfile.write("--jpgboundary".encode())

self.wfile.write(bytes([13, 10]))

self.send_header('Content-type', 'image/jpeg')

self.send_header('Content-length', str(len(jpegImage.getData())))

self.end_headers()

self.wfile.write(jpegImage.getData())

self.end_headers()

fpsCounter = fpsCounter + 1

if time.time() - timeCounter > 1:

node.warn(f'FPS: {fpsCounter}')

fpsCounter = 0

timeCounter = time.time()

except Exception as ex:

node.warn(str(ex))

with ThreadingSimpleServer(("", PORT), HTTPHandler) as httpd:

node.warn(f"Serving at {get_ip_address('re0')}:{PORT}")

httpd.serve_forever()

""")

# Connections

cam.video.link(jpeg.input)

jpeg.bitstream.link(script.inputs['jpeg'])

desired_ip = "0.0.0.0"

device_infos = dai.Device.getAllAvailableDevices()

device_infos = [device_info for device_info in device_infos if device_info.name == desired_ip]

if device_infos:

device_info = device_infos[0]

print(device_info)

if device_info.state != dai.XLinkDeviceState.X_LINK_BOOTLOADER:

print("Device already in FLASH state, removing existing flash...")

dai.DeviceBootloader(devInfo=device_info).flashClear()

print('Successfully cleared bootloader flash')

progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

dai.DeviceBootloader(devInfo=device_info).flash(progress, pipeline)

print("Flashing completed.")

else:

print(f"No device with IP address {desired_ip} found.")

Thank you.
Nikul

Hi @nikul
I'm going to attach a script which did a similar thing, but with different stages of NN. Couldn't find the discussion in which this was posted, so I'm only positing code. Hope it helps in understanding.

import depthai as dai
import time
import blobconverter
from pathlib import Path

# modelOL = blobconverter.from_zoo(name="mobile_object_localizer_192x192", zoo_type="depthai", shaves=6)
modelSSD = blobconverter.from_zoo(name="mobilenet-ssd", shaves=6)
fire_model_path = "/Users/jaka/Desktop/tests/multimodel_scripts/models/fire-detection_openvino_2021.2_5shave.blob"

SW_VERSION = "SSD_FireDet"

# Start defining a pipeline
pipeline = dai.Pipeline()

pipeline.setOpenVINOVersion(version = dai.OpenVINO.VERSION_2021_4)

# Color camera
cam = pipeline.create(dai.node.ColorCamera)
cam.setInterleaved(False)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
cam.setIspScale(1,3)
# cam.setPreviewSize(640, 640)
# cam.setVideoSize(640, 640)
cam.setFps(5)

# Define a neural network Mobilenet-ssd
nn_mssd = pipeline.create(dai.node.MobileNetDetectionNetwork)
nn_mssd.setConfidenceThreshold(0.5)
nn_mssd.setBlobPath(modelSSD)
nn_mssd.setNumInferenceThreads(2)
nn_mssd.input.setBlocking(False)

# Define input image to nn_MobilenetSSD
manip_mssd = pipeline.createImageManip()
manip_mssd.setResize(300,300)
manip_mssd.setMaxOutputFrameSize(270000) # 300x300x3
manip_mssd.initialConfig.setFrameType(dai.RawImgFrame.Type.RGB888p)

# Define a neural network Fire Detection
nn_fire = pipeline.create(dai.node.NeuralNetwork)
# nn_fire.setConfidenceThreshold(0.5)
nn_fire.setBlobPath(fire_model_path)
nn_fire.input.setBlocking(False)

# Define input image to nn_FireDetection
manip_fire = pipeline.createImageManip()
manip_fire.setResize(224,224)
manip_fire.setMaxOutputFrameSize(150528) # 224x224x2
manip_fire.initialConfig.setFrameType(dai.RawImgFrame.Type.RGB888p)

#define a script node
script = pipeline.create(dai.node.Script)
script.setProcessor(dai.ProcessorType.LEON_CSS)

#Define a video encoder
videoEnc = pipeline.create(dai.node.VideoEncoder)
videoEnc.setDefaultProfilePreset(30, dai.VideoEncoderProperties.Profile.MJPEG)

# Links
cam.preview.link(manip_mssd.inputImage)
manip_mssd.out.link(nn_mssd.input)

cam.preview.link(manip_fire.inputImage)
manip_fire.out.link(nn_fire.input)

script.inputs['detSSD'].setBlocking(False)
script.inputs['detSSD'].setQueueSize(1)
nn_mssd.out.link(script.inputs["detSSD"])

script.inputs['detFire'].setBlocking(False)
script.inputs['detFire'].setQueueSize(1)
nn_fire.out.link(script.inputs["detFire"])

script.inputs['frame'].setBlocking(False)
script.inputs['frame'].setQueueSize(1)
videoEnc.bitstream.link(script.inputs['frame'])

cam.video.link(videoEnc.input)

script.setScript("""
import socket
import time
import threading

serverFrame = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverFrame.bind(("0.0.0.0", 5010))
serverFrame.listen()

serverSSD = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverSSD.bind(("0.0.0.0", 5011))
serverSSD.listen()

serverFire = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverFire.bind(("0.0.0.0", 5012))
serverFire.listen()

node.warn("Server up")

labelMap_SSD = ["background", "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow",
                "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]

label_fire = ["fire", "normal", "smoke"]

client_connections = {
    "frame": [],
    "ssd": [],
    "fire": []
}

def send_frame_thread():
    try:
        while True:
            pck = node.io["frame"].tryGet()
            # log shape
            if not pck:
                continue
            node.warn(f"Frame shape: {pck.getData().shape}")
            data = pck.getData()
            ts = pck.getTimestamp()
            
            header = f"ABCDE " + str(ts.total_seconds()).ljust(18) + str(len(data)).ljust(8)

            for conn in client_connections["frame"]:
                try:
                    conn.send(bytes(header, encoding='ascii'))
                    conn.send(data)
                except Exception as e:
                    node.warn(f"Frame client disconnected: {e}")
                    client_connections["frame"].remove(conn)
                    conn.close()
    except Exception as e:
        node.warn(f"Error oak: {e}")

def send_result_nn(type):
    try:
        while True:
            pck = node.io["frame"].tryGet()
            if not pck:
                continue
            data = pck.getData()
            node.warn(f"Frame shape: {pck.getData().shape}")
            ts = pck.getTimestamp()
            data_to_send = []

            if type == 1:  # SSD
                detections_ssd = node.io["detSSD"].tryGet()
                if detections_ssd:
                    dets = detections_ssd.detections
                    for det in dets:
                        label = labelMap_SSD[det.label]
                        if label == "person":
                            det_bb = [det.label, det.xmin, det.ymin, det.xmax, det.ymax]
                            data_to_send.append(det_bb)

                for conn in client_connections["ssd"]:
                    try:
                        header = f"ABCDE " + str(ts.total_seconds()).ljust(18) + str(len(data)).ljust(8) + str(data_to_send).ljust(224)
                        conn.send(bytes(header, encoding='ascii'))
                        conn.send(data)
                    except Exception as e:
                        node.warn(f"SSD client disconnected: {e}")
                        client_connections["ssd"].remove(conn)
                        conn.close()

            elif type == 2:  # Fire Detection
                data_fire = node.io["detFire"].tryGet()
                if data_fire:
                    data_to_send = data_fire.getLayerFp16("final_result")

                for conn in client_connections["fire"]:
                    try:
                        header = f"ABCDE " + str(ts.total_seconds()).ljust(18) + str(len(data)).ljust(8) + str(data_to_send).ljust(224)
                        conn.send(bytes(header, encoding='ascii'))
                        conn.send(data)
                    except Exception as e:
                        node.warn(f"Fire Detection client disconnected: {e}")
                        client_connections["fire"].remove(conn)
                        conn.close()

    except Exception as e:
        node.warn(f"Error oak: {e}")
    
def get_thread(server, type):
    try:
        while True:
            conn, client = server.accept()
            node.warn(f"Connected to client IP: {client}, type: {type}")
            if type == 0:
                client_connections["frame"].append(conn)
                threading.Thread(target=send_frame_thread).start()
            elif type == 1:
                client_connections["ssd"].append(conn)
                threading.Thread(target=send_result_nn, args=(type, )).start()
            elif type == 2:
                client_connections["fire"].append(conn)
                threading.Thread(target=send_result_nn, args=(type, )).start()
    except Exception as e:
        node.warn("Server error:", e)

threading.Thread(target=get_thread, args=(serverFrame, 0)).start()
threading.Thread(target=get_thread, args=(serverSSD, 1)).start()
threading.Thread(target=get_thread, args=(serverFire, 2)).start()

""")

Thanks,
Jaka

Hi @jakaskerl Thank you for your response I will look into it and will try to figure the way out.
however I am stuck in on other problem. I really appreciate your help in this.

Here is snap of my code where I am working.

device_info = dai.DeviceInfo("0.0.0.0")

if device_info:

with dai.Device(pipeline, device_info) as device:

        while not device.isClosed():

            time.sleep(1)

else:

    print(f"No device with IP address {device_info.name} found.")


if device_info:

    progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

    dai.DeviceBootloader(devInfo=device_info).flash(progress, pipeline)

    print("Flashing completed.")

else:

    print(f"No device with IP address {device_info.name} found.")

Above code does flash the script to the specific device. but the part where don't really flash and I just want to stream on my machine is not really working. throwing the following error

Or

Use constructor taking 'UsbSpeed' instead

with dai.Device(pipeline, device_info) as device:

however device is available I do have checked.

2. I am making a camera stand alone device. I will be trying different focus and different resolution based on my requirement. for now what I am planning is I will stream it in my system first once I am done, with all the setting I will flash it at single shot. That's what first question is about. However i am still looking for optimum solution of this if you can suggest something different that be great.

  1. Sometime camera view fluctuates,.

    Hi @nikul
    A single device cannot be used by both the deviceBootloader and the dai.Device(). After exiting the context of these two functions, the device will reboot which will cause the error you are experiencing.

    nikul 2. I am making a camera stand alone device. I will be trying different focus and different resolution based on my requirement. for now what I am planning is I will stream it in my system first once I am done, with all the setting I will flash it at single shot. That's what first question is about. However i am still looking for optimum solution of this if you can suggest something different that be great.

    Optimum solution for what exactly? Streaming or setting the resolution, etc..?

    nikul Sometime camera view fluctuates,.

    What do you mean by fluctuates?

    Thanks,
    Jaka

      jakaskerl
      Hi @jakaskerl

      1. I am looking for way to view the camera(stream using mjpeg) on localhost before I flash the setting(Res,Focus,etc) into the device. The way I am flashing specific device using IP address. I want to view specific IP address instead of available device.
        this not really working getting the error I shared with you earlier in this discussion.
        # Specify MXID, IP Address or USB path

        device_info = depthai.DeviceInfo("14442C108144F1D000") # MXID

        #device_info = depthai.DeviceInfo("192.168.1.44") # IP Address

        #device_info = depthai.DeviceInfo("3.3.3") # USB port name

        with depthai.Device(pipeline, device_info) as device:

        # ...

      2. Apologies, I meant streaming is flickering .My observation says it happens when I use camera as standalone device not when I use my system as host.

        nikul

        nikul The way I am flashing specific device using IP address. I want to view specific IP address instead of available device.

        Coudly elaborate more, I'm still quite unsure of what you goal is. IP address is accessed through name property of the deviceInfo object.

        nikul Apologies, I meant streaming is flickering .My observation says it happens when I use camera as standalone device not when I use my system as host.

        Can you send a screenshot/video of this happening?

        Thanks,
        Jaka

          jakaskerl Thank you for getting back.

          1. here is the recorded video of camera behavior on stand alone mode.
          video.mp4
          8MB
          1. Here is the script which basically sets MJPEG server with both views (normal and stereo). I am not sure weather or not it will work, but currently it is taking random device from the network since have both OAK-1 and OAK-D-Pro it select OAK 1 from the network and trying to run the given script causing error like this one.

            Note: Even though if I disconnect all the device and just keep OAK-D-Pro PoE it still say failed to find the device even though its connected when i check the status.

            Script : GitHub (GPT generated)

            You did mention something like this. Apologies if still repeating the same mistake unconsciously

          A single device cannot be used by both the deviceBootloader and the dai.Device(). After exiting the context of these two functions, the device will reboot which will cause the error you are experiencing.

          1. This simple example of depth preview is not working for me.
            https://github.com/luxonis/depthai-python/blob/main/examples/StereoDepth/depth_preview.py

          Getting this error even after getting sure that its connected.

          HI @nikul
          I tested you script and it works great on Oak-D-Pro Poe. It does not flicker at all. Are you experiencing the flickering in host mode or just in standalone? Does it help removing the color_cam.initialControl.setManualFocus(100) # 0..255?

          "0.0.0.0" IP won't work, you have to specify the IP of the device directly. Camera not detected error stems from the fact that OAK-1 poe only has 1 camera (on socket 0). Stereo needs cameras on socket 1 and 2.

          Thanks,
          Jaka

            jakaskerl
            I tested you script and it works great on Oak-D-Pro Poe. It does not flicker at all. Are you experiencing the flickering in host mode or just in standalone? Does it help removing the color_cam.initialControl.setManualFocus(100) # 0..255?

            It flickers only on Standalone. I have applied the same code to the all my four OAK PoE cameras however effect of this code color_cam.initialControl.setManualFocus(100) # 0..255is only appearing on OAK-D-Pro. and none other.

            "0.0.0.0" IP won't work, you have to specify the IP of the device directly. Camera not detected error stems from the fact that OAK-1 poe only has 1 camera (on socket 0). Stereo needs cameras on socket 1 and 2.

            0.0.0.0 is just for security purpose I am using device IP while running in into my system. I aware of the fact that I need OAK-D or OAK-D-Pro to stream depth view. i do have both of them connected to my network.

            Hi @nikul
            Which Oak-D-pro Poe is this? This is what /examples/ColorCamera/rgb_preview.py prints out for a camera I tested and which had no issues with flickering:

            Connected cameras: [{socket: CAM_A, sensorName: IMX378, width: 4056, height: 3040, orientation: AUTO, supportedTypes: [COLOR], hasAutofocus: 1, hasAutofocusIC: 1, name: color}, {socket: CAM_B, sensorName: OV9282, width: 1280, height: 800, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, hasAutofocusIC: 0, name: left}, {socket: CAM_C, sensorName: OV9282, width: 1280, height: 800, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, hasAutofocusIC: 0, name: right}]
            Usb speed: UNKNOWN
            Bootloader version: 0.0.26
            Device name: OAK-D-PRO-POE  Product name: OAK-D-PRO-POE-AF

            I flashed the application you have sent to the device and experienced no issues.

            Thanks,
            Jaka

            @jakaskerl
            Hi, Thank you for getting back.
            Can I set the focus manually. To the OAK 1.
            Here is description of my device.
            [{socket: CAM_A, sensorName: IMX378, width: 4056, height: 3040, orientation: AUTO, supportedTypes: [COLOR], hasAutofocus: 0, hasAutofocusIC: 1, name: color}]

            Thank you @jakaskerl
            1. I am unable to setManualFocus with this.
            # Start defining a pipeline

            pipeline = dai.Pipeline()

            # Define a source - color camera

            cam = pipeline.create(dai.node.ColorCamera)

            cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)

            cam.initialControl.setManualFocus(2)

            [{socket: CAM_A, sensorName: IMX378, width: 4056, height: 3040, orientation: AUTO, supportedTypes: [COLOR], hasAutofocus: 0, hasAutofocusIC: 1, name: color}, {socket: CAM_B, sensorName: OV9282, width: 1280, height: 800, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, hasAutofocusIC: 0, name: left}, {socket: CAM_C, sensorName: OV9282, width: 1280, height: 800, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, hasAutofocusIC: 0, name: right}]

            This camera does comes with Auto Focus features.
            https://docs.luxonis.com/projects/hardware/en/latest/pages/NG9097pro/

            1. I am getting error while installing depthAI viewer.
            Requirement already satisfied: pip in c:\users\nikunayi\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages\depthai_viewer\venv-0.1.6\lib\site-packages (23.2.1)
            
            Collecting pip
            
            Obtaining dependency information for pip from https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl.metadata
            
            Downloading pip-24.0-py3-none-any.whl.metadata (3.6 kB)
            
            Downloading pip-24.0-py3-none-any.whl (2.1 MB)
            
            ---------------------------------------- 2.1/2.1 MB 9.6 MB/s eta 0:00:00
            
            Installing collected packages: pip
            
            Attempting uninstall: pip
            
            Found existing installation: pip 23.2.1
            
            Uninstalling pip-23.2.1:
            
              Successfully uninstalled pip-23.2.1
            
            Successfully installed pip-24.0
            
            Looking in indexes: https://pypi.org/simple, https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/
            
            Collecting depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475
            
            Using cached https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/depthai-sdk/depthai_sdk-1.13.1.dev0%2Bb0340e0c4ad869711d7d5fff48e41c46fe41f475-py3-none-any.whl (225 kB)
            
            Collecting opencv-contrib-python>4 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached opencv_contrib_python-4.9.0.80-cp37-abi3-win_amd64.whl.metadata (20 kB)
            
            Collecting blobconverter>=1.4.1 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached blobconverter-1.4.2-py3-none-any.whl.metadata (7.5 kB)
            
            Collecting pytube>=12.1.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached pytube-15.0.0-py3-none-any.whl (57 kB)
            
            Collecting depthai==2.22.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached depthai-2.22.0.0-cp311-cp311-win_amd64.whl.metadata (8.9 kB)
            
            Collecting PyTurboJPEG==1.6.4 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached PyTurboJPEG-1.6.4-py3-none-any.whl
            
            Collecting marshmallow==3.17.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached marshmallow-3.17.0-py3-none-any.whl (48 kB)
            
            Collecting xmltodict (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
            
            Collecting sentry-sdk==1.21.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached sentry_sdk-1.21.0-py2.py3-none-any.whl (199 kB)
            
            Collecting depthai-pipeline-graph==0.0.5 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached depthai_pipeline_graph-0.0.5-py3-none-any.whl.metadata (8.8 kB)
            
            Collecting ahrs==0.3.1 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached AHRS-0.3.1-py3-none-any.whl (197 kB)
            
            Collecting numpy>=1.21 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached numpy-1.26.3-cp311-cp311-win_amd64.whl.metadata (61 kB)
            
            Collecting Qt.py>=1.3.0 (from depthai-pipeline-graph==0.0.5->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached Qt.py-1.3.10-py2.py3-none-any.whl.metadata (25 kB)
            
            Collecting packaging>=17.0 (from marshmallow==3.17.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
            
            Collecting certifi (from sentry-sdk==1.21.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
            
            Collecting urllib3>=1.26.11 (from sentry-sdk==1.21.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached urllib3-2.2.0-py3-none-any.whl.metadata (6.4 kB)
            
            Collecting requests (from blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
            
            Collecting PyYAML (from blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached PyYAML-6.0.1-cp311-cp311-win_amd64.whl.metadata (2.1 kB)
            
            Collecting boto3 (from blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Downloading boto3-1.34.34-py3-none-any.whl.metadata (6.6 kB)
            
            Collecting types-PySide2 (from Qt.py>=1.3.0->depthai-pipeline-graph==0.0.5->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached types_pyside2-5.15.2.1.6-py2.py3-none-any.whl.metadata (8.1 kB)
            
            Collecting botocore<1.35.0,>=1.34.34 (from boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Downloading botocore-1.34.34-py3-none-any.whl.metadata (5.7 kB)
            
            Collecting jmespath<2.0.0,>=0.7.1 (from boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached jmespath-1.0.1-py3-none-any.whl (20 kB)
            
            Collecting s3transfer<0.11.0,>=0.10.0 (from boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached s3transfer-0.10.0-py3-none-any.whl.metadata (1.7 kB)
            
            Collecting charset-normalizer<4,>=2 (from requests->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl.metadata (34 kB)
            
            Collecting idna<4,>=2.5 (from requests->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached idna-3.6-py3-none-any.whl.metadata (9.9 kB)
            
            Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.35.0,>=1.34.34->boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
            
            Collecting urllib3>=1.26.11 (from sentry-sdk==1.21.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached urllib3-2.0.7-py3-none-any.whl.metadata (6.6 kB)
            
            Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.35.0,>=1.34.34->boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
            
            Using cached depthai-2.22.0.0-cp311-cp311-win_amd64.whl (10.0 MB)
            
            Using cached depthai_pipeline_graph-0.0.5-py3-none-any.whl (123 kB)
            
            Using cached blobconverter-1.4.2-py3-none-any.whl (10 kB)
            
            Using cached numpy-1.26.3-cp311-cp311-win_amd64.whl (15.8 MB)
            
            Using cached opencv_contrib_python-4.9.0.80-cp37-abi3-win_amd64.whl (45.3 MB)
            
            Using cached packaging-23.2-py3-none-any.whl (53 kB)
            
            Using cached Qt.py-1.3.10-py2.py3-none-any.whl (34 kB)
            
            Downloading boto3-1.34.34-py3-none-any.whl (139 kB)
            
            ---------------------------------------- 139.3/139.3 kB 1.0 MB/s eta 0:00:00
            
            Using cached certifi-2024.2.2-py3-none-any.whl (163 kB)
            
            Using cached PyYAML-6.0.1-cp311-cp311-win_amd64.whl (144 kB)
            
            Using cached requests-2.31.0-py3-none-any.whl (62 kB)
            
            Downloading botocore-1.34.34-py3-none-any.whl (11.9 MB)
            
            ---------------------------------------- 11.9/11.9 MB 19.8 MB/s eta 0:00:00
            
            Using cached urllib3-2.0.7-py3-none-any.whl (124 kB)
            
            Using cached charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl (99 kB)
            
            Using cached idna-3.6-py3-none-any.whl (61 kB)
            
            Using cached s3transfer-0.10.0-py3-none-any.whl (82 kB)
            
            Using cached types_pyside2-5.15.2.1.6-py2.py3-none-any.whl (572 kB)
            
            Installing collected packages: types-PySide2, xmltodict, urllib3, six, Qt.py, PyYAML, pytube, packaging, numpy, jmespath, idna, depthai, charset-normalizer, certifi, sentry-sdk, requests, PyTurboJPEG, python-dateutil, opencv-contrib-python, marshmallow, depthai-pipeline-graph, ahrs, botocore, s3transfer, boto3, blobconverter, depthai-sdk
            
            Creating virtual environment...
            
            Error occurred during dependency installation: Command '['C:\\Users\\nikunayi\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\depthai_viewer\\venv-0.1.6\\Scripts\\python', '-m', 'pip', 'install', 'depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475', '--extra-index-url', 'https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/']' returned non-zero exit status 1.
            
            Traceback (most recent call last):
            
            File "C:\Users\nikunayi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\depthai_viewer\install_requirements.py", line 85, in create_venv_and_install_dependencies
            
            subprocess.run(
            
            File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 571, in run
            
            raise CalledProcessError(retcode, process.args,
            
            subprocess.CalledProcessError: Command '['C:\\Users\\nikunayi\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\depthai_viewer\\venv-0.1.6\\Scripts\\python', '-m', 'pip', 'install', 'depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475', '--extra-index-url', 'https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/']' returned non-zero exit status 1.
            
            Deleting partially created virtual environment: C:\Users\nikunayi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\depthai_viewer\venv-0.1.6
            
            Requirement already satisfied: pip in c:\users\nikunayi\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages\depthai_viewer\venv-0.1.6\lib\site-packages (23.2.1)
            
            Collecting pip
            
            Obtaining dependency information for pip from https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl.metadata
            
            Using cached pip-24.0-py3-none-any.whl.metadata (3.6 kB)
            
            Using cached pip-24.0-py3-none-any.whl (2.1 MB)
            
            Installing collected packages: pip
            
            Attempting uninstall: pip
            
            Found existing installation: pip 23.2.1
            
            Uninstalling pip-23.2.1:
            
              Successfully uninstalled pip-23.2.1
            
            Successfully installed pip-24.0
            
            Looking in indexes: https://pypi.org/simple, https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/
            
            Collecting depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475
            
            Using cached https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/depthai-sdk/depthai_sdk-1.13.1.dev0%2Bb0340e0c4ad869711d7d5fff48e41c46fe41f475-py3-none-any.whl (225 kB)
            
            Collecting opencv-contrib-python>4 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached opencv_contrib_python-4.9.0.80-cp37-abi3-win_amd64.whl.metadata (20 kB)
            
            Collecting blobconverter>=1.4.1 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached blobconverter-1.4.2-py3-none-any.whl.metadata (7.5 kB)
            
            Collecting pytube>=12.1.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached pytube-15.0.0-py3-none-any.whl (57 kB)
            
            Collecting depthai==2.22.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached depthai-2.22.0.0-cp311-cp311-win_amd64.whl.metadata (8.9 kB)
            
            Collecting PyTurboJPEG==1.6.4 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached PyTurboJPEG-1.6.4-py3-none-any.whl
            
            Collecting marshmallow==3.17.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached marshmallow-3.17.0-py3-none-any.whl (48 kB)
            
            Collecting xmltodict (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
            
            Collecting sentry-sdk==1.21.0 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached sentry_sdk-1.21.0-py2.py3-none-any.whl (199 kB)
            
            Collecting depthai-pipeline-graph==0.0.5 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached depthai_pipeline_graph-0.0.5-py3-none-any.whl.metadata (8.8 kB)
            
            Collecting ahrs==0.3.1 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached AHRS-0.3.1-py3-none-any.whl (197 kB)
            
            Collecting numpy>=1.21 (from depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached numpy-1.26.3-cp311-cp311-win_amd64.whl.metadata (61 kB)
            
            Collecting Qt.py>=1.3.0 (from depthai-pipeline-graph==0.0.5->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached Qt.py-1.3.10-py2.py3-none-any.whl.metadata (25 kB)
            
            Collecting packaging>=17.0 (from marshmallow==3.17.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
            
            Collecting certifi (from sentry-sdk==1.21.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
            
            Collecting urllib3>=1.26.11 (from sentry-sdk==1.21.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached urllib3-2.2.0-py3-none-any.whl.metadata (6.4 kB)
            
            Collecting requests (from blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
            
            Collecting PyYAML (from blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached PyYAML-6.0.1-cp311-cp311-win_amd64.whl.metadata (2.1 kB)
            
            Collecting boto3 (from blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached boto3-1.34.34-py3-none-any.whl.metadata (6.6 kB)
            
            Collecting types-PySide2 (from Qt.py>=1.3.0->depthai-pipeline-graph==0.0.5->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached types_pyside2-5.15.2.1.6-py2.py3-none-any.whl.metadata (8.1 kB)
            
            Collecting botocore<1.35.0,>=1.34.34 (from boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached botocore-1.34.34-py3-none-any.whl.metadata (5.7 kB)
            
            Collecting jmespath<2.0.0,>=0.7.1 (from boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached jmespath-1.0.1-py3-none-any.whl (20 kB)
            
            Collecting s3transfer<0.11.0,>=0.10.0 (from boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached s3transfer-0.10.0-py3-none-any.whl.metadata (1.7 kB)
            
            Collecting charset-normalizer<4,>=2 (from requests->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl.metadata (34 kB)
            
            Collecting idna<4,>=2.5 (from requests->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached idna-3.6-py3-none-any.whl.metadata (9.9 kB)
            
            Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.35.0,>=1.34.34->boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
            
            Collecting urllib3>=1.26.11 (from sentry-sdk==1.21.0->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached urllib3-2.0.7-py3-none-any.whl.metadata (6.6 kB)
            
            Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.35.0,>=1.34.34->boto3->blobconverter>=1.4.1->depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475)
            
            Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
            
            Using cached depthai-2.22.0.0-cp311-cp311-win_amd64.whl (10.0 MB)
            
            Using cached depthai_pipeline_graph-0.0.5-py3-none-any.whl (123 kB)
            
            Using cached blobconverter-1.4.2-py3-none-any.whl (10 kB)
            
            Using cached numpy-1.26.3-cp311-cp311-win_amd64.whl (15.8 MB)
            
            Using cached opencv_contrib_python-4.9.0.80-cp37-abi3-win_amd64.whl (45.3 MB)
            
            Using cached packaging-23.2-py3-none-any.whl (53 kB)
            
            Using cached Qt.py-1.3.10-py2.py3-none-any.whl (34 kB)
            
            Using cached boto3-1.34.34-py3-none-any.whl (139 kB)
            
            Using cached certifi-2024.2.2-py3-none-any.whl (163 kB)
            
            Using cached PyYAML-6.0.1-cp311-cp311-win_amd64.whl (144 kB)
            
            Using cached requests-2.31.0-py3-none-any.whl (62 kB)
            
            Using cached botocore-1.34.34-py3-none-any.whl (11.9 MB)
            
            Using cached urllib3-2.0.7-py3-none-any.whl (124 kB)
            
            Using cached charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl (99 kB)
            
            Using cached idna-3.6-py3-none-any.whl (61 kB)
            
            Using cached s3transfer-0.10.0-py3-none-any.whl (82 kB)
            
            Using cached types_pyside2-5.15.2.1.6-py2.py3-none-any.whl (572 kB)
            
            Installing collected packages: types-PySide2, xmltodict, urllib3, six, Qt.py, PyYAML, pytube, packaging, numpy, jmespath, idna, depthai, charset-normalizer, certifi, sentry-sdk, requests, PyTurboJPEG, python-dateutil, opencv-contrib-python, marshmallow, depthai-pipeline-graph, ahrs, botocore, s3transfer, boto3, blobconverter, depthai-sdk
            
            Creating virtual environment...
            
            Error occurred during dependency installation: Command '['C:\\Users\\nikunayi\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\depthai_viewer\\venv-0.1.6\\Scripts\\python', '-m', 'pip', 'install', 'depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475', '--extra-index-url', 'https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/']' returned non-zero exit status 1.
            
            Traceback (most recent call last):
            
            File "C:\Users\nikunayi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\depthai_viewer\install_requirements.py", line 85, in create_venv_and_install_dependencies
            
            subprocess.run(
            
            File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 571, in run
            
            raise CalledProcessError(retcode, process.args,
            
            subprocess.CalledProcessError: Command '['C:\\Users\\nikunayi\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\depthai_viewer\\venv-0.1.6\\Scripts\\python', '-m', 'pip', 'install', 'depthai-sdk==1.13.1.dev0+b0340e0c4ad869711d7d5fff48e41c46fe41f475', '--extra-index-url', 'https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/']' returned non-zero exit status 1.
            
            Deleting partially created virtual environment: C:\Users\nikunayi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\depthai_viewer\venv-0.1.6
            
            
            Thank you.

            jakaskerl

            Hi @Jackmarks Thank you for getting back.

            Couple weeks back when I tried, I was able to set focus. I did not try all the parameters but set focus to 0 and it was all blur.

            Thank you

            Hi @nikul
            Are you sure it was the same camera?
            Try with https://docs.luxonis.com/projects/api/en/latest/samples/ColorCamera/rgb_camera_control/.

            Control:      key[dec/inc]  min..max
              exposure time:     I   O      1..33000 [us]
              sensitivity iso:   K   L    100..1600
              focus:             ,   .      0..255 [far..near]
              white balance:     N   M   1000..12000 (light color temperature K)

            Thanks,
            Jaka

            Turns out the setResolution() also something which not really working for me. whatever perameter I set in my video surveillance system it is showing 1080.

            Also I want to crop the streaming and want to get only center of the video, can you show my how can I apply this considering the code I have provided above.

            Thank you.

              nikul Turns out the setResolution() also something which not really working for me. whatever perameter I set in my video surveillance system it is showing 1080.

              Please add a MRE of this issue so we can pinpoint the culprit.

              nikul Also I want to crop the streaming and want to get only center of the video, can you show my how can I apply this considering the code I have provided above.

              • Create a ImgManip node
              • Link camRgb as input, and pipe the output to whatever you need (streaming/NN/etc)
              • use Imagemanip's manip.initialConfig.setCropRect() or manip.initialConfig.setCenterCrop()
                Keep in mind, values for the second one are normalized (0-1)

              Thanks,
              Jaka