<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:558591485;
mso-list-type:hybrid;
mso-list-template-ids:-1037111050 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:1446804127;
mso-list-template-ids:112339462;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Nicolas, <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Thank you for your reply.<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">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.<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
appsrc caps="text/x-raw" ! capsfilter caps="text/x-raw,format=utf8" ! txt. <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
videotestsrc pattern=white ! <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
textoverlay name=txt ! autovideosink <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">This pipeline runs just fine and the streaming text updates are 1 second apart just like I want them to be.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">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.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">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.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">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.
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
Any help would be much appreciated. <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Bill <o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> gstreamer-devel [mailto:gstreamer-devel-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>Nicolas Dufresne<br>
<b>Sent:</b> Friday, June 09, 2017 1:59 PM<br>
<b>To:</b> Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br>
<b>Subject:</b> Re: Textoverlay questions<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif">Le vendredi 09 juin 2017 à 15:35 +0000, William Salibrici a écrit :<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:105%">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. <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:105%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:105%">
videotestsrc pattern=white ! textoverlay ! queue ! comp.sink_2 <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:105%">
<o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:105%">My development machine is windows 7 and I’m using GStreamer 1.10.4 with your windows pre-built binaries.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:105%">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.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:105%">So, here are some questions:<o:p></o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:105%;mso-list:l0 level1 lfo3">
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]?
<o:p></o:p></li><li class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:105%;mso-list:l0 level1 lfo3">
Is there any way to achieve a relatively constant latency for displaying text? <o:p>
</o:p></li><li class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:105%;mso-list:l0 level1 lfo3">
Is there any way force the text to be synchronized with the other input video streams to my compositor?
<o:p></o:p></li></ol>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif">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.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif">Nicolas<o:p></o:p></span></p>
</div>
</div>
</body>
</html>