Opencv-python: [ WARN:0] terminating async callback

Created on 4 May 2019  路  2Comments  路  Source: opencv/opencv-python

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'

Most helpful comment

This is a bug in OpenCV in MSMF backend: https://github.com/opencv/opencv/issues/13255

You could try setx OPENCV_VIDEOIO_PRIORITY_MSMF 0 before running your script. However, there's nothing I can do in this repo to fix the issue.

All 2 comments

This is a bug in OpenCV in MSMF backend: https://github.com/opencv/opencv/issues/13255

You could try setx OPENCV_VIDEOIO_PRIORITY_MSMF 0 before running your script. However, there's nothing I can do in this repo to fix the issue.

Had this issue on opencv4*, 3.4.4
When installed opencv 3.4.2.16 the warning disappeared

Was this page helpful?
0 / 5 - 0 ratings

Related issues

askerlee picture askerlee  路  5Comments

ghost picture ghost  路  4Comments

Borda picture Borda  路  4Comments

Breakthrough picture Breakthrough  路  6Comments

ghimireadarsh picture ghimireadarsh  路  3Comments