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.
Download the file
VideoTextOverlay.py
from the Packt website.The
constructVideoPipeline
method of the classVideoPlayer
is illustrated in the following code snippet:1 def constructVideoPipeline(self): 2 # Autoconvert element for video processing 3 self.autoconvert = gst.element_factory_make( 4 "autoconvert") 5 self.videosink = gst.element_factory_make( 6 "autovideosink...