This tutorial defines the methods of creation – and the rationale behind – mattes and masters, in order to streamline performance for clips that contain transparency and high bitrates.
Evaluate and generate mattes and masters for use in Swift.
Chapter 1: Matte and master rationale
Chapter 2: Creating a matte and master from prepared assets
Chapter 3: Creating a matte with FFMPEG
20 minutes
All new users
These movies may contain an alpha channel.
To check the data rate of your movie:
We recommend that the bitrate should be lower than 100 mbits/sec
These movies do not support an alpha channel
To check the bitrate of your movie:
We recommend that the bitrate should be lower than 50 mbits/sec
If your movie's data rate is too high, the following become requirements:
The approach will be to use both of these two clips in Swift (or Edit 3d) on the same shader:
If you are using Adobe Media Encoder, we recommend:
H264 with: Same as source
Set a Target bitrate of less that 50
In our supplied example LowBitrate.mp4, the default Target bitrate of 10 was set in Media Encoder.
In our example image sequence supplied (below), the matte must be created so that the black areas will be the areas that we use to “punch” through to reveal the “master”.
ffmpeg can create a Quicktime grayscale movie of only 256 colours.
Open a command prompt
Copy this ffmpeg command - inserting into it - the correct name of your image:
ffmpeg -f image2 -i "MatteExample_%05d.png" -vcodec qtrle -pix_fmt gray MatteExample.mov
Image sequence number
Image sequences are always numbered before the file extension. We need to tell ffmpeg how many digits the sequence name carries.
For a sequence filename that begins: MatteExample_00001.png, the command is:
“MatteExample_%05d.png”
Where ffmpeg is instructed to look for 5 decimal places in each of the image sequence files.
Output file name
The output file name in the command is the final component. In the example above, the output name is:
If you want to review Justin Avery's instructor project at this point in the course, you can download the project zip here.