GStreamer comes with a number of plugins that allow rendering of text and/or graphics overlays on top of video: rsvgoverlay, subtitleoverlay, textoverlay, cairooverlay, gdkpixbufoverlay, opencvtextoverlay, etc. However, some of these plugins often allow only static graphics and text, and often do not approach the flexibility and power of dedicated video post-processing software products.
Qt was chosen for its ease of integration of modern WebKit (QtWebKit) and GStreamer (qt-gstreamer), and its ability to render widgets to RGBA images. The QMainWindow widget is rendered in regular intervals to QImages in RGBA format, then inserted into a GStreamer pipeline via
appsrc plugin. This pipeline simply uses
udpsink to multicast the raw video RTP packets on localhost to allow for multiple 'subscribers'. A second GStreamer pipleline can then use
udpsrc and apply the overlay.
noweffects.pro in QtCreator, or build and run from a terminal:
qmake make ./noweffects
The video size is
HEIGHT to 1280 x 720.
To view the generated video stream, a
gst-launch-1.0 ... pipeline is printed to STDOUT when running the application.
The generated video requires 1280 x 720 x 4colors x 30fps = 110 megabytes/second of UDP bandwidth on localhost. You will likely need to increase the Linux kernel's UDP buffer size, otherwise you may experience UDP packet loss (visible as flickering):
sysctl -w net.core.wmem_max=2000000000 sysctl -w net.core.rmem_max=2000000000