[gst-devel] textoverlay and dynamic text - to subtitle or not and if so how?

Andoni Morales ylatuya at gmail.com
Wed Nov 10 13:02:02 CET 2010


2010/11/10 HaroldJRoth <dlafferty at gmail.com>:
>
>
> Andoni Morales wrote:
>>
>> 2010/11/9 HaroldJRoth <dlafferty at gmail.com>:
>>>
>>>
>>> Andoni Morales wrote:
>>>>
>>>> 2010/11/9 HaroldJRoth <dlafferty at gmail.com>:
>>>>>
>>>>> Can textoverlay be used to apply dynamically generated text to a frame?
>>>>>
>>>>
>>>> ...
>>>>
>>>> You could also use the 'textrender' element, which support plain text
>>>> and pango markup.
>>>>
>>>> andoni
>>>>
>>>>
>>>
>>> Two issues:  'textrender' doesn't mux text to another video stream.
>>>  Second,
>>> 'textrender' doesn't allow me to sync my text to frame TIMESTAMP data.  I
>>> think textrender on its own is more appropriate for generating text only
>>> frames from a textparse element.
>> Textrender, which outputs an image with an alpha channel, is usually
>> used in combination with videomixer, which mixes your video stream
>> with the text image and sync them, so it's exactly what you are
>> looking for. IIRC playbin2 uses it to render the subtitles.
>>
>> Andoni
>>
>
> Unfortunately, it's not merging text with that's the issue.  The difficulty
> is specifying the input to the textrender.  It looks like I need to generate
> application/x-subtitles data for the frames that I wish to write text to.
> My goal is to cross reference timestamp data with other metadata and write
> this to the frame.  I can't update the text directly from my appsrc plugin,
> because it will fall out of sink with the frame due to delays in the
> decodebin2 plugin between any text overlay and the appsrc.
>
> Do you have any suggestions on there to look for details on generating the
> application/x-subtitles data used by a subparse?
That's why I was suggesting to use textrender, because it's easier to
create a buffer with a plain text or a pango markup string. The
pipeline looks something like this:
               videosrc !
                               videomixer ! sink
appsrc ! textrender !

You create a new GstBuffer with the subtitles string, and you set on
this buffer the timestamp on which you would like to render it.

But in case you need to do any processing, you can also go for the
textoverlay option adding a pad probe in its sink pad. So each time a
new buffers is pushed to the textoverlay element, you will first do
some processing in the pad probe callback, update the 'text' property,
and continue with the normal flow.

Andoni
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/textoverlay-and-dynamic-text-to-subtitle-or-not-and-if-so-how-tp3034383p3035899.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



-- 
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es




More information about the gstreamer-devel mailing list