Skip to content

set maximum FPS for webcams #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ikarib
Copy link

@ikarib ikarib commented Mar 15, 2025

Problem description: Arducam AR0234 outputs uncompressed YUY2 format at 960x600@80fps. This causes any vision opmode to freeze after a few seconds of working properly.

Solution: allow setting a maximum number of frames per second the webcam should capture (actual fps depends on the pipeline, but won't be higher than the requested maximum). Currently startStreaming uses maximum FPS from camera characteristics for given format and size. If we lock the camera hardware to send frames at the specific FPS, it will solve the bandwidth issue with Arducam AR0234.

… capture (actual fps depends on pipeline, but won't be higher than requested maximum)
@Windwoes
Copy link
Member

Hmm, have you tried to debug the cause of the hang? I have used a monochrome Arducam set to 120FPS where the pipeline could only do about 50FPS and it didn't result in any hangs.

@ikarib
Copy link
Author

ikarib commented Mar 16, 2025

It's hard to debug because FtcRobotController.log is not showing any errors. I think you were not experiencing hangs because of the compressed MJPEG stream format over USB2. Arducam AR0234 can only output uncompressed YUY2 stream format at 10fps over USB2 or up to 80fps over USB3.

@Windwoes
Copy link
Member

So you were using the USB3 port on your control hub?

@ikarib
Copy link
Author

ikarib commented Mar 16, 2025

Yes, we used USB3. If we use USB2, then the opmode does not hang, but we only get 10fps max.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants