Synchronizing appsrcs that subscribe to appsink on different times

Mert Can Ergun mert.ergun at mikro-tasarim.com.tr
Wed Dec 14 10:54:27 UTC 2016


I have tried to build a system to allow gst-rtsp-server plugin to host the
same source element on different mapping points.

My system consists of a source pipeline that is built as "videotestsrc !
appsink caps=\"video/x-raw,width=640,height=512,format=GRAY8\""
This source pipeline is kept seperate from RTSPMediaFactory pipelines. Its
state it changed to PLAYING as soon as a client connects to the server,
and server builds up an appsrc accordingly. And its state is changed back
to NULL when there are no more clients left on the server.

RTSPMediaFactory pipelines are built as "appsrc name=appsrc0/1 caps=\"same
as source\" ! some specific elements for each pipeline ! x264enc !
rtph264pay name=pay0". I listen media-configure signal in order to capture
newly built appsrcs so I can register them to a list and use _push_sample
to pass buffers around.

I will name client1(C1) as the client who connects to the first mapping
point(M1), and client2(C2) as the client who connects to the second
mapping point(M2).

The working scenario is:
C1 connects to M1 at t0. C2 connects to M2 at a time t1 which meets the
condition: t1 - t2 < 0:08 (approximately). In this scenario; both VLC
players are able to stream the video to the user.

Non working scenario is
C1 connects to M1 at t0. C2 connects to M2 at time t1 > t0 + 0:10 (again,
approximately). In this scenario; C1 is able to continue playing fine, but
C2 is not able to stream any video. After a while, C2 drops without any
error(OPTIONS,DESCRIBE,SETUP,PLAY sequences are done fine, but no data
arrives to the C2).
Via logs I am able to see that samples are sent fine and GST_FLOW_OK
answer is returned to them on the appsink side.

How can I solve this seemingly synchronization problem to achive multiple
mapping(mount) point RTSP server on the same source pipeline?

-------------------------------
Mert Can Ergun
Yazilim Gelistirme Muhendisi

Mikro-Tasarım Elektronik San. ve Tic. A.Ş.
ODTU-Teknokent ODTU-MET Alani
A-1 Blok 4. Bolum Ofis 3/A
TR-06530 Ankara
T: +90 312 286 0103
F: +90 312 286 0104
U: www.mikro-tasarim.com.tr
E: mert.ergun at mikro-tasarim.com.tr
-------------------------------



More information about the gstreamer-devel mailing list