How to synchronize buffer timestamp across two gstreamer pipeline(appsink,appsrc, rtspserver)

Nicolas Dufresne nicolas.dufresne at gmail.com
Sat Jun 18 15:27:26 UTC 2016


Le jeudi 16 juin 2016 à 17:05 -0400, Jake Zhang a écrit :
> Greetings,
> 
> I have been working on this for a while but still have no luck to get
> this working. My pipeline can be simplified as below: 
> 
> pipeline1:
> v4l2src -> tee -> x264enc -> appsink1  
>              ->  appsink2
>                  
> RTSP server pipeline2: 
> appsrc -> omxh264enc -> rtph264pay
> 
> Pipeline 1 have other processing unit and I will need pull buffers
> from appsink2 and push those buffers into appsrc of RTSP server. 
> My RTSP server part of implementation is very similar to test-
> appsrc.c of gst-rtsp-server 1.6.4. 
> 
> The buffer I got from appsink already has their own PTS and to get
> RTSP pipeline2 running, I have to re-stamp the buffer PTS the exactly
> same way as test-appsrc.c (set ctx->timestamp=0 and increment based
> of buffer duration) otherwise, the RTSP server will not get running. 

You don't, you can use push_sample(), so the segment is passed. And
then, on the first buffer, you can compute the running time of this
buffer (gst_segment_to_running_time()), and set the appsrc pad offset
to -running_time_first_pts. Careful, that if you add audio, you should
use the same offset for all stream, otherwise you will break a/v sync.

regards,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160618/85bd056e/attachment.sig>


More information about the gstreamer-devel mailing list