You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I used the depthai-sdk to replay the video after using it to record but I got the async video between depth and color frames as follows
My pencil is already down but the depth not following.
Minimal Reproducible Example
MRE record
import os
from depthai_sdk import OakCamera, RecordType
if __name__ == '__main__':
record_dir = 'record_outputs/sdk'
record_dir = os.path.abspath(record_dir)
if not os.path.exists(record_dir):
os.makedirs(record_dir, exist_ok=True)
with OakCamera() as oak:
color = oak.create_camera('color',
resolution='1080P',
fps=30,
encode='H264')
left = oak.create_camera('left', resolution='480P', fps=30, encode='H264')
right = oak.create_camera('right',
resolution='480P',
fps=30,
encode='H264')
depth = oak.create_stereo(resolution='1080P',
fps=30,
left=left,
right=right)
# Synchronize & save all (encoded) streams
oak.record([
color.out.encoded, left.out.encoded, right.out.encoded,
# depth.out.encoded
], record_dir, RecordType.VIDEO)
# Show color stream
oak.visualize([color.out.camera, depth.out.main], scale=2 / 3, fps=True)
# Blocking is necessary
oak.start(blocking=True)
MRE replay
import os
from depthai_sdk import OakCamera
if __name__ == '__main__':
record_dir = 'record_outputs/sdk/3-1844301041180E1300'
record_dir = os.path.abspath(record_dir)
with OakCamera(replay=record_dir) as oak:
# Created CameraComponent/StereoComponent will use streams from the recording
color = oak.create_camera('color',
resolution='1080P',
fps=30,
encode='H264')
left = oak.create_camera('left', resolution='480P', fps=30, encode='H264')
right = oak.create_camera('right',
resolution='480P',
fps=30,
encode='H264')
depth = oak.create_stereo(resolution='480p',
fps=30,
left=left,
right=right)
# Show color stream
oak.visualize([color.out.camera, depth.out.main], scale=1 / 3, fps=True)
# Blocking is necessary
oak.start(blocking=True)
Expected behavior
The depth image must correspond to the RGB image synchronously.
Hi @li195111 ,
We apologize for the delay. After some debugging, I can confirm this issue, and it seems like it happens at Replay stage (not at Recording stage). I recorded a stopwatch app on a screen, then overlayed left/color frames with script below, and recording seems to be in sync:
We will investigate the reason behind Replay out-of-sync issue.
Thanks, Erik
import cv2
cap_color = cv2.VideoCapture('recordings/2-184430102127631200/color.mp4')
cap_mono = cv2.VideoCapture('recordings/2-184430102127631200/left.mp4')
read = True
while True:
if read:
ret_color, color_frame = cap_color.read()
ret_mono, mono_frame = cap_mono.read()
if ret_color and ret_mono:
color_frame = cv2.cvtColor(color_frame, cv2.COLOR_BGR2RGB)
mono_frame = cv2.cvtColor(mono_frame, cv2.COLOR_BGR2RGB)
mono_frame = cv2.resize(mono_frame, (color_frame.shape[1], color_frame.shape[0]))
print(color_frame.shape, mono_frame.shape)
overlay = cv2.addWeighted(color_frame, 0.5, mono_frame, 0.5, 0)
cv2.imshow('Overlay', cv2.pyrDown(overlay))
else:
break
key = cv2.waitKey(33)
if key == ord('q'):
break
if key == ord(' '):
read = not read
Erol444
changed the title
[BUG] depthai-sdk depth and color video asynrouse
[BUG] depthai-sdk Replay module - depth and color video asynrouse
Mar 1, 2023
Describe the bug

I used the
depthai-sdk
to replay the video after using it to record but I got the async video between depth and color frames as followsMy pencil is already down but the depth not following.
Minimal Reproducible Example
Expected behavior
The depth image must correspond to the RGB image synchronously.
Pipeline Graph
record

replay

Attach system log
log_system_information.json
The text was updated successfully, but these errors were encountered: