GStreamer: Error opening bin: no source element for URI "/dev/stdin" for videoCapture("/dev/stdin") for input stream from pi using netcat

asked 2017-10-17 05:54:23 -0500

r@opencv gravatar image

updated 2017-10-17 06:47:26 -0500

I am a beginner working on a project that requires input video from raspberrypi(live streaming) to my pc that runs on Ubuntu 16.04. I use netcat and raspivid to stream the video using the commands,

nc.traditional -l -p 9090|python3

on the pc and

raspivid-w 1280 -h 720 -fps 30 -t 999999 -o -|nc IPaddrofPC 9090

on the pi.

But I am able to receive and view the video streaming in mplayer.

Now I want to use the video for image processing in opencv using python 3.5. I used the following code,

> import cv2
> cap=cv2.videoCapture("/dev/stdin")
> print(cap.isOpened())
> while(cap.isOpened==True):
>      ret, frame=
>      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
>      cv2.imshow('video',gray)
>      if cv2.waitKey(1) & 0xFF == ord('q'):
>         break
> cv2.destroyAllWindows()

I get the following error,

GStreamer-CRITICAL **:gst_element_make_from_uri:assertion 'gst_uri_is_valid (uri)' failed
GStreamer: Error opening bin: no source element for URI "/dev/stdin"

I couldn't find the solution. Please help. Any kind of help would be appreciated.

edit retag flag offensive close merge delete


i'm not using any of this, but to my knowledge, you need a real gstreamer "cmd pipeline" for this, not just "/dev/stdin"

berak gravatar imageberak ( 2017-10-17 06:47:35 -0500 )edit

How do we do that? I am not aware of it

r@opencv gravatar image[email protected] ( 2017-10-17 07:57:25 -0500 )edit

R u using webcam or picamera?

supra56 gravatar imagesupra56 ( 2017-10-17 12:50:22 -0500 )edit

stereo picamera

r@opencv gravatar image[email protected] ( 2017-10-20 04:03:05 -0500 )edit