Loop a file using playbin without artefacts

Arnaud Loonstra arnaud at sphaero.org
Thu May 21 09:20:39 PDT 2015


On 2015-05-21 18:13, Nikos Chantziaras wrote:
> On 21/05/15 19:02, Arnaud Loonstra wrote:
>> Hi all,
>>
>> I'm doing a simple looping of a h264 file (raspbian provided 
>> test.h264
>> for example)
>>
>> When I receive a SEGMENT_DONE message on the bus I seek to the 
>> beginning:
>>
>> flags = Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT |
>> Gst.SeekFlags.SEGMENT
>> self.playbin.seek(1.0, Gst.Format.TIME, flags, Gst.SeekType.SET, 0,
>> Gst.SeekType.SET, -1)
>
>
> Try this instead:
>
>   gst_element_seek_simple(pipeline, GST_FORMAT_TIME,
>                           GST_SEEK_FLAG_SEGMENT, 0);
>

In python that would be

self.playbin.seek_simple(Gst.Format.TIME, Gst.SeekFlags.SEGMENT, 0)

But that just makes the video freeze at the end frame giving nonstop 
SEGMENT_DONE messages.
If I add a FLUSH it does loop but with the artefacts.


More information about the gstreamer-devel mailing list