How can i force to end all streams (or pipeline) at a specific timestamp

Nicolas Dufresne nicolas.dufresne at gmail.com
Fri Feb 26 20:50:07 UTC 2016


Le jeudi 25 février 2016 à 13:00 -0800, hammerwerfer a écrit :
> The to_stream_time() function (and the others) returned strange
> values (max
> long or something, and always the same values). So i gave up. 
> Now i am using a pad probe for type buffer (Gst.PadProbeType.BUFFER)
> and
> added it to my muxer (matroskamux). The value buffer.pts was a
> realistic
> timestamp for my audio stream So when buffer.pts reaches my final
> timestamp
> i send an eos event to my audioconverter element and the pipelines
> stops
> streaming. The resulting video file has the correct length now.

That's fine, may work for your case. Note that in GStreamer, PTS may
start at any point in time. So to be complete, you actually need two
pad probes, one that saves the GstSegment, and then in your BUFFER
probe, you can convert the PTS to stream time using that segment
information. This should work, if it returns TIME_NONE (max uint), it
would mean this buffer is outside the segment, and should be ignored
(like decode only buffers).

cheers,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160226/938effef/attachment-0001.sig>


More information about the gstreamer-devel mailing list