Add text to video in GL

An earlier example demonstrated a method to Write subtitles onto a video in Jitter, using the jit.lcd object and adding its output to that of a jit.movie object. Another method is to render both video and text in GL using the jit.gl.videoplane and jit.gl.text objects. This latter way is more computationally efficient because the rendering takes place on the graphics card of the computer instead of within a Jitter matrix on the computer’s CPU.

Render text on top of video

In this example, notice that the jit.gl.videoplane object has been scaled in the x and y dimensions so that it will have a 4:3 (x:y) aspect ratio corresponding to the dimensions of the video and the window that’s displaying it. Note also that the jit.gl.text object has its ‘layer’ attribute set to 1, which causes it to be drawn after (i.e., in front of) the jit.gl.videoplane, which is in layer 0 by default. (Lower layer numbers are drawn first.)