Hi everyone
We have an Arduino setup with a glass to glass measurement method that lets us have a very precise measurement of latency. With this, we have been able to detect that a Luxonis camera has a higher latency compared with a cheaper camera, and we would like your help to see if we can get our Luxonis camera to the absolute minimum in terms of latency.
These are the basic constants of the test:
- 100hz screen
- 1920x1080 capture resolution
- MJPEG output at 52fps (both cameras same format same FPS)
- Screen render with Gstreamer optimized pipeline (same pipeline for both tests)
- Same USB port used, same computer
At 52 fps, one second (1000 ms) divided by 52 gives about 19.2 ms per frame. This means the camera captures a new frame, on average, every 19.2 ms.
If we add a one-frame buffer, the theoretical minimum latency becomes roughly two frame intervals, or about 38–40 ms.
OAK-1 W
Has 54ms of glass to glass latency, with latency peaks around 60-70ms
This is the code
self.dai_pipeline = dai.Pipeline()
self.dai_pipeline.setXLinkChunkSize(0)
cam = self.dai_pipeline.create(dai.node.Camera).build()
# MJPEG encoding on camera
encoder_output = cam.requestOutput(
(width, height),
type=dai.ImgFrame.Type.NV12,
fps=fps,
resizeMode=dai.ImgResizeMode.STRETCH # No cropping, preserve full FOV
)
encoder = self.dai_pipeline.create(dai.node.VideoEncoder).build(
encoder_output,
frameRate=fps,
profile=dai.VideoEncoderProperties.Profile.MJPEG
)
# Set encoder properties for lowest latency
encoder.setNumFramesPool(1) # Minimal frame pool for lower latency
encoder.setQuality(80) # Lower quality for faster encoding
Arduino cam ezBOX-Swift
Uses UVC linux drivers.
It results in around 44ms of glass to glass latency. Almost no peaks in latency, very consistent.
Can we do anything to lower the latency of the Luxonis camera? We have spent many hours in the docs but no results for now.
Thank you