L
luxd

  • 19 Mar
  • Joined Jun 20, 2023
  • 0 best answers
  • @luxd I am not completely sure what you mean. If you want to just check if there's a frame (and not remove it), you should use if outputQueue.has(): instead of get/tryGet (which removes msg from queue).

  • @luxd
    I am not sure how fast you call UpdateFrame() - if there's while True: UpdateFrame() then that'd be hotlooping, but that wouldn't result in issue anyways.

    There were quite some changes yes, some also improved stability, so I'd suggest using latest depthai version either way.

    • luxd replied to this.
    • @luxd I see, perhaps that was lost when i converted it to python via chatgpt. Yes, setting (all) queues blocking to false should eliminate this. As long as you're reading fast enough it doesn't matter. Since you have only 1 queue you could also use blocking .get() to preserve CPU cycles (you're hotlooping otherwise).
      You can try to also increase maxSize, it would help if some queue gets filled up, yes.

      • luxd replied to this.
      • @luxd not sure if it's relevant, but why don't you save the device instance? i converted it to python (via gpt) and used standard with Device(pipeline) as device: to init pipeline, and it works as expected...

      • Hi @luxd , this works as expected for me:

        #!/usr/bin/env python3
        
        import cv2
        import depthai as dai
        
        pipeline = dai.Pipeline()
        camRgb = pipeline.create(dai.node.ColorCamera)
        xoutVideo = pipeline.create(dai.node.XLinkOut)
        xoutVideo.setStreamName("video")
        camRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
        camRgb.video.link(xoutVideo.input)
        
        with dai.Device(pipeline) as device:
        
            video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
        
            while True:
                imgFrame: dai.ImgFrame = video.get()
        
                print(imgFrame.getColorTemperature(), imgFrame.getSensitivity())
                cv2.imshow("video", imgFrame.getCvFrame())
        
                if cv2.waitKey(1) == ord('q'):
                    break
        • luxd replied to this.
        • Hi @luxd

          1. No, it's not capped anymore.
          2. Yes, you can just update to depthai 2.24 and set the fps to a lot.

          Thanks,
          Jaka

        • Hi @luxd, could you please let me know also how did you save using VideoWrite, I am facing few issues such as speed seems to be to 2x~3x