Toybrick

无法使用 openccv 打开视频文件

linuxsky

注册会员

积分
151
楼主
发表于 2019-2-16 11:11:28    查看: 10639|回复: 8 | [复制链接]    打印 | 只看该作者
[toybrick@MiWiFi-R2D-srv Linux_rknn_api_sdk_new]$ ./a.out
Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
VIDEOIO ERROR: V4L: device ./1550279248737094.avi: 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

open mp4 file failed!
[toybrick@MiWiFi-R2D-srv Linux_rknn_api_sdk_new]$

回复

使用道具 举报

程子

中级会员

积分
386
沙发
发表于 2019-2-16 11:36:12 | 只看该作者

  1. >>> vc = cv2.VideoCapture('test.mp4')
  2. Failed to query video capabilities: Inappropriate ioctl for device
  3. libv4l2: error getting capabilities: Inappropriate ioctl for device
  4. VIDEOIO ERROR: V4L: device test.mp4: Unable to query number of channels
  5. OpenCV(3.4.1) Error: Unspecified error (GStreamer: your gstreamer installation is missing a required plugin
  6. ) in handlemessage, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp, line 1869
  7. VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception:

  8. 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
  9. in function handlemessage
复制代码


同样情况,opencv是通过dnf安装的:

  1. dnf install python3-opencv
复制代码
回复

使用道具 举报

chuyee

中级会员

积分
352
板凳
发表于 2019-2-18 04:10:37 | 只看该作者
dnf install gstreamer1-libav

这个问题我已经问过了哈,详见:http://t.rock-chips.com/forum.ph ... &extra=page%3D1
回复

使用道具 举报

linuxsky

注册会员

积分
151
地板
 楼主| 发表于 2019-2-18 21:24:15 | 只看该作者
chuyee 发表于 2019-2-18 04:10
dnf install gstreamer1-libav

这个问题我已经问过了哈,详见:http://t.rock-chips.com/forum.php?mod=vi ...

提示找不到这个包啊?确认没敲错?
回复

使用道具 举报

troy

版主

积分
2374
5#
发表于 2019-2-26 17:24:46 | 只看该作者
linuxsky 发表于 2019-2-18 21:24
提示找不到这个包啊?确认没敲错?

sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip
即可使用硬解
回复

使用道具 举报

sunzhongmeng

注册会员

积分
116
6#
发表于 2019-3-27 15:06:00 | 只看该作者
chuyee 发表于 2019-2-18 04:10
dnf install gstreamer1-libav

这个问题我已经问过了哈,详见:http://t.rock-chips.com/forum.php?mod=vi ...

安装gstreamer1-libav提升找不到这个包,可以添加rpmfusion源:
  1. #rpm -Uvh <a href="http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm" target="_blank">http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm</a>
  2. #rpm -Uvh <a href="http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm" target="_blank">http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm</a>
复制代码

回复

使用道具 举报

ronyuzhang

注册会员

积分
73
7#
发表于 2019-3-27 21:27:46 | 只看该作者
troy 发表于 2019-2-26 17:24
sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip

安装完 还是无法解析视频文件

Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
VIDEOIO ERROR: V4L: device test1.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
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
回复

使用道具 举报

q5671229

注册会员

积分
70
8#
发表于 2019-4-16 14:26:14 | 只看该作者
sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip



还是不行。安装完了还是提示如上问题
回复

使用道具 举报

yuys

注册会员

积分
194
9#
发表于 2019-10-17 17:45:27 | 只看该作者
q5671229 发表于 2019-4-16 14:26
sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip

你重新烧一下系统。dnf install gstreamer1-libav 安装后就可以了,但是软解,延时厉害!
回复

使用道具 举报

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

本版积分规则

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


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