buffer probe data out of sync for subtitle text pad

Sebastian Dröge sebastian at centricular.com
Tue Nov 12 04:44:36 PST 2013


On Di, 2013-11-12 at 07:36 -0500, Dece Bel wrote:
> I am trying to read subtitle from a video and want to record the timestamp
> of the subtitled text in the gstreamer pipeline.
> One approach that I have been trying is with the getting the action signal
> on playbin for "get-text-pad"
> and attaching a probe on the pad. Eventually when the callback
> (cb_have_data) is called, I do see the text in the buffer dumped on console.
> 
> However, I notice that the subtitle on the final rendered video and the one
> dumped from the probe callback are out of sync.
> Can someone pls suggest how to get the timestamp of the subtitled text from
> the stream or received a sync'ed stream or any other approach.

You could also set a text-sink on playbin btw. But the problem stays the
same wrt synchronization. You need to convert the buffer timestamps to
running-time, and then check them against the current running time of
the sink (clock_time - base_time). Usually you will get buffers much
earlier and then need to wait a bit until they are to be displayed.

-- 
Sebastian Dröge <sebastian at centricular.com>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131112/f7043ba5/attachment.pgp>


More information about the gstreamer-devel mailing list