Save an MPEG2 compressed file from live stream

Sérgio Agostinho sergio.r.agostinho at gmail.com
Tue Dec 9 08:02:13 PST 2014


>
> So I also need to probe for that on the filesink pad? And do what when it
> arrives there? - just wait for it, then I know the file is closed, is that
> the idea?


Exactly. The probe callback ensures that the file closed properly.
Refer to this
example
<http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html#section-dynamic-changing>
where
a somewhat similar situation is explained.

For the three examples you gave:

avenc_mpeg2video ! filesink


Send the eos through the filesink sink pad. Don't bother installing the
probe. Just be sure that the event was sent by checking the return value of
the gst_pad_send_event.

avenc_mpeg2video ! mpegpsmux ! filesink


Install the probe on the filesink sink pad. Send the eos on mpegpsmux sink
pad. Once you enter the callback of the probe, your file should be properly
closed.

avenc_mpeg2video ! avimux ! filesink


Similar to the last example, just send the eos on the avimux sink pad.

Cheers

2014-12-09 16:37 GMT+01:00 Paul Barber <paul.barber at oncology.ox.ac.uk>:

> Thanks for the hints,
>
> >Are properly closing the file? I.e., if you're using gst-launch are you
> >adding the -e switch to the command, or alternatively, if you're using the
> >SDK, are you sending an EOS and probing for it on the filesink sink pad?
>
> I am using the SDK, and not doing either of those things.
> At the end I am setting the pipeline to GST_STATE_READY and then
> GST_STATE_NULL, but explicitly sending an EOS.
> So I also need to probe for that on the filesink pad? And do what when it
> arrives there? - just wait for it, then I know the file is closed, is that
> the idea?
>
> Thanks for your help,
> Paul.
>
> _______________________________________________
> 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/20141209/2bd5149a/attachment.html>


More information about the gstreamer-devel mailing list