Let's see how to add a text string on a video track. We will write a simple utility, which essentially has the same code structure as the one we developed in the Playing a video section. This tool will also add the buffer timestamp and the current CPU clock time on the top of the video. For this section, it is important that you have
textoverlay, timeoverlay, and
clockoverlay plugins available in your GStreamer installation. Otherwise, you need to install these plugins or use some other plugins, such as
cairotextoverlay, if available.
VideoTextOverlay.pyfrom the Packt website.
constructVideoPipelinemethod of the class
VideoPlayeris illustrated in the following code snippet: ...