How I created dynamic lower thirds with chroma key using Phaser

Who said Phaser can only be used to make games? I am going to tell you tell story of a video project, and how Phaser helped me to work with streaming video.

As a company, we are making a continue event streaming on YouTube featuring webcams placed around Venice, panoramic videos of the city taken with a drone, time lapse videos with cameras placed for a day or two in beautiful spots, and some more stuff related to tourism and the promotion of Venice.

We are using XSplit to broadcast and automatically switch among the various videos with a plugin we developed.

But we also needed something to create quality lower thirds with contents dynamically loaded from a database of events and sponsors.

From Wikipedia: In the television industry, a lower third is a graphic overlay placed in the title-safe lower area of the screen, though not necessarily the entire lower third of it, as the name suggests. In its simplest form, a lower third can just be text overlying the video. Frequently this text is white with a drop shadow to make the words easier to read. A lower third can also contain graphical elements such as boxes, images or shading. Some lower thirds have animated backgrounds and text.

Our lower third will be placed on the video output using the Chroma Key technique.

From Wikipedia again: Chroma key compositing, or chroma keying, is a visual effects / post-production technique for compositing (layering) two images or video streams together based on color hues (chroma range). The technique has been used heavily in many fields to remove a background from the subject of a photo or video – particularly the newscasting, motion picture and videogame industries.

There are some software products which create lower thirds on the fly, but they are expensive and it’s not easy to connect them with a MySQL database, so here’s the plan: a green Phaser “game” with the lower third animated with tweens and bitmap fonts.

While I can’t show you the entire project at the moment – it isn’t even ready – I am showing you the lower thirds we are working on:

The green background will then be used as chroma key to releveal underneath video, and everything will work fine. I will show you the complete project once it’s done.

Here is the source code:

It’s easy to see how you can dynamically load texts with PHP/MySQL and that’s it! We have our lower third generator at no cost. Download the source code.

  • Nyasha

    Interesting! I’m working on a digital signage project and I’m floating the option of implementing this using a game engine. Your use of Phaser for this is a helpful example of workflows.

  • Bruno Campestrini

    looks like those level intro Title cards from Sonic games