depthai
depthai copied to clipboard
[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.
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.
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:
- 0.735 .. 35 for 1080p
- 1.4 .. 28.5 (TODO why not 30) for 4K/12MP/13MP
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:
print(f"FPS before: {camRgb.getFps()}")
camRgb.setFps(60)
print(f"FPS after: {camRgb.getFps()}")
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 branch cfg_fps_lite
).
Is there a schedule for this to be supported officially? Would be really nice having color and depth @ 60fps
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 :+1: However, mono FPS change is is still not implemented.
@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.
That sounds amazing :rocket: Looking very much forward to that :+1:
@alex-luxonis Any news on higher framerates?
@alex-luxonis any progress on the fps?
@JojoDevel Apologies for the delay, it's implemented now on https://github.com/luxonis/depthai-python/pull/566
I installed depthai-2.17.3.1
, but with OAK-D Lite but I get [18443010C1818F0E00] [1.1] [141.182] [system] [warning] ColorCamera IMX214: capping FPS for selected resolution to 35
.
For IMX214, the camera configs still have the FPS limitations mentioned in the comment above: https://github.com/luxonis/depthai/issues/624#issuecomment-1026029818
Will ever be possible to have more fps on IMX214M?
Hi, I got the same issue on OAK-D Lite after I ran the examples/Yolo/tiny_yolo.py
[1844301041180E1300] [20.1] [398.391] [system] [warning] ColorCamera IMX214: capping FPS for selected resolution to 35
The first time I ran the examples/ColorCamera/rgb_preview.py
it approached 60 FPS and no warning came out.
Then I ran the examples/Yolo/tiny_yolo.py
and the warning came out
After that, I ran the examples/ColorCamera/rgb_preview.py
again and the warning was still there and FPS can't be up to 60
@li195111 how did you calculate the FPS it approached?
@brentonjackson I use count / (time.monotonic() - start_time)
Hi all. I understand then that the OAK D Lite cannot be set to 60 fps for the RGB camera then?
@BiomechatronicsRookie
Hi all. I understand then that the OAK D Lite cannot be set to 60 fps for the RGB camera then?
Correct - for RGB, 35FPS is the limit - for the time being