<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">---------- Forwarded message ----------<br>From:š4ernov &lt;<a href="mailto:4ernov@gmail.com">4ernov@gmail.com</a>&gt;<br>
To:š<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>Date:šWed, 16 Mar 2011 14:38:15 +0300<br>Subject:šRe: Issues with valves<br>Hello, Hector,<br>
<br>
&gt; Hi everybody,<br>
&gt;<br>
&gt; I&#39;m new in GStreamer but trying to move faster through it.<br>
&gt;<br>
&gt; I&#39;m recording video with basic pipelines and now I&#39;m trying to use valves to<br>
&gt; regulate the record (stop/pause/cut...).<br>
&gt; The problem is that the pipeline won&#39;t pass Prerolling when the valves are<br>
&gt; initialised dropping.<br>
<br>
I&#39;d say using valves is not the best way for your case as it&#39;s very<br>
easy to drop some useful data (e.g. events or buffers) with them.<br>
Dynamic changes in pipeline is better but they also have a bunch of<br>
problems you need to solve.<br>
<br>
&gt;<br>
&gt; I&#39;ve also try to change sinks on-the-move (Playing) but it didn&#39;t work as I<br>
&gt; expected.<br>
&gt;<br>
&gt; Any tips?<br>
<br>
If I get it right what you&#39;re trying to do is to change the pipeline<br>
dynamically. Well, it&#39;s not the easiest part of work with GStreamer, I<br>
should say. There&#39;re several posts in the list about it here and<br>
there, but to sum everything ÇÚ here&#39;re the problems one need to solve<br>
to change the pipeline dynamically in proper way:<br>
1. Branch synchronization if some of the sinks is in sync (e.g.<br>
streaming video to ximagesink and capturing it to file<br>
simultaneously): it&#39;s necessary to use queue for each branch.<br>
2. To reconnect elements on the fly one need to look after the<br>
remaining pipeline. It&#39;s done by either blocking pads of changing<br>
branch or using valves (so dangerous).<br>
Besides that you should take into account that with every problem the<br>
pipeline is stalled hard without any messages even on DEBUG log level.<br>
It make the debugging difficult very much. Also these instructions<br>
work quite stable only for PLAYING state and have many issues for<br>
others. For example, if you block pads in PAUSED state, it will stall<br>
the pipeline forever as no buffers are streamed through the pipeline<br>
in this state. And finally, remember that elements are not guaranteed<br>
to be reusable i.e. if you create pipeline from scratch, set it to<br>
PLAYING state, then set it to READY and again to PLAYING, it&#39;s not<br>
guaranteed that the behavior is the same as if you create a new one<br>
instead of setting the existing pipeline to READY and then to PLAYING.<br>
<br>
So, there&#39;s some hope that it would be changed in the future releases,<br>
but now it&#39;s not easy at all to change the pipeline dynamically.<br>
<br>
Hope it helps</blockquote><div><br>I&#39;m trying to do similar, but my app is using three pipelines<br>(oversimplified):<br><br>v4l2src ! appsinkšš (data source)<br><br>(There is some image processing in between)<br><br>
appsrc ! encoder ! muxer ! filesinkš (data recorder)<br>appsrc ! xvimagesinkš (live data monitor)<br><br><br>The xvimagesink always runs, my problem is I need to send EOS to the filesink pipeline, stop it, change file location and restart at the next recording epoch.<br>
<br>Is this notš a viable approach?<br><br>My current stumbling block is sending the EOS.š It seems to work well if I just start and stop everything all at once by closing the xvimagesink window but my encoded files only play back on Linux, not Windows presumably because they are not getting the EOS before exiting.<br>
<br>Also I&#39;m a bit fuzzy on what exactly the GST_FORMAT_TIME from the appsrc examples is doing as opposed to other or default options<br>g_object_set(G_OBJECT appsrc, &quot;format&quot;, GST_FORMAT_TIME, NULL);<br><br>
<br></div>