Textoverlay questions
William Salibrici
bsalibrici at latticeinc.com
Wed Jun 28 18:19:10 UTC 2017
Nicolas,
Thank you for your reply.
I am using the following pipeline [in C code] to display streaming text. In a separate thread, I push text buffers once every second to appsrc using gst_app_src_push_buffer. I use gst_buffer_new_allocate to create the text buffers and gst_buffer_fill to set the actual text to be displayed. I correctly set the buffer timestamps and the buffer durations are set to 1 second.
appsrc caps="text/x-raw" ! capsfilter caps="text/x-raw,format=utf8" ! txt.
videotestsrc pattern=white !
textoverlay name=txt ! autovideosink
This pipeline runs just fine and the streaming text updates are 1 second apart just like I want them to be.
However, there is a memory leak somewhere – not good! I have confirmed that when I stop pushing buffers to appsrc, the memory leaks also stop.
According to the appsrc documentation, the gst_app_src_push_buffer function takes ownership of the buffer so I’m not doing unref after I push the buffer. It appears that the textoverlay element is not releasing the text buffers after it displays the text. I ran one test for over an hour and the memory just kept slowly growing. When I stop the pipeline I see the memory being put back.
I tried setting GST_DEBUG="GST_TRACER:7" and GST_TRACERS="leaks(GstBuffer)" and running my test app in a command window but the tracing didn’t seem to work. I got no trace output. My test thread has gst_init at the beginning and gst_deinit at the end. My development machine is windows 7 and I’m using GStreamer 1.10.4 with your windows pre-built binaries.
Any help would be much appreciated.
Bill
From: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] On Behalf Of Nicolas Dufresne
Sent: Friday, June 09, 2017 1:59 PM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: Re: Textoverlay questions
Le vendredi 09 juin 2017 à 15:35 +0000, William Salibrici a écrit :
I am using the following simple pipeline segment to add a text area under my compositor video output. In a separate thread, I set the “text” property once every second to update the rendered text. For my application, the text updates must be real-time.
videotestsrc pattern=white ! textoverlay ! queue ! comp.sink_2
My development machine is windows 7 and I’m using GStreamer 1.10.4 with your windows pre-built binaries.
My overall pipeline runs without errors but the text updates are not always 1 second apart. Sometimes there are pauses between updates greater than 1 second. Other times updates come back to back with no discernable delay. Sometimes updates appear to be skipped altogether [maybe they are just flying by too fast for me to see them]. The latency for displaying text seems to vary quite a bit.
So, here are some questions:
1. What is the latency for displaying text [the time between when the g_object_set function is called to set the text to be displayed and when the text will actually be displayed]?
2. Is there any way to achieve a relatively constant latency for displaying text?
3. Is there any way force the text to be synchronized with the other input video streams to my compositor?
textoverlay has a text pad. You can use this pad to stream text with timestamp on it. The simply way it to connect "filesrc location=file.srt ! subparse ! ..." Subpase supports most common text based sub-title formats, letting you set a timestamp and a duration for each text. You can of course replace filesrc with an appsrc or fdsrc to stream the data.
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170628/b9944338/attachment-0001.html>
More information about the gstreamer-devel
mailing list