Textoverlay questions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Textoverlay questions

William Salibrici

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?

 

Perhaps I am missing something. Can anyone answer these questions?

Thanks so much for your help,

Bill Salibrici

Lattice Incorporated

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Textoverlay questions

Nicolas Dufresne-5
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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Textoverlay questions

William Salibrici

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:[hidden email]] On Behalf Of Nicolas Dufresne
Sent: Friday, June 09, 2017 1:59 PM
To: Discussion of the development of and with GStreamer <[hidden email]>
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


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Textoverlay questions

Nicolas Dufresne-5
Le mercredi 28 juin 2017 à 18:19 +0000, William Salibrici a écrit :
>
> 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.

You would need to be able to dump the allocated object at run-time, but
that's only supported on POSIX system, with unix signals. I think
you'll have to resort at looking into GstMiniObject traces, they
containes ref/unref traces, and find out.

>
> Any help would be much appreciated.
>
> Bill
>
>  
> From: gstreamer-devel [mailto:[hidden email]
> op.org] On Behalf Of Nicolas Dufresne
> Sent: Friday, June 09, 2017 1:59 PM
> To: Discussion of the development of and with GStreamer <gstreamer-de
> [hidden email]>
> 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:
>
> 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]?
> Is there any way to achieve a relatively constant latency for
> displaying text?
> 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
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment