You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pygame-ce 2.5.1.dev1 (SDL 2.30.5, Python 3.12.0)
Platform: Windows-11-10.0.22631-SP0
System: Windows
System Version: 10.0.22631
Processor: AMD64 Family 23 Model 104 Stepping 1, AuthenticAMD SSE2: Yes AVX2: Yes NEON: No
Architecture: Bits: 64bit Linkage: WindowsPE
Python: CPython 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
pygame version: 2.5.1.dev1
SDL versions: Linked: 2.30.5 Compiled: 2.30.5
SDL Mixer versions: Linked: 2.8.0 Compiled: 2.8.0
SDL Font versions: Linked: 2.22.0 Compiled: 2.22.0
SDL Image versions: Linked: 2.8.2 Compiled: 2.8.2
Freetype versions: Linked: 2.11.1 Compiled: 2.11.1
Display Driver: windows
Mixer Driver: Mixer Not Initialized
Current behavior:
Imagining you don't have opencv-python installed, and you don't force OpenCV backend with environment variables , you get a segfault when initialising a camera object.
Expected behavior:
No segfault, and a descriptive message of what is actually hapenning.
It would be interesting to tell in the wiki for compilation from source for Windows, how to get access to pygame.camera, by explaining how to compile with MSVC.
pygame.camera.list_cameras() is broken, sometimes it returns you a list of string (when I don't force opencv backend), sometimes a list of one integer (when I force opencv backend) and ultimately a None value.
When I don't force opencv backend, I get this error which is not logical :
damusss
added
segfault
For PRs that fix segfaults or issues containing segfaults which have an higher priority
camera
pygame.camera
labels
Jul 27, 2024
As discussed on discord, this an incorrect use of the API.
camera.list_cameras() gives you a list of things that can be passed into Camera() as the device name, you're not honoring that here, you're passing in something random that list_cameras did not give you. That being said it shouldn't segfault either.
pygame.camera.list_cameras() is broken, sometimes it returns you a list of string (when I don't force opencv backend), sometimes a list of one integer (when I force opencv backend) and ultimately a None value.
It's doing exactly what the docs says it does. Except IDK what you mean about getting None out of this.
When I don't force opencv backend, I get this error which is not logical :
What's not logical about it? You have to give a device, that's what the docs say.
Environment:
Current behavior:
Imagining you don't have
opencv-python
installed, and you don't forceOpenCV
backend with environment variables , you get a segfault when initialising a camera object.Expected behavior:
No segfault, and a descriptive message of what is actually hapenning.
Test code
Other things to mention :
pygame.camera
, by explaining how to compile with MSVC.pygame.camera.list_cameras()
is broken, sometimes it returns you a list of string (when I don't force opencv backend), sometimes a list of one integer (when I force opencv backend) and ultimately aNone
value.opencv
backend, I get this error which is not logical :The text was updated successfully, but these errors were encountered: