gst-rtsp-server shared media not working as expected
Nirbheek Chauhan
nirbheek.chauhan at gmail.com
Tue Jul 13 10:50:10 UTC 2021
Hi Alan,
You would need to look at the GST_DEBUG logs of gst-rtsp-server to
figure out what RTSP commands are being sent on connect / disconnect
by VLC and rtspsrc. If I remember correctly, VLC uses live555 which
has a sub-par RTSP client implementation and it may just be doing the
wrong thing. For instance, it may be sending a Range header in the
PLAY request that forces the server to seek to the beginning of the
file.
As for rtspsrc, it actually sends a PAUSE request when stopping, so
you need to intercept that using the "before-send" signal. See also:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/908
where I had to revert my attempt at fixing this. I am sure there are
other bugs there too, but they should be fixable.
You may also like to use gstreamer master for rtspsrc. There have been
a number of fixes for shared RTSP playback and seeking there
(multicast, udp, etc).
Cheers,
Nirbheek
On Mon, Jul 12, 2021 at 12:15 PM Alan via gstreamer-devel
<gstreamer-devel at lists.freedesktop.org> wrote:
>
> Hello,
>
> I've been experimenting with the gst-rtsp-server test-launch.c example, I noticed that gst_rtsp_media_factory_set_shared(factory, TRUE) is not working as expected. That is, when a second rtsp client connects and requests the video stream, the server restarts the first rtsp client video stream. So both clients end up getting video from the beginning of the stream (file).
>
> Is this a bug or as designed?
>
> Steps to reproduce:
> 1) ./test-launch "( filesrc location=input.mp4 ! qtdemux name=d ! tee name=t ! queue ! h264parse config-interval=-1 ! rtph264pay pt=96 name=pay0 )"
> 2) start VLC Player and connect to rtsp://127.0.0.1:8554/test and wait for video to stream a few minutes
> 3) start another instance of VLC Player and connect to rtsp://127.0.0.1:8554/test, wait for video to stream, the stream starts at the beginning of the input.mp4 and the video stream in step 2 above stops and plays from the beginning of the file.
>
> The behavior is the same for rtsp server 1.16.2 and 1.18.4. Oddly, if I start two gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! ... instead of VLC Player this works: the second stream plays at time of connection; however, if I start/stop one of the rtsp clients, video freezes and doesn't play for the newly started client (at times, the stream totally ends for both rtsp clients) . So it doesn't seem to be robust or reliable.
>
> Thanks
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list