As title says. I’m running some very basic code: Python just 3 threads to grab from each one, and then turning recording on.
prev_ts = None
while not exit_app:
if zed.grab() == sl.ERROR_CODE.SUCCESS:
# If needed, add more processing here
# But be aware that any processing involving the GiL will slow down the multi threading performance
curr_ts = zed.get_timestamp(sl.TIME_REFERENCE.IMAGE)
if prev_ts:
gap = curr_ts.get_milliseconds() - prev_ts.get_milliseconds()
if gap > 35:
print("Gap: ", gap)
# print("MS since prev ts", curr_ts.get_milliseconds() - prev_ts.get_milliseconds())
prev_ts = curr_ts
else:
print(f"grab failed")
output_svo_file = f"{filename_prefix}_SN{sn}.svo2"
recording_param = sl.RecordingParameters(output_svo_file.replace(" ", ""), sl.SVO_COMPRESSION_MODE.H264)
record_err = zed.enable_recording(recording_param)
if record_err == sl.ERROR_CODE.SUCCESS:
print(f"{filename_prefix}_SN{sn} Enabled recording")
else:
print(f"ZED SN{sn} Recording initialization error: {record_err}")
zed.close()
return False
print(f"Recording SVO file: {recording_param.video_filename}")
It runs OK when nothing is moving around but then once I start moving the cameras, the “gap” print statement frequently prints e.g. 67, 100, etc, suggesting to me it’s skipping a couple frames. Is there some way to make the encoding faster?
I’ve run
sudo nvpmodel -m 0
as well as sudo jetson_clocks
and that helps a bit.