- sudo dnf install gstreamer-rockchip
复制代码
后,无法打开UVC摄像头:camera.py:
- import numpy as np
- import cv2
- import matplotlib.pyplot as plot
- cap = cv2.VideoCapture(0)
- while(True):
- ret,frame = cap.read()
- cv2.imshow("capture",frame)
- if cv2.waitKey(1) & 0xFF == ord('q'):
- break
- cap.release()
复制代码
- OpenCV(3.4.1) Error: Unspecified error (GStreamer: unable to start pipeline
- ) in cvCaptureFromCAM_GStreamer, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp, line 890
- VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:
- OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
- in function cvCaptureFromCAM_GStreamer
- OpenCV(3.4.1) Error: Unspecified error (unicap: failed to get info for device
- ) in CvCapture_Unicap::initDevice, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_unicap.cpp, line 139
- VIDEOIO(cvCreateCameraCapture_Unicap(index)): raised OpenCV exception:
- OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_unicap.cpp:139: error: (-2) unicap: failed to get info for device
- in function CvCapture_Unicap::initDevice
- OpenCV(3.4.1) Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /builddir/build/BUILD/opencv-3.4.1/modules/highgui/src/window.cpp, line 364
- Traceback (most recent call last):
- File "camera.py", line 7, in <module>
- cv2.imshow("capture",frame)
- cv2.error: OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/highgui/src/window.cpp:364: error: (-215) size.width>0 && size.height>0 in function imshow
复制代码
本地视频也无法打开!- OpenCV(3.4.1) Error: Unspecified error (GStreamer: unable to start pipeline
- ) in cvCaptureFromCAM_GStreamer, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp, line 890
- VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:
- OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
- in function cvCaptureFromCAM_GStreamer
- OpenCV(3.4.1) Error: Unspecified error (unicap: failed to get info for device
- ) in CvCapture_Unicap::initDevice, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_unicap.cpp, line 139
- VIDEOIO(cvCreateCameraCapture_Unicap(index)): raised OpenCV exception:
- OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_unicap.cpp:139: error: (-2) unicap: failed to get info for device
- in function CvCapture_Unicap::initDevice
- OpenCV(3.4.1) Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /builddir/build/BUILD/opencv-3.4.1/modules/highgui/src/window.cpp, line 364
- Traceback (most recent call last):
- File "open_camera.py", line 13, in <module>
- video_demo()
- File "open_camera.py", line 7, in video_demo
- cv.imshow("UVC",frame)
- cv2.error: OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/highgui/src/window.cpp:364: error: (-215) size.width>0 && size.height>0 in function imshow
复制代码
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |