Issue with closing rtsp pipelines

772 views
Skip to first unread message

Manoj Nirala

unread,
Oct 23, 2020, 5:29:35 AM10/23/20
to gstream...@googlegroups.com
Dear All,

I am building a java application which reads from an IP camera as video source. The gstreamer pipeline works fine while it is playing, but is not closing properly. I get the following error message(s) when I try to do either pipe.pause( ) or pipe.stop( ):

busMessage >>> GstMessageProgress, type=(GstProgressType)GST_PROGRESS_TYPE_START, code=(string)request, text=(string)"Sending\ PAUSE\ request", percent=(int)0, timeout=(int)-1;
busMessage >>> GstMessageProgress, type=(GstProgressType)GST_PROGRESS_TYPE_CONTINUE, code=(string)request, text=(string)"Sending\ PAUSE\ request", percent=(int)0, timeout=(int)-1;

busMessage >>> GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtspsrc.c(6157):\ gst_rtspsrc_send\ ():\ /GstPipeline:pipeline1/GstRTSPSrc:videoSrc:\012Option\ not\ supported\ (551)", details=(structure)"details,\ rtsp-status-code=(uint)551,\ rtsp-status-reason=(string)"Option\\ not\\ supported";";
Error >>> Bin: [videoSrc] : Unhandled error
Error >>> Bin: [videoSrc] : Could not write to resource.

My understanding of closing pipelines is derived from how we close ksvideosrc pipelines. Clearly, IP cameras form a different use case. Could any one please offer us an example on how to properly close/pause IP cameras (rtspsrc) pipelines? We would also like to have a re-start button which should restart the pipeline after being paused. So clearing the pipeline entirely is not a solution that we are looking for.

Thank you,
Best Regards,
Manoj

christoph...@laposte.net

unread,
Oct 23, 2020, 6:24:41 AM10/23/20
to gstream...@googlegroups.com

Hello,
It seems to be the same problem I had with v4l2src.
Normally, you should send an EOS event to the pipeline to stop the capture and wait all buffers have been consumed by the sink with EOS notification, and after stop the pipeline.


-------- Message original --------
De : Manoj Nirala <nirala...@gmail.com>
Date : ven. 23 oct. 2020 à 11:29
À : gstream...@googlegroups.com
Objet : [gstreamer-java] Issue with closing rtsp pipelines
--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/CAH49uEp1A-LMV1_Kz92Y2BaPvNJH9Yu9F4-hCxfUpbwhW6Lf0w%40mail.gmail.com.

Manoj Nirala

unread,
Oct 23, 2020, 9:19:48 AM10/23/20
to gstream...@googlegroups.com
Hi christophe,

I am doing exactly what you have recommended. To be more precise, here is the code snippet:

pipe.sendEvent(new EOSEvent());

try {
      while (!isEosReached()) {
      Thread.sleep(50);
}
} catch (Exception e) {
}

pipe.pause();
pipe.ready();
pipe.stop();

In fact, this closing strategy works absolutely fine when applied on a ksvideosrc pipeline, which operates on a webcam or a USB cam. The issue arises only in case of IP camera (rstpsrc) connection pipelines. I suspect this is because unlike webcams, IP cameras don't have to stop streaming when the capture is stopped in the app. Rather, we simply have to disconnect the rtsp connection from the source, and re-connect when a new capture has to be made. If I am correct, then I am unable to find a mechanism to disconnect from the source and connect back. If you think otherwise, please let me know too.

Thanks & Regards,
Manoj



christoph...@laposte.net

unread,
Oct 23, 2020, 9:45:21 AM10/23/20
to gstream...@googlegroups.com


I never use IP camera but if the plug-in is configured as a source, it should stop capture on EOS.

Have you activated logs on gstreamer?
Which version of gstreamer are you using?


-------- Message original --------
De : Manoj Nirala <nirala...@gmail.com>
Date : ven. 23 oct. 2020 à 15:19
À : gstream...@googlegroups.com
Objet : Re: Re : [gstreamer-java] Issue with closing rtsp pipelines

Manoj Nirala

unread,
Oct 23, 2020, 11:29:31 AM10/23/20
to gstream...@googlegroups.com
Hi Christophe,

There is no problem with EOS. That is doing the job. Problem is with pipe.pause(). The gstreamer log complains that the rtsp stream did not close successfully. When I searched online, I got suggestions that I should use the teardown feature to disconnect from the rtsp source. However, it is not clear how to use this, especially in Java. We are using gstreamer 1.14.5. 

Thanks & Regards,
Manoj 

Reply all
Reply to author
Forward
0 new messages