The opencv sample crashes after capturing video for a few seconds. Is it a way to dig out what happens when using camera?
ubuntu@ubuntu:~/opencv_contrib-master/samples/python2$ python video.py
Video capture sample.
Sample shows how VideoCapture class can be used to acquire video
frames from a camera of a movie file. Also the sample provides
an example of procedural video generation by an object, mimicking
the VideoCapture interface (see Chess class).
'create_capture' is a convinience function for capture creation,
falling back to procedural video in case of error.
Usage:
video.py [--shotdir <shot path>] [source0] [source1] ...'
sourceN is an
- integer number for camera capture
- name of video file
- synth:<params> for procedural video
Synth examples:
synth:bg=../cpp/lena.jpg:noise=0.1
synth:class=chess:bg=../cpp/lena.jpg:noise=0.1:size=640x480
Keys:
ESC - exit
SPACE - save current frame to <shot path> directory
(python:2948): Gtk-WARNING **: 03:41:28.134: Unable to locate theme engine in module_path: "pixmap",
(python:2948): Gtk-WARNING **: 03:41:28.137: Unable to locate theme engine in module_path: "pixmap",
(python:2948): Gtk-WARNING **: 03:41:28.138: Unable to locate theme engine in module_path: "pixmap",
(python:2948): Gtk-WARNING **: 03:41:28.145: Unable to locate theme engine in module_path: "pixmap",
(python:2948): Gtk-WARNING **: 03:41:28.146: Unable to locate theme engine in module_path: "pixmap",
[ WARN:0] global /home/ubuntu/opencv-master/modules/videoio/src/cap_v4l.cpp (1001) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
Traceback (most recent call last):
File "video.py", line 189, in <module>
cv.imshow('capture %d' % i, img)
cv2.error: OpenCV(4.5.4-dev) /home/ubuntu/opencv-master/modules/core/src/array.cpp:2494: error: (-206:Bad flag (parameter or structure field)) Unrecognized or unsupported array type in function 'cvGetMat'