<div dir="ltr">Hello everyone,<div><br></div><div>I have a pipeline which is making a <b>new-sample</b> callback, that is to say when a frame arrives this function is invoked:</div><div><br></div><div>static GstFlowReturn new_sample_jpeg(GstElement *sink, MainContext *ctx)</div><div><br></div><div>I have a pipeline which every few seconds will use splitmuxsink to save the video. For this I have a <b>format-location</b> callback with function signature:</div><div><br></div><div>static gchararray format_location_callback(GstElement* splitmux, guint fragment_id, gpointer udata)</div><div><br></div><div><br></div><div>When this jpeg arrives, I need to know the exact place it is in that current video in splitmuxsink.</div><div><br></div><div>@Nicolas Dufresne has very kindly pointed me to the gst_segment_to_running_time(..) function or has recommended a custom time function.</div><div><br></div><div>i) Based on my understanding, I have to get a GstSegment and init it with gst_segment_init  at the start of the current video (either in format-location or new-sample)</div><div>ii) Then I reinit the GstSegment when the file is saved by splitmuxsink in format</div><div><br></div><div>If this is correct, my next question is how do I get the GstSegment object ? Currently, the code samples I am seeing show the GstSegment as an input into the function already.</div><div><br></div><div>Can it be obtained from GstElement or MainContext  ?</div><div><br></div><div>Thank you all. Best regards.</div><div><div><br></div>-- <br><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="font-size:12.8px">Sincerely,</span><div><br></div><div>Dwight Kulkarni                </div><div><br></div></div></div></div></div></div></div></div></div>