OpenMediaLib User and Development Guide

Compositing Revisited

As mentioned throughout the previous sections – compositing is one of the major tools in this field.

So far, we've discussed it purely in terms of 'normalisation' – ensuring that any sequence of mixed images conforms to specific dimensions and sample aspect ratio.

There is, of course, much more to it.

As a taster, consider the following stack definition (expressed over multiple lines):

colour: out=1000
<input1> filter:composite rx=0.0 ry=0.0 rw=0.5 rh=0.5
<input2> filter:composite rx=0.5 ry=0.0 rw=0.5 rh=0.5
<input3> filter:composite rx=0.0 ry=0.5 rw=0.5 rh=0.5
<input4> filter:composite rx=0.5 ry=0.5 rw=0.5 rh=0.5

This will form a filter graph as:

composite
  composite
    composite
      composite
        colour:
        <input1>
      <input2>
    <input3>
  <input4>

The result of this is a mosaic playout of all 4 inputs with each input constrained to a quarter of the resultant output and the duration constrained to the first 1000 frames of each input.

In other words, you can control the area of the composite for a particular instance of the composite filter and its associated inputs.

It further illustrates that you can also composite as many inputs as you want on to a single background.

And, as we shall see when we return to this filter later, you can also set up key framing such that the geometry and mixing level can be modified on a per frame basis, thus enabling fly-ins and other transitional effects (such as luma wipes and shaping). Audio considerations will also be introduced.