Loop player for GStreamer

Sebastian Dröge sebastian at centricular.com
Wed May 6 01:28:24 PDT 2015


On Mo, 2015-05-04 at 09:43 +0200, Thomas Scheuermann wrote:
> Am 04.05.2015 um 09:27 schrieb Sebastian Dröge:
> 
> > On Mo, 2015-05-04 at 09:15 +0200, Thomas Scheuermann wrote:
> > > Hi all,
> > > 
> > > I need to write a player that loops over a file and plays it
> > > continuously. I found in some mails that I should use gst_element_seek
> > > with GST_SEEK_FLAG_SEGMENT. But it doesn't work. Here is the event loop
> > > I use:
> > > [...]
> > What kind of file are you using, which container format? And which
> > GStreamer version? Until recently there were some bugs related to this.
> > 
> > The procedure in general is to a) first to a FLUSHING|SEGMENT seek to
> > your start position, then b) whenever you receive the segment-done
> > message you would do a SEGMENT (non-flushing!) see to the loop start and
> > c) in the very end for the last loop you do a non-segment, non-flushing
> > seek for the last loop (so that you get EOS in the end instead of
> > segment-done).
> At the moment I try on Ubuntu 14.04 with GStreamer 1.2. But I will now
> try on Debian Jessie with GStreamer 1.4.
> I use at the moment an H264 file from youtube for testing (mp4
> container).

Then see https://bugzilla.gnome.org/show_bug.cgi?id=726709 and
especially https://bugzilla.gnome.org/show_bug.cgi?id=726709#c12

For MP4 things were just fixed recently in GIT for segment/non-flushing
seeks.

> When do I have to send a)? When the pipeline has gone to ready state
> or playing state?

Paused state (or playing). What you usually do there is that you set
your pipeline into paused, wait until it reaches paused and then go
through the segment seek logic.

If you don't want to see the initial frame of the initial paused,
there's the show-preroll frame property on all video sinks.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150506/741008ea/attachment.sig>


More information about the gstreamer-devel mailing list