GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

13,454

It is complaining that cannot write. 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.

Are you sure that it has the write attribute?

Anyway when I see an assertion failure I use GDB for better understanding the failure:

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

Share:
13,454

Related videos on Youtube

Pedro Abreu
Author by

Pedro Abreu

Updated on June 04, 2022

Comments

  • Pedro Abreu
    Pedro Abreu almost 2 years

    I am in Ubuntu 16.04 using OpenCV 3.1 in Python. I can run this fine for a large number of videos however in this particular video it fails. I am using XVID as coded. The URI seems to be correct so I'm at a loss here...

    Below is the full error (I know some context may be needed, but the path provided for the file is correct. I have tried putting a space at the end as some other answer suggested and it didn't work.

    (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
    

    EDIT: Solution was that I was writing to a non-existent folder. Check your paths very carefully (they are case-sensitive).

  • Pedro Abreu
    Pedro Abreu about 6 years
    I tried chmod -R 777 on the entire parent folder still didn't work. Other folders in that parent folder work, it's just this particular video. I'm not very familiar with using GDB for Python but I'll give it a shot.
  • Pedro Abreu
    Pedro Abreu about 6 years
    I found the error. Basically I was creating folders from a .txt with all the names of classes. One of those names was HandstandPushups which it created but the name of the folder where the videos were is HandStandPushups. A tiny error from the people who provided the dataset :(. I will mark your answer as correct nonetheless, much thanks!!