Toybrick

楼主: chuyee

Opencv error on video: gstreamer missing required plugin

chuyee

中级会员

积分
352
楼主
发表于 2019-2-13 08:39:34    查看: 44744|回复: 25 | [复制链接]    打印 | 显示全部楼层
$ python
Python 3.6.8 (default, Jan 31 2019, 09:06:51)
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cap = cv2.VideoCapture('chaplin.mp4')
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
VIDEOIO ERROR: V4L: device ../GOTURN/chaplin.mp4: Unable to query number of channels
OpenCV(3.4.1) Error: Unspecified error (GStreamer: your gstreamer installation is missing a required plugin
) in handlemessage, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp, line 1869
VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception:

OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:1869: error: (-2) GStreamer: your gstreamer installation is missing a required plugin
in function handlemessage

>>>

I have tried multiple video files (mp4). All have the same problem. If you couldn't reproduce the problem, I can upload my video file (although I don't think it's necessary).

回复

使用道具 举报

chuyee

中级会员

积分
352
沙发
 楼主| 发表于 2019-2-13 13:19:02 | 显示全部楼层
谢谢,方便提供一下rpm吗?
回复

使用道具 举报

chuyee

中级会员

积分
352
板凳
 楼主| 发表于 2019-2-15 08:54:16 | 显示全部楼层
The problem is fixed. Thanks!
回复

使用道具 举报

chuyee

中级会员

积分
352
地板
 楼主| 发表于 2019-2-27 15:31:37 | 显示全部楼层
sudo dnf install gstreamer-rockchip


可以打开视频。不过有warning说读不到视频的channel和duration,请定位一下是什么问题。信息如下:

Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
VIDEOIO ERROR: V4L: device /home/toybrick/video.mp4: Unable to query number of channels
mpi: mpp version: Without VCS info
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: deprecated block control, use timeout control instead
warning: GStreamer: unable to query duration of stream (/builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:904)
warning: Cannot query video position: status=1 value=0 duration=-1
(/builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:952)
回复

使用道具 举报

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

本版积分规则

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


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