Skip to content

[ WARN:0] terminating async callback #198

Description

@nerdfever

Expected behaviour

Assuming 2 cameras (also gives the error if only one camera):

C:\Users\Dave\data\Code\Python\VideoCapture>python3 test.py
Found camera 0
Found camera 1

Actual behaviour

C:\Users\Dave\data\Code\Python\VideoCapture>python3 test.py
Found camera 0
[ WARN:0] terminating async callback
Found camera 1
[ WARN:0] terminating async callback

Steps to reproduce

import cv2

def countCameras():
    """Returns count of found cameras (not opened yet).
    Brute force - just tries them all till it fails."""

    camCount = 0

    while True:
        cam = cv2.VideoCapture(camCount)

        if cam.isOpened():
            print("Found camera", camCount)
            cam.release()
            camCount += 1

        else:
            return camCount

countCameras()
  • operating system

Windows 10 Pro

  • architecture (e.g. x86)

x64

  • opencv-python version

cv2.version == '4.1.0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions