几乎完全相同的问题:OpenCV error - cannot put pipeline to play in function CvVideoWriter_GStreamer::open
上下文:我正在尝试创建视频,并使用OpenCV 3.3.0和Python 2.7将其保存为.avi文件。
问题:此代码:
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('data/out/output.avi', fourcc, 30, (800, 600))
提高:
(python2.7:12345): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
** (python2.7:12345): CRITICAL **: gst_ffmpeg_cfg_set_property: assertion 'qdata->size == sizeof (gint64)' failed
OpenCV Error: Unspecified error (GStreamer: cannot put pipeline to play ) in CvVideoWriter_GStreamer::open, file /soft/OpenCV3.3/opencv-3.3.0/modules/videoio/src/cap_gstreamer.cpp, line 1690
VIDEOIO(cvCreateVideoWriter_GStreamer (filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:
cap_gstreamer.cpp:1690: error: (-2) GStreamer: cannot put pipeline to play
in function CvVideoWriter_GStreamer::open
问题:如何解决此问题,以便可以使用OpenCV编写视频文件?
答案 0 :(得分:0)
不使用VideoWriter
的构造函数中的路径即可解决问题。
out = cv2.VideoWriter('output.avi', fourcc, 30, (800, 600))