Toybrick

rk3399pro使用opencv调用gstreamer出错

gungnir

注册会员

积分
95
楼主
发表于 2021-9-9 17:05:07    查看: 3337|回复: 0 | [复制链接]    打印 | 只看该作者
首先我按步骤编译安装了Mpp和gstreamer-rockchip,然后用以下shell命令成功硬解视频
  1. gst-launch-1.0 filesrc location=/home/toybrick/yolov5/test_data/20210728105542_1km.mp4 ! decodebin ! rkximagesink
复制代码
但是我使用opencv调用gstreamer时
  1. gst='filesrc location=/home/toybrick/yolov5/test_data/20210728105542_1km.mp4 ! decodebin ! rkximagesink'
  2. cap = cv.VideoCapture(gst,cv.CAP_GSTREAMER)

  3. if not cap.isOpened():
  4.     print("Cannot capture from camera. Exiting.")
  5.     #os._exit()

  6. while(True):

  7.     ret, frame = cap.read()
  8.     if ret:
  9.         cv.imshow('frame', frame)

  10.     if cv.waitKey(1) & 0xFF == ord('q'):
  11.         break

  12. cap.release()
  13. cv.destroyAllWindows()
复制代码
出现了以下错误:
  1. root@debian10:/home/toybrick/yolov5# python gstreamer.py
  2. [ WARN:0] OpenCV | GStreamer warning: cannot find appsink in manual pipeline
  3. [ WARN:0] OpenCV | GStreamer warning: GStreamer: pipeline have not been created
  4. Cannot capture from camera. Exiting.
复制代码
按理说opencv调用gstreamer的方法和直接在shell中调用的方法应该是差不多的,为啥会出现这种错误
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表