Can textoverlay be used to apply dynamically generated text to a frame?
Background: I noticed that textoverlay allows manual setting of the "text" property. Alternatively, the 'subparse' element can be used feed the 'text_sink' pad. Presumably 'subparse' merely decodes "appplication/x-subtitle" and other MIME formats My problem is to run an event handler that cross references the TIMESTAMP to CCTV-specific text. Design alternatives: The static text could be set by an event handler able to do the lookup. The event would have to be triggered whenever overlay received a new time stamp. Unfortunately, such an event is not exposed. Alternatively, I could use a 'subparse'. To do that I guess I would have to create an appsrc that generated "application/x-subtitle" output. However, I can't seem to find a specification for the encoding of text that I need to feed to the subparse. Maybe reading the subparse source code will tell me enough, but an RFC or other spec should would be handy. Finally, I could try to feed the 'text_sink' pad of the textoverlay. However, I'd need to understand the format of the input the pad expects. Presumably I have to cross reference text with a TIMESTAMP. Since its a really useful feature to custom apps, I'm wondering if anyone has any suggestions. As before, I'll try to find a way to post the ultimate solution under with some useful keywords. |
Hello
I am doing this in the Advene application (http://www.advene.org/). To achieve the behaviour you describe, the application constantly (every 100ms, through gobject.timeout_add) monitors the player time, and displays data accordingly by setting the text property of the textoverlay element. This kind of active polling is not cpu-efficient, but works quite alright in my context. Regards, Olivier Aubert On Tue, 2010-11-09 at 06:45 -0800, HaroldJRoth wrote: > Can textoverlay be used to apply dynamically generated text to a frame? > > Background: > > I noticed that textoverlay allows manual setting of the "text" property. > Alternatively, the 'subparse' element can be used feed the 'text_sink' pad. > Presumably 'subparse' merely decodes "appplication/x-subtitle" and other > MIME formats > > My problem is to run an event handler that cross references the TIMESTAMP to > CCTV-specific text. > > Design alternatives: > > The static text could be set by an event handler able to do the lookup. The > event would have to be triggered whenever overlay received a new time stamp. > Unfortunately, such an event is not exposed. > > Alternatively, I could use a 'subparse'. To do that I guess I would have to > create an appsrc that generated "application/x-subtitle" output. However, I > can't seem to find a specification for the encoding of text that I need to > feed to the subparse. Maybe reading the subparse source code will tell me > enough, but an RFC or other spec should would be handy. > > Finally, I could try to feed the 'text_sink' pad of the textoverlay. > However, I'd need to understand the format of the input the pad expects. > Presumably I have to cross reference text with a TIMESTAMP. > > Since its a really useful feature to custom apps, I'm wondering if anyone > has any suggestions. As before, I'll try to find a way to post the ultimate > solution under with some useful keywords. ------------------------------------------------------------------------------ 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 [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by HaroldJRoth
2010/11/9 HaroldJRoth <[hidden email]>:
> > Can textoverlay be used to apply dynamically generated text to a frame? > > Background: > > I noticed that textoverlay allows manual setting of the "text" property. > Alternatively, the 'subparse' element can be used feed the 'text_sink' pad. > Presumably 'subparse' merely decodes "appplication/x-subtitle" and other > MIME formats > > My problem is to run an event handler that cross references the TIMESTAMP to > CCTV-specific text. > > Design alternatives: > > The static text could be set by an event handler able to do the lookup. The > event would have to be triggered whenever overlay received a new time stamp. > Unfortunately, such an event is not exposed. > > Alternatively, I could use a 'subparse'. To do that I guess I would have to > create an appsrc that generated "application/x-subtitle" output. However, I > can't seem to find a specification for the encoding of text that I need to > feed to the subparse. Maybe reading the subparse source code will tell me > enough, but an RFC or other spec should would be handy. You could also use the 'textrender' element, which support plain text and pango markup. andoni > > Finally, I could try to feed the 'text_sink' pad of the textoverlay. > However, I'd need to understand the format of the input the pad expects. > Presumably I have to cross reference text with a TIMESTAMP. > > Since its a really useful feature to custom apps, I'm wondering if anyone > has any suggestions. As before, I'll try to find a way to post the ultimate > solution under with some useful keywords. > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/textoverlay-and-dynamic-text-to-subtitle-or-not-and-if-so-how-tp3034383p3034383.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 > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > -- Andoni Morales Alastruey LongoMatch:The Digital Coach http://www.longomatch.ylatuya.es ------------------------------------------------------------------------------ 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 [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
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. |
2010/11/9 HaroldJRoth <[hidden email]>:
> > > Andoni Morales wrote: >> >> 2010/11/9 HaroldJRoth <[hidden email]>: >>> >>> 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. 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 > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/textoverlay-and-dynamic-text-to-subtitle-or-not-and-if-so-how-tp3034383p3034749.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 > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > -- Andoni Morales Alastruey LongoMatch:The Digital Coach http://www.longomatch.ylatuya.es ------------------------------------------------------------------------------ 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 [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
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? |
2010/11/10 HaroldJRoth <[hidden email]>:
> > > Andoni Morales wrote: >> >> 2010/11/9 HaroldJRoth <[hidden email]>: >>> >>> >>> Andoni Morales wrote: >>>> >>>> 2010/11/9 HaroldJRoth <[hidden email]>: >>>>> >>>>> 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? 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 > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > -- Andoni Morales Alastruey LongoMatch:The Digital Coach http://www.longomatch.ylatuya.es ------------------------------------------------------------------------------ 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 [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by HaroldJRoth
On Tue, 2010-11-09 at 06:45 -0800, HaroldJRoth wrote:
> Can textoverlay be used to apply dynamically generated text to a frame? > > Background: > > I noticed that textoverlay allows manual setting of the "text" property. > (...) > My problem is to run an event handler that cross references the TIMESTAMP to > CCTV-specific text. I think the best solution might be to patch textoverlay and make the "text" property controllable (see GstController). Cheers -Tim ------------------------------------------------------------------------------ Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |