<div dir="ltr"><div>Will answer my own question here for anybody that might encounter the same issue - eventually I found out that due to different running times of the two pipelines, pad offset for the stream that is inserted needs to be adjusted. </div><div><br></div><div>For the example given it would look something like:</div><div> gst_element_query_position(GstPipeline-1,GST_FORMAT_TIME,&pipeline_offset);<br> gst_element_query_position(GstPipeline-2,GST_FORMAT_TIME,&backup_pipeline_offset);<br> <br> gst_pad_set_offset(gst_element_get_static_pad (video5, <br> g_object_get_data(G_OBJECT(video5), "active_src_pad")),<br> pipeline_offset-backup_pipeline_offset); <br></div><div><br></div><div>br,</div><div>Vladan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 2, 2023 at 12:53 PM Vladan Jovanovic <<a href="mailto:vladan.jovanovic@gmail.com">vladan.jovanovic@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-family:monospace"><span style="font-family:monospace">Hi,</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">What should be considered when moving an
element between two GstPipelines in PLAYING state when expected behavior is for the element to just continue generating buffers continuously (without changing stream position)? <br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">Haven't found a good description
of this in documentation and I'm seeing </span>unusual behavior in a small application in which I'm testing dynamic pipeline modifications. <br></span></div><div><span style="font-family:monospace"></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">For some background of what I'm doing, simplified pipelines are shown below.</span></div><div><span style="font-family:monospace"> - GstPipeline-1 is the main pipeline where four videos are initially composed and shown on screen.</span></div><div><span style="font-family:monospace"> - After 10s GstPipeline-2 is started.<br></span></div><div><span style="font-family:monospace"> - Following instructions in (1) I modify pipelines, while in PLAYING state, so that video1 and video5 elements swap places in pipelines.<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">I would like that video5 continues from where it was prior to being moved to GstPipeline-1. However this is not the case, and video5 skips 10s of video and continues as if it was started at same time as other videos in GstPipeline-1.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">It almost seems that pipelines start_time needs to be the same for all elements and this affects video5 once it's in GstPipeline-1?<br></span></div><div><span style="font-family:monospace">Is there a way to swap in video and just have it continue from the same stream position where it was prior to being moved to a new GstPipeline?<br></span></div><div><span style="font-family:monospace"></span></div><span style="font-family:monospace"><br> .---------------------------------------------------.<br> | GstPipeline-1 |<br> | .-----------. .------------. |<br> | | video1 |--->| | |<br> | '-----------' | | |<br> | .-----------. | | |<br> | | video2 |--->| | |<br> | '-----------' | compositor | .------------.|<br> | .-----------. | |--->| videosink1 ||<br> | | video3 |--->| | '------------'|<br> | '-----------' | | |<br> | .-----------. | | |<br> | | video4 |--->| | |<br> | '-----------' '------------' |<br> | |<br> '---------------------------------------------------'<br><br> .---------------------------------------------------.<br> | .-----------. .------------. GstPipeline-2 |<br> | | video5 |--->| videosink2 | |<br> | '-----------' '------------' |<br></span><div><span style="font-family:monospace"> '---------------------------------------------------' <br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">best regards,</span></div><div><span style="font-family:monospace">Vladan</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">(1): <a href="https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c" target="_blank">https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c</a></span></div></div>
</blockquote></div>