Hi erik, thanks for the help.
25-30fps would be fine for my use case.
I've tried adapting the code indepthai-python/examples/UVC/uvc_rgb.py
to the parameters you provided, but nothing changed in terms of framerate, it's still around 1-2fps (on USB2.0).
I've tried instead to run other examples such as depthai-python/examples/ColorCamera/rgb_preview.py
#!/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(1280, 720)
camRgb.setInterleaved(False)
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
# Linking
camRgb.preview.link(xoutRgb.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
print('Connected cameras:', device.getConnectedCameraFeatures())
# Print out usb speed
print('Usb speed:', device.getUsbSpeed().name)
# Bootloader version
if device.getBootloaderVersion() is not None:
print('Bootloader version:', device.getBootloaderVersion())
# Device name
print('Device name:', device.getDeviceName(), ' Product name:', device.getProductName())
# 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 can get a decent ~25fps, but now I would like to have it encoded over RTSP, so that it can be played in VLC or GStreamer.
Do you have any ideias on how I can do this?
I've noticed you can get encoded data from the camera as shown in depthai-python/examples/rgb_encoding/rgb_encoding.py
maybe there is a way to convert this to RTSP instead of writing to a file?