Tutorial 8 - Movie Mixing
By this point the tutorials have presented enough of the basics to start building some simple yet powerful tools. This tutorial will demonstrate two different methods of constructing a patch to mix two video streams together using both CPU based 'pix' objects and OpenGL blending to take advantage of the video card.

The 'pix_blending' patch has two new concepts to take note of: pix_ based processing and combining two video streams into one. All of the pix_ objects work by using the main CPU to manipulate the data of each pixel, which can take a large amount of the processor's resources depending on the size of the video, it's frame rate, and the operations performed. The advantage of this type of processing comes from the amount of flexibility offered by a general purpose CPU. The pix_mix object works by multiplying each stream by a weighted amount (like 75% stream 1 and 25% stream 2) and adding the results into a single new stream. This gives the effect of the two images blending together. The slider above the xfade object controls the amount of blending; open the xfade patcher to see how the weighting is done.
'GL_blending' effectively takes the playback half of 'pix_blending' and the alpha blending part of tutorial 4 to make an OpenGL mixer. The two main differences are the CPU does not do the blending and the two render chains stay separated. The first point means that by offloading the blending to the video card, the CPU has more free cycles to do other type of processing, which can make a large difference in performance. The second point has more to do with the desired effect of the final blend. The two Geos can still move independently of one another by a rotate or translate object in their render chains. So to achieve the same exact effect shown in the 'pix_blending' example, the two Geos need to have the same position, size, and rotation. In certain instances this might not work, but for this simple example it does just nicely. Also, this type of blending can have a much wider variety of effects, for example: offsetting the two Geos slightly and playing the same film in both chains will give a blurring effect. Too many scenarios exist to use either or both of these techniques to go into much depth, but be aware of the flexibility and strengths of each method.