|
首先我按步骤编译安装了Mpp和gstreamer-rockchip,然后用以下shell命令成功硬解视频- gst-launch-1.0 filesrc location=/home/toybrick/yolov5/test_data/20210728105542_1km.mp4 ! decodebin ! rkximagesink
但是我使用opencv调用gstreamer时
- gst='filesrc location=/home/toybrick/yolov5/test_data/20210728105542_1km.mp4 ! decodebin ! rkximagesink'
- cap = cv.VideoCapture(gst,cv.CAP_GSTREAMER)
- if not cap.isOpened():
- print("Cannot capture from camera. Exiting.")
- #os._exit()
- while(True):
- ret, frame = cap.read()
- if ret:
- cv.imshow('frame', frame)
- if cv.waitKey(1) & 0xFF == ord('q'):
- break
- cap.release()
- cv.destroyAllWindows()
出现了以下错误:
- root@debian10:/home/toybrick/yolov5# python gstreamer.py
- [ WARN:0] OpenCV | GStreamer warning: cannot find appsink in manual pipeline
- [ WARN:0] OpenCV | GStreamer warning: GStreamer: pipeline have not been created
- Cannot capture from camera. Exiting.
按理说opencv调用gstreamer的方法和直接在shell中调用的方法应该是差不多的,为啥会出现这种错误
|
|