Skip to content

Can't open webcan or video file with python3 and opencv #8471

@patrickelectric

Description

@patrickelectric
System information (version)
  • OpenCV => 3.2.0-1
  • Python OpenCV => 3.2.0.6
  • Python => 3.5.2
  • Operating System / Platform => ArchLinux 64bits
Detailed description

Can't open VideoCapture don't work with files and /dev/video

Steps to reproduce
import cv2
video = cv2.VideoCapture(0)
if video.isOpened():
    while True:
        check, frame = video.read()
        if check:
            cv2.imshow('Color Frame', frame)
            key = cv2.waitKey(50)
            if key == ord('q'):
                break
        else:
            print('Frame not available')
            print(video.isOpened())

The code don't show webcan or video file
Works with python2 ..

Metadata

Metadata

Assignees

No one assigned

    Labels

    question (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions