intel / gstreamer-media-SDK

GNU Lesser General Public License v2.1
90 stars 53 forks source link

ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing. #138

Closed 7wdeepin closed 5 years ago

7wdeepin commented 5 years ago

I installed gstreamer-msdk several days ago. And I successfully captured stream from ip camera via rtsp with the commands:

# gst-launch-1.0 -v rtspsrc location="rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp" latency=300 ! rtph264depay ! h264parse ! mfxh264dec ! autovideosink
# gst-launch-1.0 -v rtspsrc location="rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp" latency=0 ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink

But now, when i run the same commands in the same machine, i get the error results:

Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
libva info: VA-API version 1.2.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_2
libva info: va_openDriver() returns 0
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.mfx.Aggregator=context, gst.mfx.Aggregator=(GstMfxTaskAggregator)NULL;
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp
Progress: (open) Retrieving server options
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5508): gst_rtspsrc_try_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not receive message. (Received end-of-file)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I use Ubuntu 16.04 with kernel 4.15.0-42-generic and installed media-sdk with 2018 Q2 release. Otherwise, now i can capture stream with vlc app via rtsp:

 # cvlc "rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp"

and also can capture stream with opencv:

import cv2

cap = cv2.VideoCapture('rtsp://192.168.1.10:554/user=admin&password=&channel=1&stream=0.sdp')

while(True):
     ret, frame = cap.read()
     cv2.imshow('frame',frame)
     if cv2.waitKey(1) & 0xFF == ord('q'):
         cv2.destroyAllWindows()
         break

Except run the command with gstreamer-media-sdk. Does anyone else meet the same problem? Thanks for your reading.

7wdeepin commented 5 years ago

Solved. Setting no proxy will be ok.

Aaronreb commented 5 years ago

Solved. Setting no proxy will be ok.

Hi, Iam facing the same error. Can you please elaborate on how you solved this error? thankyou.

7wdeepin commented 5 years ago

@Aaronreb In my case, I ran commands under proxy. When I set no proxy, errors disappeared.

$ export http_proxy=
$ export https_proxy=
Ayushsharmagit commented 3 years ago

Mine was solved by adding h264_ulaw.sdp in rtsp link e.g, "rtsp://ip:port/h264_ulaw.sdp"