使用VideoCapture时在opencv中获取警告

时间:2016-02-09 15:05:12

标签: python opencv gstreamer

当我运行此代码以使用cv2

播放视频时
import cv2

cap = cv2.VideoCapture('video.mp4')

while(cap.isOpened()):
    ret, frame = cap.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
    cv2.imshow('frame',gray)

cap.release()
cv2.destroyAllWindows()

我收到gstreamer警告。我在两台计算机上试过这个:

(python:4145): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GstObject'

(python:4145): GStreamer-CRITICAL **: gst_object_unref: assertion '((GObject *) object)->ref_count > 0' failed

(python:4145): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GstObject'

(python:4145): GStreamer-CRITICAL **: gst_object_unref: assertion '((GObject *) object)->ref_count > 0' failed

(python:4145): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GstObject'

(python:4145): GStreamer-CRITICAL **: gst_object_unref: assertion '((GObject *) object)->ref_count > 0' failed

(python:4145): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed

(python:4145): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed

我尝试过更新gstreamer,安装插件但似乎没什么用。我怎样才能摆脱警告。

0 个答案:

没有答案