GStreamer-CRITICAL **:gst_element_make_from_uri:断言“gst_uri_is_valid(uri)”失败

问题描述 投票:0回答:1

我在 Ubuntu 16.04 上使用 Python 中的 OpenCV 3.1。我可以对大量视频运行良好,但是在这个特定视频中它失败了。我正在使用 XVID 作为编码。 URI 似乎是正确的,所以我在这里不知所措......

下面是完整的错误(我知道可能需要一些上下文,但为文件提供的路径是正确的。我尝试按照其他答案的建议在末尾添加一个空格,但它不起作用。

(240, 320, 3)
Converting all images into a video...
v_HandStandPushups_g01_c01
['', 'media', 'pedro', 'actv3', 'UCF101', 'videos', 'HandstandPushups']
Height: 224 Width: 224 FPS: 25.0
/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_pose.avi
/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_joints.npy

(python:1923): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
GStreamer Plugin: Embedded video playback halted; module filesink0 reported: Could not open file "/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_pose.avi" for writing.
GStreamer Plugin: Embedded video playback halted; module filesink0 reported: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
OpenCV Error: Unspecified error (GStreamer: cannot put pipeline to play
) in CvVideoWriter_GStreamer::open, file /home/pedro/opencv/modules/videoio/src/cap_gstreamer.cpp, line 1530
Traceback (most recent call last):
  File "process_video.py", line 133, in <module>
    main()
  File "process_video.py", line 130, in main
    _process_dataset()
  File "process_video.py", line 119, in _process_dataset
    computePose(videos)
  File "process_video.py", line 101, in computePose
    video = cv2.VideoWriter(poseimg_output_name, fourcc, vidcap.get(cv2.CAP_PROP_FPS), (width,height), True)
cv2.error: /home/pedro/opencv/modules/videoio/src/cap_gstreamer.cpp:1530: error: (-2) GStreamer: cannot put pipeline to play
 in function CvVideoWriter_GStreamer::open

编辑:解决方案是我正在写入一个不存在的文件夹。仔细检查您的路径(区分大小写)。

python opencv gstreamer opencv3.1
1个回答
7
投票

抱怨不会写。


GStreamer Plugin: Embedded video playback halted; module filesink0 reported: Could not open file "/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_pose.avi" for writing.

你确定它有write属性吗?

无论如何,当我看到断言失败时,我使用 GDB 来更好地理解失败:


GST_DEBUG=4 G_DEBUG=fatal-criticals gdb -ex run --args application

© www.soinside.com 2019 - 2024. All rights reserved.