<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class="">
Hi all,<div class=""><br class=""></div><div class="">Im not sure if im at the right place to ask this, feel free to redirect me a more proper forum (I just started to familiarize with GStreamer so any feedback appreciated).</div><div class=""><br class=""></div><div class="">I work on an application which consist of multiple pipelines:</div><div class=""><ul class=""><li class="">Video source: capture video, do some simple operation on it (encode and overlaying) and passing the output to an appsink</li><li class="">Audio source: capture audio and forward it to an appsink</li><li class="">Streamer: sending the video (and maybe later audio as well) over as UDP stream or WebRTC (live video)</li><li class="">Buffer: a plain c++ class which stores the buffers for a configured time (it can be changed dynamically, and the audio and video buffer time can be different)</li><li class="">Filewriter: this is a simple filesink, when its triggered I push the buffers to it's audio and video appsrc with the gst_app_src_push_buffer methond (at the moment I encode the video with VP8 to a webm file using a webmmux).</li></ul></div><div class=""><br class=""></div><div class="">The audio and video pipelines are started at the same time (sequentially after each other), the  filewriter is initiated as a record request arrives.</div><div class=""><br class=""></div><div class="">VideoSource ----------------->    LiveStream</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                     </span>|</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                 </span>\</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                 </span>   ------------><span class="Apple-tab-span" style="white-space:pre">               </span>  <span class="Apple-tab-span" style="white-space:pre">     </span>    record trigger</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                                            </span>Buffer<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">---------------- </span>X <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">----------------</span>><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">    </span>FileWriter</div><div class="">AudioSource -----------------></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I have two kinds of issues:</div><div class=""><ul class=""><li class="">I cannot make the audio and video sync in the filewriter</li><li class="">During playback the playtime counter not starts from 0 (I think it is somehow receiving the timestamp from the <font color="#000000" class=""><span style="caret-color: rgb(255, 255, 255);" class="">Video source, so when I start the video in VLC it start countig from eg.: 30 seconds which is the amount of time I waited until I triggered the record</span></font>) and Im not able seek in the video file.</li></ul></div><div class=""><br class=""></div><div class="">I tried to play around with following approaches:</div><div class=""><ul class=""><li class="">the 'do-timestamp' and 'is-live' properties on the filewriter's receiving appsrc</li><li class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">reset the timestamps on the buffers (audio and video) with 'GST_BUFFER_PTS' to a sequentially value starting from zero and  increased with the duration</span></li><li class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">adjust the timestamps on the buffers (audio and video) with 'GST_BUFFER_PTS' with the time difference between the start times of the source and filewriter timelines</span></li><li class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">tried to sync all piplines by setting the same clock on them and use the same basetime on them</span></li></ul><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div></div><div class=""><font color="#000000" class="">I think I miss some fundamental thing here. Can you give me some hints how should I properly do this time synchronisation?</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Thanks a lot!</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Bests,</font></div><div class=""><font color="#000000" class="">Peter</font></div></body></html>