Toybrick

标题: 无法使用 openccv 打开视频文件 [打印本页]

作者: linuxsky    时间: 2019-2-16 11:11
标题: 无法使用 openccv 打开视频文件
[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]$


作者: 程子    时间: 2019-2-16 11:36

  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    时间: 2019-2-18 04:10
dnf install gstreamer1-libav

这个问题我已经问过了哈,详见:http://t.rock-chips.com/forum.ph ... &extra=page%3D1
作者: linuxsky    时间: 2019-2-18 21:24
chuyee 发表于 2019-2-18 04:10
dnf install gstreamer1-libav

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

提示找不到这个包啊?确认没敲错?
作者: troy    时间: 2019-2-26 17:24
linuxsky 发表于 2019-2-18 21:24
提示找不到这个包啊?确认没敲错?

sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip
即可使用硬解
作者: sunzhongmeng    时间: 2019-3-27 15:06
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    时间: 2019-3-27 21:27
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    时间: 2019-4-16 14:26
sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip



还是不行。安装完了还是提示如上问题
作者: yuys    时间: 2019-10-17 17:45
q5671229 发表于 2019-4-16 14:26
sudo dnf clean all
sudo dnf update
sudo dnf install gstreamer-rockchip

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




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3