RTSP server test-appsrc connection problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

RTSP server test-appsrc connection problem

tanguy
Hello,

Our code is based on test-appsrc.c, when the rtsp server is run, all new
client connections are accepted and are still accepted if there is always
one client connection alive.

When all client connections are closed, it is not possible to connect
anymore to the server.

The code is available here:
https://gist.github.com/Mezzano/43789624d4983d70bcd9610ecaddbb30

Can someone help us?

Thanks



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP server test-appsrc connection problem

Michael MacIntosh
When the first client connects, it should call media-prepare (which it
looks like it is doing)

When everyone disconnects, the media itself will emit the signal
"unprepared", you can take advantage of this to do clean-up, etc. I
can't really tell how you are doing clean-up at the moment, or what you
want to happen when everyone disconnects (should it still be playing /
pause / or stop and tear down).

When the next client connects, the media factory should call
media-prepare again.  Is this happening?  Are you getting any error log
output?



On 2/5/2018 10:12 AM, tanguy wrote:

> Hello,
>
> Our code is based on test-appsrc.c, when the rtsp server is run, all new
> client connections are accepted and are still accepted if there is always
> one client connection alive.
>
> When all client connections are closed, it is not possible to connect
> anymore to the server.
>
> The code is available here:
> https://gist.github.com/Mezzano/43789624d4983d70bcd9610ecaddbb30
>
> Can someone help us?
>
> Thanks
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP server test-appsrc connection problem

tanguy
Hi Michael,

Here are some logs:
https://gist.github.com/Mezzano/a28d798120355507ae35a3d1e6400749

1st client connects
2d client connects
2d client disconnects
1st client disconnects
1st client try to connect

When everyone disconnects, it should still be playing.
In the logs gst_rtsp_media_prepare is called when next client wants to
connect (00:22.596375) and (00:33.488205).



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP server test-appsrc connection problem

Michael MacIntosh
Hello,

 From what I can tell it looks like it is preparing the media when the
first client connects, but when the first client disconnects the
pipeline state is being set to null, and is calling unprepare.  You
might need to handle this event such that you can reconnect to the rtsp
server.  You could also potentially try setting the suspend mode
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-rtsp-server/html/GstRTSPMedia.html#gst-rtsp-media-set-suspend-mode

Personally I have it set to GST_RTSP_SUSPEND_MODE_NONE, but I have a
feeling you need to handle the unprepare so you can prepare again.

I find the line:

0:00:12.859426345 25781 0x67501f50 INFO  
rtspstream rtsp-stream.c:1349:find_transport: finding
10.1.41.238:43859 in 2 transports

To be rather suspicious, it almost looks like it doesn't fully remove
the client.

I am also assuming this breaks if you have 1 client disconnect and
reconnect?

I wish I could be more help, but this is a lot to look over.

Cheers,
Michael.

On 2/6/2018 8:06 AM, tanguy wrote:

> Hi Michael,
>
> Here are some logs:
> https://gist.github.com/Mezzano/a28d798120355507ae35a3d1e6400749
>
> 1st client connects
> 2d client connects
> 2d client disconnects
> 1st client disconnects
> 1st client try to connect
>
> When everyone disconnects, it should still be playing.
> In the logs gst_rtsp_media_prepare is called when next client wants to
> connect (00:22.596375) and (00:33.488205).
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP server test-appsrc connection problem

tanguy
Hi Michael,

Thanks for your reply.
When all clients disconnect, I get into the signal "unprepared".
Catching the signal and doing gst_rtsp_media_prepare(media,NULL); is not
enough, not sure if this is the correct way to prepare again correctly.

When adding GST_RTSP_SUSPEND_MODE_NONE, I am able to reconnect (after a
first all clients disconnect) but the first client connection stream is
missing a lot of frames:

Additional debug info:
gstbasesink.c(2854): gst_base_sink_is_too_late ():
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: A
lot of buffers are being dropped.

What should I do to either never go into "unprepared" mode or to correctly
fully remove last client and be able to "prepare" again correctly?

Thanks for helping, I've got the feeling its not that much to adapt.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP server test-appsrc connection problem

tanguy
Hi again,

I've found "gst_rtsp_media_factory_is_stop_on_disonnect", but it is on the
master branch. I'm using branch 1.4 to be compatible with my Gstreamer
Framework version. Could I use the master version of gst-rtsp-server on my
1.4 framework?

I see also that the online gtk doc is not up to date with the master branch
(I don't find any gst_rtsp_media_factory_is_stop_on_disonnect  method in
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-rtsp-server/html/GstRTSPMediaFactory.html#gst-rtsp-media-factory-is-eos-shutdown.

Thanks



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel