Skip to content

driver: usbvideodriver: add support for overlaying FPS #1710

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 2 commits into
base: master
Choose a base branch
from

Conversation

a3f
Copy link
Contributor

@a3f a3f commented Jul 28, 2025

Description

We encourage addition of multiple quality settings for USB Video
devices, but there is no easy way to get feedback how many frames per
second are actually processed on the receiver side, which could
influence which quality settings would be chosen for Labgrid, especially as connection over USB 2.0/USB 3.0 can impact what frame rates we can achieve.

To allow for an easy evaluation of video devices and how they're
connected, expose the newly added fps feature in USBVideoDriver as
--fps command line option.

  • what do you use the feature for?

Check that I indeed am able to get the framerate configured in the quality

  • how does labgrid benefit as a testing library from the feature?

Makes it easier to evaluate cameras/HDMI grabbers

  • how did you verify the feature works?

I ran the command with and without --fps and with the different quality settings

  • if hardware is needed for the feature, which hardware is supported and which
    hardware did you test with?

I tested against the Guermok HDMI grabber added in #1709

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst

The existing arguments aren't documented/test either. The `--fps`` is documented in the help text.

@a3f
Copy link
Contributor Author

a3f commented Jul 28, 2025

I rebased on top of #1709 to avoid a trivial conflict in the CHANGES.rst

@Bastian-Krause
Copy link
Member

@a3f Could you take a look at the ruff format errors?

a3f added 2 commits July 31, 2025 11:13
We encourage addition of multiple quality settings for USB Video
devices, but there is no easy way to get feedback how many frames per
second are actually processed on the receiver side, which could
influence which quality settings would be chosen for Labgrid.

Let's add a fps parameter to USBVideoDriver::stream() that enables an
overlay with FPS statistics if enabled.

Signed-off-by: Ahmad Fatoum <[email protected]>
The video modes reported by a video device aren't necessarily possible in
practice, e.g. because it is connected via USB 2.0 instead of USB 3.0.

To allow for an easy evaluation of video devices and how they're
connected, expose the newly added fps feature in USBVideoDriver as
--fps command line option.

Signed-off-by: Ahmad Fatoum <[email protected]>
@a3f a3f force-pushed the afa/usbvideodriver branch from 2d27f6d to c0166da Compare July 31, 2025 09:16
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.6%. Comparing base (c8f1f41) to head (c0166da).
⚠️ Report is 4 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/usbvideodriver.py 33.3% 2 Missing ⚠️
labgrid/remote/client.py 33.3% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1710     +/-   ##
========================================
- Coverage    55.6%   55.6%   -0.1%     
========================================
  Files         172     172             
  Lines       13462   13466      +4     
========================================
+ Hits         7491    7492      +1     
- Misses       5971    5974      +3     
Flag Coverage Δ
3.10 55.6% <33.3%> (-0.1%) ⬇️
3.11 55.6% <33.3%> (-0.1%) ⬇️
3.12 55.6% <33.3%> (-0.1%) ⬇️
3.13 55.6% <33.3%> (-0.1%) ⬇️
3.9 55.6% <33.3%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@a3f
Copy link
Contributor Author

a3f commented Jul 31, 2025

@a3f Could you take a look at the ruff format errors?

Sorry, I mistakenly thought it was "just" coverage like in the other PR.

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