• DepthAI-v2
  • Record Replay using SDK corrupting video

Hi Im using this code to record

import cv2

from depthai_sdk import OakCamera, RecordTypefrom depthai_sdk.classes import FramePacket

with OakCamera() as oak: color = oak.create_camera('color', resolution='1080P', encode='H265') left = oak.create_camera('left', resolution='800p', encode='H265') right = oak.create_camera('right', resolution='800p', encode='H265')
# Synchronize & save all (encoded) streams oak.record([color.out.main, left.out.main, right.out.main], './', RecordType.VIDEO) def cb(packet: FramePacket): cv2.imshow(packet.name, packet.frame)
# Show color stream vis = oak.visualize([color.out.camera,left.out.camera,right.out.camera], scale=2/3, fps=True , callback=cb) oak.start(blocking=True)

However the recording is corrupted can only 1 or 2 frames here and there.

when trying to replay using the sdk im getting

[hevc @ 0x127298a00] Could not find ref with POC 12

[hevc @ 0x1179aae00] Could not find ref with POC 14

[hevc @ 0x117a06c00] Could not find ref with POC 12

Have you tried:

 oak.record([color.out.encoded, left.out.encoded, right.out.encoded], './', RecordType.VIDEO)

    Hi OzayrMoorad

    from depthai_sdk import OakCamera, RecordType
    from depthai_sdk.classes import FramePacket
    import cv2
    
    
    def cb(packet: FramePacket): 
        cv2.imshow(packet.name, packet.frame)
    
    
    with OakCamera() as oak:
        color = oak.create_camera('color', resolution='1080P', fps=10, encode='H265')
        left = oak.create_camera('left', resolution='800p', fps=10, encode='H265')
        right = oak.create_camera('right', resolution='800p', fps=10, encode='H265')
    
        stereo = oak.create_stereo(left=left, right=right)
        nn = oak.create_nn('mobilenet-ssd', color, spatial=stereo)
    
        # Sync & save all (encoded) streams
        oak.record([color.out.encoded, left.out.encoded, right.out.encoded], './record', RecordType.VIDEO)
        # Show color stream 
        oak.visualize([color.out.camera,left.out.camera,right.out.camera], scale=2/3, fps=True , callback=cb)
    
        oak.start(blocking=True)

    Does this code not work for you? It's probably a version issue. Update both depthai and depthai_sdk to the latest version.

    Thanks,
    Jaka