OpenCV2 videoCaputure doesn't work before 4.6
See original GitHub issueNuitka version installed with pip:
1.1.8
Commercial: None
Python: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Flavor: Unknown
Executable: C:\Users\dan\AppData\Local\Programs\Python\Python38\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 10
opencv-python==4.5.5.64
breaking line:
if not cap.isOpened():
Simple example:
import numpy as np
import cv2 as cv
cap = cv.VideoCapture('demo.mp4)
if not cap.isOpened():
print("Cannot open camera")
exit()
while True:
# Capture frame-by-frame
ret, frame = cap.read()
# if frame is read correctly ret is True
if not ret:
print("Can't receive frame (stream end?). Exiting ...")
break
build command:
python -m nuitka --standalone --enable-plugin=numpy --include-data-files=demo.mp4=demo.mp4 entry.py
Error:
Traceback (most recent call last):
File "C:\Users\dan\Desktop\label\democv\ENTRY~1.DIS\entry.py", line 6, in <module>
TypeError: Incorrect type of self (must be 'VideoCapture' or its derivative)
I get no issues running the python file or using cv2 to read an image, but videoCapure always gives that type error, is there a problem with the capture backend/ffmpeg?
Issue Analytics
- State:
- Created a year ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
OpenCV videowrite doesn't write video - Stack Overflow
I use cv2.VideoWriter on linux quite often and it always works. So if the above doesn't work you can always try it on...
Read more >cv::VideoCapture Class Reference - OpenCV
The class provides C++ API for capturing video from cameras or for reading video files and image sequences. Here is how the class...
Read more >Loading Video Source OpenCV Python Tutorial
First, we import numpy and cv2, nothing fancy there. Next, we cay cap = cv2.VideoCapture(0) . This will return video from the first...
Read more >OpenCV error - Jetson Nano - NVIDIA Developer Forums
Seems the videoCapture used the wrong backend (CV_IMAGES). You would try to specify gstreamer backend with: cam= cv2.VideoCapture(camSet, cv2.
Read more >Faster video file FPS with cv2.VideoCapture and OpenCV
Have you ever worked with a video file via OpenCV's cv2. ... But before we can appreciate the faster, threaded method to video...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Part of the 1.2 release that was made a while ago.
This is now on the develop branch, part of the current pre-release and should be part of the immanent 1.2 release.