Skip to content

Possible divide by zero in camera #2458

Open
@Starbuck5

Description

@Starbuck5

Reported: https://stackoverflow.com/questions/77107362/float-division-by-zero-python-webcam-pygame-camera

Source:

self._frametime = 1 / self._cam.get(cv2.CAP_PROP_FPS)

It makes sense that this could return 0 if unknown, and then crash. The solution is likely to rewrite the OpenCV camera backend to use threading so it can convert the blocking OpenCV API into our non blocking API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    camerapygame.camera

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions