[gst-devel] Looping playback of a streamed file.
Marco Ballesio
gibrovacco at gmail.com
Sun Nov 7 08:47:40 CET 2010
Hi,
On Fri, Nov 5, 2010 at 6:32 PM, Baldur Gislason <baldur at medizza.com> wrote:
> I have an application in which I read mpeg2 transport stream from a file
> and send it out on UDP.
> I'm trying to make it loop the file, so start over from the beginning of
> the file when the end is reached.
> So far I have not been successful in doing this, any suggestions?
>
> Pipeline currently looks like this: filesrc ! mpegtsdemux ! mpegtsmux !
> bufresize ! udpsink
>
> I've tried sending seek events to every element in the pipeline and they
> all either ignore the seek or break.
> if (!gst_element_seek (tp->sink, 1.0, GST_FORMAT_TIME,
> GST_SEEK_FLAG_FLUSH,
> GST_SEEK_TYPE_SET, 0,
> GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) {
> l_debug("Seek failed!\n");
> If I do this from the signal handler on an "end of stream" event, it will
> be too late as some of the elements will have received the EOS and shut
> down, but even if I send the seeks well before the end is reached I've not
> managed to make it do what I want.
>
>
Is it out of your scope to wait for the EOS, state change to NULL and then
set again the pipeline to PLAYING?
Alternatively, you could wait for the clip to be played, say, at 95% and
then send the seek event. If the clip is longer than 1s this should avoid
the EOS from being propagated.
Regards
> There has to be a way to do this that is cleaner than shutting down,
> deleting everything and creating a new pipeline!
>
> Baldur
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20101107/25fb027b/attachment.htm>
More information about the gstreamer-devel
mailing list