-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
[iOS] VideoCapture.open(0) throws "error: (-215:Assertion failed) !info.backendFactory.empty()". #19910
Copy link
Copy link
Closed
Milestone
Description
System information (version)
- OpenCV => 4.5.2 69357b1
- Operating System / Platform => macOS Catalina 10.15.7
- Xcode => 12.3
- CMake => 3.19.8
Detailed description
VideoCapture.open(0) throws "error: (-215:Assertion failed) !info.backendFactory.empty()".
terminating with uncaught exception of type cv::Exception: OpenCV(4.5.2-dev) /Users/satoo/opencv/ios/opencv/modules/videoio/src/cap.cpp:239: error: (-215:Assertion failed) !info.backendFactory.empty() in function 'open'
The same error occurs with the following method.
bool VideoCapture::open(const String& filename, int apiPreference)
bool VideoWriter::open(const String& filename, int _fourcc, double fps, Size frameSize, bool isColor)
This commit may be the cause.
e705414
Steps to reproduce
- build opencv2.framework.
python opencv/platforms/ios/build_framework.py --contrib opencv_contrib --dynamic output - Open "output/samples/FaceDetection" project and edit ViewController.swift. https://github.com/opencv/opencv/blob/master/samples/swift/ios/FaceDetection/FaceDetection/ViewController.swift#L86
@IBOutlet weak var cameraHolder: UIView!
override func viewDidLoad() {
super.viewDidLoad()
+ var cap = VideoCapture()
+ cap.open(index: 0)
camera = CvVideoCamera2(parentView: cameraHolder)
camera?.rotateVideo = true
camera?.delegate = self
camera?.start()
}
- Run FaceDetection project on device.
This error occurs even when using the official release of opencv2.framework.
https://sourceforge.net/projects/opencvlibrary/files/4.5.2/opencv-4.5.2-ios-framework.zip/download
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable
