Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No ouput for videoCapture("/dev/stdin") for input stream from pi using netcat

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 ad raspivid to stream the video using the commands,

nc.traditional -l -p 9090|mplayer -fps 50 -cache 1024 -

on the pc and

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

on the pi.

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

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

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

I don't get any output or even any errors. The program keeps running. Any print statement before videoCapture works so I could figure out that the problem is with the line cv2.videoCapture("/dev/stdin"). I have been spending 2 days over it checking all possibilities and also checked if the dependable packages are all available. I couldn't find the solution. It would be better if I have an error but I don't get that too. Please help.

No ouput for videoCapture("/dev/stdin") for input stream from pi using netcat

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 ad and raspivid to stream the video using the commands,

nc.traditional -l -p 9090|mplayer -fps 50 -cache 1024 -

on the pc and

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

on the pi.

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

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

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

I don't get any output or even any errors. The program keeps running. Any print statement before videoCapture works so I could figure out that the problem is with the line cv2.videoCapture("/dev/stdin"). I have been spending 2 days over it checking all possibilities and also checked if the dependable packages are all available. I couldn't find the solution. It would be better if I have an error but I don't get that too. Please help.

No ouput for videoCapture("/dev/stdin") for input stream from pi using netcat

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|mplayer -fps 50 -cache 1024 -

on the pc and

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

on the pi.

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

Now I want to use the video for image processing in opencv. 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= cap.read()
>      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
>      cv2.imshow('video',gray)
>      if cv2.waitKey(1) & 0xFF == ord('q'):
>         break
> 
> cv2.destroyAllWindows()

I don't get any output or even any errors. The program keeps running. Any print statement before videoCapture works so I could figure out that the problem is with the line cv2.videoCapture("/dev/stdin"). I have been spending 2 days over it checking all possibilities and also checked if the dependable packages are all available. I couldn't find the solution. It would be better if I have an error but I don't get that too. Please help.

No ouput for videoCapture("/dev/stdin") for input stream from pi using netcat

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|mplayer -fps 50 -cache 1024 -

on the pc and

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

on the pi.

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= cap.read()
>      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
>      cv2.imshow('video',gray)
>      if cv2.waitKey(1) & 0xFF == ord('q'):
>         break
> 
> cv2.destroyAllWindows()

I don't get any output or even any errors. The program keeps running. Any print statement before videoCapture works so I could figure out that the problem is with the line cv2.videoCapture("/dev/stdin"). I have been spending 2 days over it checking all possibilities and also checked if the dependable packages are all available. I couldn't find the solution. It would be better if I have an error but I don't get that too. Please help.

No ouput output for videoCapture("/dev/stdin") for input stream from pi using netcat

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|mplayer -fps 50 -cache 1024 -

on the pc and

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

on the pi.

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= cap.read()
>      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
>      cv2.imshow('video',gray)
>      if cv2.waitKey(1) & 0xFF == ord('q'):
>         break
> 
> cv2.destroyAllWindows()

I don't get any output or even any errors. The program keeps running. Any print statement before videoCapture works so I could figure out that the problem is with the line cv2.videoCapture("/dev/stdin"). I have been spending 2 days over it checking all possibilities and also checked if the dependable packages are all available. I couldn't find the solution. It would be better if I have an error but I don't get that too. Please help.help. Any kind of help would be appreciated.

No output for videoCapture("/dev/stdin") for input stream from pi using netcat

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|mplayer -fps 50 -cache 1024 -9090|python3 inputvideo.py

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= cap.read()
>      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
>      cv2.imshow('video',gray)
>      if cv2.waitKey(1) & 0xFF == ord('q'):
>         break
> 
> cv2.destroyAllWindows()

I don't get any output or even any errors. The program keeps running. Any print statement before videoCapture works so I could figure out that the problem is with the line cv2.videoCapture("/dev/stdin"). I have been spending 2 days over it checking all possibilities and also checked if the dependable packages are all available. 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"
False

I couldn't find the solution. It would be better if I have an error but I don't get that too. solution. Please help. Any kind of help would be appreciated.

No output for videoCapture("/dev/stdin") for input stream from pi using netcat

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 inputvideo.py

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= cap.read()
>      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"
False

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