question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] FPS of the OAK-D RGB camera doesn't exceed 12

See original GitHub issue

Even though I have set the FPS at 60, when I re-check the FPS rate with time and , it fails to exceed 12 FPS.

Steps to reproduce the behavior:

  1. Run script (Given below)
#!/usr/bin/env python3

import cv2
import depthai as dai
import time

# Create pipeline
pipeline = dai.Pipeline()

# Define source and output
camRgb = pipeline.create(dai.node.ColorCamera)
xoutVideo = pipeline.create(dai.node.XLinkOut)

xoutVideo.setStreamName("video")

# Properties

xoutVideo.input.setBlocking(False)
xoutVideo.input.setQueueSize(1)

# Linking
camRgb.video.link(xoutVideo.input)
count = 0

# Connect to device and start pipeline
with dai.Device(pipeline) as device:

    video = device.getOutputQueue(name="video", maxSize=1, blocking=False)

    while True:
        videoIn = video.get()
        count = count + 1
        print(time.localtime().tm_sec, " - ", count)
        
        # Get BGR frame from NV12 encoded video frame to show with opencv
        # Visualizing the frame on slower hosts might have overhead
        cv2.imshow("video", videoIn.getCvFrame())

        if cv2.waitKey(1) == ord('q'):
            break
  1. I’m printing the count value for each iteration along with the ‘second’ (from time). The difference of the count value is always below 12 and not even reaching 30 FPS, Kindly check the attached screenshot. Screenshot (3) (1)

  2. Re-checked it after saving the frames as well. The FPS value is still in the same range.

I would be really grateful if you could help me with increasing the FPS value.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
szabi-luxoniscommented, Apr 8, 2022

@DulminiD very likely your connection speed is USB2. (1920 * 1080 * 3/2) * 12=~36 MiB/s is close to USB2 real bandwidth. To verify can you add the following to your pipeline and see the result? print('Usb speed: ', device.getUsbSpeed().name) HIGH is USB2, SUPER/SUPER_PLUS is USB3.

1reaction
neon5dcommented, Jul 8, 2022

Thank you for your quick reply. Indeed, aprltag.py is slow. If I ran the above code, I got 30FPS compared to 12FPS of Apriltag.py. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Limitation in object tracking for oak-1 - Luxonis
Maximum number of tracked objects is 60 by default, for ZERO_TERM_COLOR_HISTOGRAM tracking mode. Can be configured using objectTracker.
Read more >
Introduction to OAK-D and DepthAI - LearnOpenCV
OAK -D and OAK-D-Lite are Spatial AI Cameras​​ A 4K RGB Camera : The RGB camera placed at the center can capture very...
Read more >
yFW - River Thames Conditions
Innerhtml not working android, Clinica dentaria de esgueira, ... you are eb real book, Rangers hockey game live stream free, Specialized 12 crosstrail....
Read more >
AXIS Q3515-LVE Network Camera
The lower resolution capture mode may be sampled from the original resolution, or it may be cropped out from the original, in which...
Read more >
Logitech HD Pro Webcam C920, Widescreen Video Calling ...
Available at a lower price from other sellers that may not offer free Prime shipping. ... Widescreen Video Calling and Recording, 1080p Camera,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found