Rtsp server with multi clients

Hi all,

after launched the test-launch in gst-rtsp-server, I can watch the stream successfully. But if there is one more client access to the stream, both clients freezes, event the setshared is on. May I know how to have multiple clients for the rtsp server with live videos? Thanks

Hi,
Please share which source is in the pipeline. Some sources are not able to support the function. It should work with videotestsrc or filesrc.

$ ./test-launch "videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"

I have tried your command with no success.

I have the following log:

stream ready at rtsp://127.0.0.1:8554/video_feed0
Opening in BLOCKING MODE
0:00:05.569020329 1500 0x7f7400ab70 WARN v4l2 gstv4l2object.c:2372:gst_v4l2_object_add_interlace_mode:0x7f74071c50 Failed to determine interlace mode
0:00:05.569260947 1500 0x7f7400ab70 WARN v4l2 gstv4l2object.c:2372:gst_v4l2_object_add_interlace_mode:0x7f74071c50 Failed to determine interlace mode
0:00:05.569364791 1500 0x7f7400ab70 WARN v4l2 gstv4l2object.c:2372:gst_v4l2_object_add_interlace_mode:0x7f74071c50 Failed to determine interlace mode
0:00:05.569623746 1500 0x7f7400ab70 WARN v4l2 gstv4l2object.c:4430:gst_v4l2_object_probe_caps:nvv4l2h264enc0:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:05.572737607 1500 0x7f6c0075e0 FIXME default gstutils.c:3981:gst_pad_create_stream_id_internal:videotestsrc0:src Creating random stream-id, consider implementing a deterministic way of creating a stream-id
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:05.591540043 1500 0x7f6c0075e0 WARN v4l2bufferpool gstv4l2bufferpool.c:1057:gst_v4l2_buffer_pool_start:nvv4l2h264enc0:pool:src Uncertain or not enough buffers, enabling copy threshold
H264: Profile = 66, Level = 0
0:00:05.603883034 1500 0x7f64002400 WARN v4l2bufferpool gstv4l2bufferpool.c:1503:gst_v4l2_buffer_pool_dqbuf:nvv4l2h264enc0:pool:src Driver should never set v4l2_buffer.field to ANY
0:00:05.606902939 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:05.611245973 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:05.611303800 1500 0x55ae941590 WARN rtspmedia rtsp-media.c:3867:gst_rtsp_media_suspend: media 0x7f74093260 was not prepared
0:00:05.618010454 1500 0x55ae941590 FIXME rtspclient rtsp-client.c:1657:handle_play_request:GstRTSPClient@0x55aeb1d0f0 Add support for seek style (null)
0:00:15.113281623 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:15.143647305 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:15.176589256 1500 0x7f7400b2d0 FIXME default gstutils.c:3981:gst_pad_create_stream_id_internal:appsrc0:src Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:15.178936781 1500 0x55ae941590 FIXME rtspclient rtsp-client.c:1657:handle_play_request:GstRTSPClient@0x55aeb1d200 Add support for seek style (null)
0:00:15.181293809 1500 0x55ae941590 WARN basesrc gstbasesrc.c:1668:gst_base_src_perform_seek: duplicate event found 217
0:00:15.181949293 1500 0x55ae941590 WARN basesrc gstbasesrc.c:1668:gst_base_src_perform_seek: duplicate event found 217
0:00:25.786801886 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:25.788400034 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:25.790744230 1500 0x55ae941590 FIXME rtspclient rtsp-client.c:1657:handle_play_request:GstRTSPClient@0x55aeb1d310 Add support for seek style (null)
0:00:36.320922903 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:36.323420130 1500 0x55ae941590 FIXME rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:36.327423245 1500 0x55ae941590 FIXME rtspclient rtsp-client.c:1657:handle_play_request:GstRTSPClient@0x55aeb1d420 Add support for seek style (null)
0:00:38.863756758 1500 0x7f7400b2d0 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop: error: Internal data stream error.
0:00:38.864076867 1500 0x7f7400b2d0 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop: error: streaming stopped, reason not-linked (-1)
0:00:38.864766561 1500 0x7f7400ab70 WARN rtspmedia rtsp-media.c:2725:default_handle_message: 0x7f74093260: got error Internal data stream error. (gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:media-pipeline/GstAppSrc:appsrc0:
streaming stopped, reason not-linked (-1))

Update is that:

Using the same test-launch, multi-client streaming works in my ubuntu 18.04 with gstreamer 1.18 desktop…

Hi,
We can launch RTSP server on JP4.5/Xavier and have multiple clients(from a Ubuntu PC and a Windows PC) successfully. What is your L4T release version?

R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t186ref, EABI: aarch64, DATE: Fri Oct 16 19:37:08 UTC 2020

jetpack 4.4.1

Hi,
Do you run a different pipeline? In the log, there is link failure with appsrc plugin. This should not be present if you use videotestsrc plugin.

I am able to have multi-clients with videosrc and filesrc after flashing with jetpack 4.5.1

You mentioned that not all src can have multi-clients

My case is images generated by opencv, and push to appsrc by gst-buffer with call back function on_need_data.

Is that appsrc supported for multiclient stream? Thank you very much.

Hi,
We are not sure if it is supported with appsrc. Suggest you try the reference sample with multi-clients:
gst-rtsp-server/test-appsrc.c at master · GStreamer/gst-rtsp-server · GitHub

If it works, you may refer to the sample for developing your usecase. And may go to gstreamer forum to get further suggestion.