How to share GstBuffer between multiple RTSPClient?

Nicolas Dufresne nicolas at ndufresne.ca
Mon Aug 28 12:52:30 UTC 2023


Hi,

Le dim. 27 août 2023, 19 h 15, Andrey Sotnikov via gstreamer-devel <
gstreamer-devel at lists.freedesktop.org> a écrit :

> Hi, dear GStreamer community,
>
> My company manufactures cameras. I am trying to create an application that
> shares the data from these cameras over RTSP. Here is the launch string for
> GstRTSPMediaFactory: "( appsrc name=ourcamera ! queue ! x265enc
> speed-preset=5 tune=4 option-string=colormatrix=gbr:lossless=true !
> rtph265pay name=pay0 pt=96 )".
>
> It turned out I must assign a timestamp zero to the first GstBuffer I send
> down this pipeline. Otherwise, if I assign a timestamp x seconds to the
> first GstBuffer, videoencoder will force appsink0 (added by RTSPClient) to
> wait for x seconds before sending the data.
>

You should enable
*handle-segment-change*

*Property. The push GstSample and set the GstSegment structure with the
appropriate start timestamp. This way GStreamer will translate the
timestamp to appropriate time without you having to retimestamp (hense
removing the need for shallow copy)*



> It means that if I have several connections to the RTSP server, I cannot
> send the same frame down all their pipelines, I have to make multiple
> copies of GstBuffer, just to be able to assign different timestamps.
>
> Is this first timestamp delay a bug in GStreamer, or is this intentional?
> If this is intentional, is there a way to avoid multiple copies of the same
> frame?
>
> Thank you.
> Andrey.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230828/4e744a83/attachment.htm>


More information about the gstreamer-devel mailing list