Instant Replay with Gstreamer

Todd Agulnick todd at agulnick.com
Tue Dec 31 09:33:55 PST 2013


Tim,

Thanks -- now this is all starting to make sense.

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?

-Todd



On Tue, Dec 31, 2013 at 5:51 AM, Tim Müller <tim at centricular.com> wrote:

> On Sun, 2013-12-29 at 01:58 -0500, Todd Agulnick wrote:
>
> Hi Todd,
>
> > Inspired by the example in the App Developers Manual, I'd been trying
> > to finalize the file by sending an EOS through the bin that contains
> > the mux and filesink. I can make that work, but the EOS also tends to
> > want to shut down the whole pipeline, which isn't what I want. So then
> > I found that I could override the bin's handle_message method to
> > discard the EOS before it bubbled up to the pipeline. It works, but
> > what a mess!
>
> You need to push the EOS to the muxer + filesink to get the file
> finalised properly.
>
> > So I was happy to see the solution that you linked below that shows
> > the code simply setting the bin to GST_STATE_NULL to trigger the
> > finalizing of the file. But I can't seem to get that to work in my
> > app.
>
> That's because this won't work right. State changes will happen from
> sink to source, so this will just make the filesink close the file
> before the other elements have a chance to finalise anything (i.e. write
> clean headers). Assuming the filesink is in the bin.
>
> > The critical difference seems to be that as soon as I decide that the
> > muxer has seen all the data intended for the current file, I want to
> > block the sourcepad on the queue upstream of the bin so that the queue
> > resumes accumulating video. And my impression is that if I'm blocking
> > buffers on that pad (with GST_PAD_PROBE_TYPE_BLOCK |
> > GST_PAD_PROBE_TYPE_BUFFER), the transition to NULL state doesn't
> > finalize the file -- the elements transition to GST_STATE_NULL, but
> > the finalization code isn't called.
>
> See above why.
>
>  Cheers
>   -Tim
>
> --
> Tim Müller, Centricular Ltd - http://www.centricular.com
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131231/77dc9386/attachment.html>


More information about the gstreamer-devel mailing list