<div dir="ltr">Hey, <div><br></div><div>Some thoughts</div><div><br></div><div>1 - </div><div>If you're only sending the eos on the callback of the block probe, I would expect data flow to be blocked upstream of the queue's src pad by that time. The EOS event is serialized with data so I don't think there's a way for it to reach splitmuxsink.</div><div><br></div><div>What I would do is to place a probe on the splitmuxsink sink pad, with the flag GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM and then verify the EOS in the callback with </div><div><br></div><div><font face="monospace, monospace">GstPadProbeReturn </font></div><div><font face="monospace, monospace">eos_cb(GstPad *pad, GstPadProbeInfo * info, gpointer user_data)</font></div><div><font face="monospace, monospace">{</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">  if (GST_EVENT_TYPE (GST_PAD_PROBE_INFO_DATA (info)) != GST_EVENT_EOS)</font></div><div><font face="monospace, monospace">      return GST_PAD_PROBE_PASS; </font></div><div><font face="monospace, monospace"> </font></div><div><font face="monospace, monospace">  //you've received the EOS do whatever you need to do here</font></div><div><div><font face="monospace, monospace">  return GST_PAD_PROBE_REMOVE;</font></div><div><font face="monospace, monospace">}</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">and send the EOS on queue's sink pad. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Cheers</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-23 22:26 GMT+02:00 cottrelld <span dir="ltr"><<a href="mailto:david@elarm.com" target="_blank">david@elarm.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks for the fast reply.  Some further questions:</div><div><br></div><div><b>1.  I tried to send EOS and wait but it didn't result in a valid video.</b></div><div><br></div><div>My pipeline is like this:    otherstuff | tee | queue | x264enc | splitmuxsink</div><div><br></div><div>I first put a block on the src pad of the queue.  In the callback,  I send an EOS on the sink pad of the queue.  </div><div><br></div><div>The in-progress last video get's written, but it's not valid.  it has non-zero length but nothing can open it.  The rest of the videos created by the splitmuxsink before that are fine.  Note, I'm not releasing the block from the queue src at all right now, and I'm not removing the splitmuxsink.  I left it running to see if it'd close the video ok.</div><div><br></div><div>Should I be sending it someplace else?  I notice the send_eos in splitmuxsink sends it on the peer of the multiqueue... </div><div><br></div><div><b>2.  How do you capture the EOS on the splitmuxsink bus?</b></div><div><br></div><div>When you say I should wait for <span style="font-size:12.8000001907349px">splitmuxsink to post EOS on its bus, do you mean setup a callback like the following:</span></div><div><span style="font-size:12.8000001907349px"> gst_bus_add_watch (GST_ELEMENT_BUS (m_writeSink), bus_cb_writeSink, m_loop);</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">If so, I don't get any callbacks on that.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Thanks for the help,</span></div><div><span style="font-size:12.8000001907349px">-David</span></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Jul 23, 2015 at 2:54 AM, Jan Schmidt-6 [via GStreamer-devel] <span dir="ltr"><<a href="http:///user/SendEmail.jtp?type=node&node=4672822&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span> wrote:<br></div></div><blockquote style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote"><div><div class="h5">

        On 23/07/15 15:25, cottrelld wrote:
<br>> Hi.
<br>>
<br>> I have a pipeline with a tee.  One of the tee channels is a motion detector.
<br>> Upon detecting motion, it fires up another tee channel with a splitmuxsink.
<br>>
<br>> When motion is stoped, we want to close splitmuxsink.  I've tried just
<br>> removing it, and also tried sending an EOS, but it simply closes the file
<br>> and leaves it in an unplayable state.
<br><br>EOS is a valid way to close the stream and end the file, but you need to 
<br>wait until the splitmuxsink posts EOS on its bus to know that that has 
<br>actually completed - simply sending the EOS event on the sink pad(s) and 
<br>changing the state to NULL won't give it a chance to process the EOS fully.
<br><br>> In addition, I try to be able to readd the splitmuxsink in the future when
<br>> we need it again, but it doesn't seem to want to work as normal.
<br><br>There may be a bug around being reusable - I'm not sure that's been 
<br>properly tested yet. splitmuxsink is pretty new.
<br><br>> Is there a way to gracefully end the last video correctly?  And is the
<br>> splitmuxsink designed to be able to be removed and added at will?
<br><br>Cheers,
<br>Jan.
<br></div></div><div><div><div><div class="h5"><br>>
<br>> Thanks!
<br>> -David
<br>>
<br>>
<br>>
<br>> --
<br>> View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/splitmuxsink-arbitrary-close-tp4672799.html" rel="nofollow" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/splitmuxsink-arbitrary-close-tp4672799.html</a><br>> Sent from the GStreamer-devel mailing list archive at Nabble.com.
<br>> _______________________________________________
<br>> gstreamer-devel mailing list
<br></div></div>> <a href="http:///user/SendEmail.jtp?type=node&node=4672809&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br>> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>>
</div>_______________________________________________
</div>gstreamer-devel mailing list
<br><a href="http:///user/SendEmail.jtp?type=node&node=4672809&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://gstreamer-devel.966125.n4.nabble.com/splitmuxsink-arbitrary-close-tp4672799p4672809.html" rel="nofollow" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/splitmuxsink-arbitrary-close-tp4672799p4672809.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from splitmuxsink arbitrary close, <a rel="nofollow" link="external">click here</a>.<br>
                <a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a>
        </div></blockquote></div><br></div>


        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/splitmuxsink-arbitrary-close-tp4672799p4672822.html" target="_blank">Re: splitmuxsink arbitrary close</a><br>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/" target="_blank">GStreamer-devel mailing list archive</a> at Nabble.com.<br><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>