Crash when trying to stop pipeline containing encodebin

Sebastian Dröge sebastian at centricular.com
Fri Jun 10 07:26:49 UTC 2016


On Do, 2016-06-09 at 10:17 -0400, Michael Guinzbourg wrote:
> Sebastian, thank you so much for your great support and patience. I
> think I figured out the root cause of the problem here.
> The errors are due to the fact that I'm trying to encode a stream
> which is taken as an output from the playbin (I have custom videosink
> connected to playbin). The source video is a playlist which plays
> live feed from web cam. The problem is that the source plays the same
> stream several times before it shifts to the next available time. The
> encoder reads same stream several times and expect that we move
> forward in time but we keep playing same chunk of data many times.
> There's perfect output from the playbin for this stream but if I
> direct it to the encodeer it complains with the errors like pts is
> less then it should be. Could you please advice me how I can handle
> this problem? So somehow I need to tell encoder - please ignore pts
> and treat all incoming data as sequential. I couldn't find how I can
> do it but you may have some idea for me.

You will have to offset (gst_pad_set_offset() for example) the running
time by the amount of time that was played after every track, or
alternatively use the gapless feature of playbin (the about-to-finish
signal), which also does that. If switching from one track to another
involves going back to the READY state, or flushing seeks, you will
have to solve that so the encoder sees a continuous timeline.

Maybe for your use case it would be best to use GES, which allows you
to set up a timeline of clips in some way and then render that to a
file or to the display.
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-editing-services/html/

It should make what you're doing here almost trivial :)

-- 
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: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160610/be549068/attachment.sig>


More information about the gstreamer-devel mailing list