<div dir="ltr">Tim,<div><br></div><div>Thanks -- now this is all starting to make sense.</div><div><br></div><div>Can you recommend a better way to send the EOS through the muxer and filesink while preventing that EOS from bubbling up into the pipeline than the method I outlined earlier, i.e., monkey-patching handle_message of the bin containing the muxer and filesink?</div>
<div><br></div><div>-Todd</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 31, 2013 at 5:51 AM, Tim Müller <span dir="ltr"><<a href="mailto:tim@centricular.com" target="_blank">tim@centricular.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, 2013-12-29 at 01:58 -0500, Todd Agulnick wrote:<br>
<br>
Hi Todd,<br>
<div class="im"><br>
> Inspired by the example in the App Developers Manual, I'd been trying<br>
> to finalize the file by sending an EOS through the bin that contains<br>
> the mux and filesink. I can make that work, but the EOS also tends to<br>
> want to shut down the whole pipeline, which isn't what I want. So then<br>
> I found that I could override the bin's handle_message method to<br>
> discard the EOS before it bubbled up to the pipeline. It works, but<br>
> what a mess!<br>
<br>
</div>You need to push the EOS to the muxer + filesink to get the file<br>
finalised properly.<br>
<div class="im"><br>
> So I was happy to see the solution that you linked below that shows<br>
> the code simply setting the bin to GST_STATE_NULL to trigger the<br>
> finalizing of the file. But I can't seem to get that to work in my<br>
> app.<br>
<br>
</div>That's because this won't work right. State changes will happen from<br>
sink to source, so this will just make the filesink close the file<br>
before the other elements have a chance to finalise anything (i.e. write<br>
clean headers). Assuming the filesink is in the bin.<br>
<div class="im"><br>
> The critical difference seems to be that as soon as I decide that the<br>
> muxer has seen all the data intended for the current file, I want to<br>
> block the sourcepad on the queue upstream of the bin so that the queue<br>
> resumes accumulating video. And my impression is that if I'm blocking<br>
> buffers on that pad (with GST_PAD_PROBE_TYPE_BLOCK |<br>
> GST_PAD_PROBE_TYPE_BUFFER), the transition to NULL state doesn't<br>
> finalize the file -- the elements transition to GST_STATE_NULL, but<br>
> the finalization code isn't called.<br>
<br>
</div>See above why.<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888"> -Tim<br>
<br>
--<br>
Tim Müller, Centricular Ltd - <a href="http://www.centricular.com" target="_blank">http://www.centricular.com</a><br>
</font></span><div class="HOEnZb"><div class="h5"><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" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br></div>