• Error in record and reply

Hi,

I downloaded repo "GEN2-RECORD-REPLAY" from "https://github.com/luxonis/depthai-experiments/tree/update_record_replay/gen2-record-replay"

When I run "record.py", I have the following error:

Exception has occurred: AttributeError

*

'depthai.CameraBoardSocket' object has no attribute 'upper'

File "C:\Users\wubi\Desktop\depthai-tutorials-master\gen2-record-replay\record.py", line 52, in create_cam cam = oak.create_camera(socket, encode=dai.VideoEncoderProperties.Profile.MJPEG) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\wubi\Desktop\depthai-tutorials-master\gen2-record-replay\record.py", line 95, in <module> cam = create_cam(socket) ^^^^^^^^^^^^^^^^^^ AttributeError: 'depthai.CameraBoardSocket' object has no attribute 'upper'

Could you please help me out here?

Thanks!

Wu Bi

    Oh, sorry, I got it, there is a depthai-sdk[record]==1.11 update to that 'record' part. After install this requirement, it seemed work fine, but after I "ctrl + c", it shows some error message as below:

    line 198, in _run_module_as_main
    
    [2023-07-15 07:30:00] INFO [root._run:34] Exiting store frame thread
    
        return _run_code(code, main_globals, None,
    
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    …..
    
        return cv2.imdecode(packet.msg.getData(), self.flag)
    
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    KeyboardInterrupt

    But this is fine, right?

    Thanks a lot

    Wu Bi

    Further, I run into this error:

    I did try uninstall "depthai-sdk" and install it back and also install "depthai-sdk[record]==1.11", this error still happens, any thoughts?

    [Windows 11 environment with VS Code for testing.]

    thanks!

    Wubi

    Very similar request, I have got a running code from "https://docs.luxonis.com/projects/api/en/latest/samples/VideoEncoder/rgb_encoding/" to record.

    The only thing I need is to display while recording. e.g. "cv2.imshow(frame)". So is it possible to display each frame while recording?
    More specifically, can I display h265Packet as the code snipet below? (Below code is not working)

    *Insert code on rich text bar below is not working well here, so I attached the screen shot.

    Really appreciate your support here, thanks!

    Wu Bi

      Hi biwu
      The errors you are getting are most likely due to version mismatches in your venv. Either SDK, API or cv2.

      You cannot display h265 bit stream since it's encoded and would require you to decode it back to original stream of pixel values (frames). You can display the frames by creating another link from rgb.video to Xlinkout and reading the new queue for video frames.

      Thanks,
      Jaka

      • biwu replied to this.

        jakaskerl

        Thanks a lot, Jaka, I will try creating a new link from rgb.video and I am sure it will work.

        But one further question: if I run one Xlinkout to record as H265 and another Xlinkout to display with both 60 fps at 1080P, do I need to worry about bandwidth? Could you show me a bit on how to roughly calculate the bandwidth I need?

        Thanks and Regards
        Wu Bi

          Hi biwu

          Docs for bandwidth:

          1080P NV12/YUV420 frames: 1920 * 1080 * 1.5 * 60fps * 8bits = 1.5 gbps
          For video encoder, expect about 50% reduction in size = 750mbps

          This is fine for usb3.2 (5gbps) but will be a problem for 1gbps ethernet.

          Thanks,
          Jaka

          • biwu replied to this.