BF: Skip camera devices with no available formats.#7568
Merged
TEParsons merged 1 commit intopsychopy:releasefrom Mar 4, 2026
Merged
BF: Skip camera devices with no available formats.#7568TEParsons merged 1 commit intopsychopy:releasefrom
TEParsons merged 1 commit intopsychopy:releasefrom
Conversation
I have some virtual cameras on my system that have no available formats,
and this leads to e.g.:
>>> x = CameraDevice.getAvailableDevices()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...\psychopy\hardware\camera\__init__.py", line 614, in getAvailableDevices
minFrameRate = max(28, min([cam.frameRate for cam in allCams]))
ValueError: min() arg is an empty sequence
As far as I can tell, this is the only place where non-emptiness is assumed?
Member
|
This indirectly fixed another bug that seemed unrelated that I couldn't track down. Thanks for your help @aforren1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have some virtual cameras (e.g. OBS) on my system that have no available formats, and this leads to e.g.:
As far as I can tell, this is the only place where non-emptiness is assumed?
Tested vs. 2026.1.1 on Windows 11. This lets the app device manager successfully list the built-in webcam.