depthai: [BUG] Can't change FPS on OAK-D-Lite
I can’t change the FPS on the OAK-D-Lite (but I can on OAK-D).
I used the code from here and i added the highlighed lines:
#!/usr/bin/env python3
import cv2
import depthai as dai
# Create pipeline
pipeline = dai.Pipeline()
# Define source and output
camRgb = pipeline.create(dai.node.ColorCamera)
xoutRgb = pipeline.create(dai.node.XLinkOut)
xoutRgb.setStreamName("rgb")
# Properties
camRgb.setPreviewSize(300, 300)
camRgb.setInterleaved(False)
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
# -------------------- ADDED LINES --------------------
print(f"FPS before: {camRgb.getFps()}")
camRgb.setFps(60)
print(f"FPS after: {camRgb.getFps()}")
# -----------------------------------------------------
# Linking
camRgb.preview.link(xoutRgb.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
print("Connected cameras: ", device.getConnectedCameras())
# Print out usb speed
print("Usb speed: ", device.getUsbSpeed().name)
# Output queue will be used to get the rgb frames from the output defined above
qRgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
while True:
inRgb = qRgb.get() # blocking call, will wait until a new data has arrived
# Retrieve 'bgr' (opencv format) frame
cv2.imshow("rgb", inRgb.getCvFrame())
if cv2.waitKey(1) == ord("q"):
break
I tested the same code with OAK-D and OAK-D-Lite. After setting the new value for fps, the output of camRgb.getFps()
is the same for both the devices, but only the OAK-D actually changes the fps, whereas the OAK-D-Lite doesn’t change the fps.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 17 (1 by maintainers)
Sorry about the trouble. Yes, I think OAK-D-Lite FPS is locked right now as a result of an underlying implementation bug or lacking.
Will circle back.
@JojoDevel Apologies for the delay, it’s implemented now on https://github.com/luxonis/depthai-python/pull/566
@JojoDevel We should get configurable and higher FPS for OV7251 mono (at least 60 fps) in about 2 weeks. Then need to look on getting better configs for IMX214 color to achieve 60fps at 1080p. For OV7251, 200 FPS will also be supported (was tested experimentally), but we need some more work on lowering the 3A calculation rate (every N frames) at this high FPS.
35 FPS seems to work for color on OAK-D Lite with new release
2.15.0
https://github.com/luxonis/depthai-python/releases/tag/v2.15.0.0 👍 However, mono FPS change is is still not implemented.This is not implemented yet, but work in progress (RGB only for now) on the branch
cfg_fps_lite
(current commit). IMX214 is capable of 1080p@60fps, but at the moment the camera configs we use are limiting the FPS to:Also note here the pipeline is just statically configured on the host system, there is no interaction with the device and the device type is not known:
Only at this point it reaches the device:
with dai.Device(pipeline) as device:
and warnings should be printed on OAK-D Lite that FPS change is not implemented (note the warning wasn’t removed yet on the branchcfg_fps_lite
).