I&#39;m working on a app that needs to dynamically add/remove outputs without affecting already active outputs. Below is a simple example.<div><br></div><div>1. Receive an RTP stream with audio/video and playback both.</div>
<div>2. Stop audio output associated with the above stream.</div><div>3. Receive a 2nd RTP stream with audio and playback audio.</div><div>4. Stop 2nd RTP stream.</div><div>5. Connect audio output back to the first RTP stream without affecting the video.</div>
<div><br></div><div>In order to be able to dynamically add/remove outputs I have separated the input (udpsrc/depay/demux), the video output (decode/vidsink) and the audio output (decode/audsink) into 3 separate pipelines and link them together with ghost pads. This seems to work well for doing the above controls, but I have 2 problems. </div>
<div><br></div><div>1. Synchronization is a mess. It looks like each pipeline is using a different clock and as a result audio/video is out of sync. </div><div>2. Adding a new output pipeline to a running input pipeline result in out of sync clocks, so the newly added output thinks it is too far ahead/behind and just dumps all data instead of outputting it. Disabling sync and the newly added pipeline starts playing fine, but of course it is out of sync.</div>
<div><br></div><div>I think the second problem can probably be improved or eliminated by forcing a new segment event when linking the output, but still the clocks need to be synchronized between the pipelines in order for a/v to sync correctly and playback smoothly.</div>
<div><br></div><div>Any thoughts on how to better handle these problems? Maybe forcing the output pipelines to use the input pipelines clock? Or perhaps there is a way to maintain the control I need without using 3 different pipelines? </div>
<div><br></div><div>Thanks for the help.</div><div><br></div><div>Attila</div>