It is easiest to export a video with overlaid data straight from the app, but a video of the overlay can be also exported without a background video. This gives the user a greater freedom of creating video compositions using an external video editor. However, in order to properly apply the overlay on a video, a separate alpha matte video is needed for providing the transparency information of the overlay. This tutorial will explain how to export overlay and alpha matte videos, and how to use them.
Alpha matte
Most video codecs, like H.264, do not support an alpha channel that carries the transparency information of pixels. A common workaround is to use a separate grayscale video, called alpha matte, to represent the alpha channel. Black corresponds to fully transparent, whereas white corresponds to fully opaque.
Exporting an overlay and alpha matte
An overlay and alpha matte videos are exported in very much the same way as exporting an overlaid video, except that the Standalone overlay + alpha (.mp4) is used as the Application instead of Overlay video (.mp4) , and no input videos are involved in this case. The frame size and rate of the exported videos can be configured explicitly. So, the main steps of exporting an overlay and alpha matte are:
- Open your session, and click Export.
- Select Standalone overlay + alpha (.mp4) .
- Configure the Scope, and optionally other settings like the target video format.
- Click Add to queue.
- Notice that two new items appears on the Export queue. The one with a name that ends with _alpha.mp4 will export the alpha matte, while the other exports the overlay video.
- Click Start to export the pair of videos.
- Click Share to send the files for video compositing with a 3rd party video editor application.
Applying an overlay and alpha matte
In a generic video editor, an overlay + alpha matte can be applied as follows:
- Import the overlay and alpha matte videos, as well as the background video(s), to the video editor of your choice.
- Set up the background audio/video track.
- Put the overlay video on a track above the background track. At this point the background gets completely blocked by the overlay that has no transparency, yet.
- Apply the alpha matte video as an alpha channel of the overlay video. You should now see the transparency kicking in and the background showing through in the preview screen.
There are several methods to achieve what is done in step 4, depending on the application. As an example in DaVinci Resolve 18.6 it can be done with the following steps:
- Switch to the Color tab.
- Select the overlay video clip. It will appear in the Node Editor at the top right corner.
- At the Media Pool (top left), select the alpha matte video clip and drag it into the Node Editor.
- Right-click at the background area of the Node editor and select Add Alpha Output. A blue dot appears on the right side of the editor.
- Drag a dashed line from one of the blue squares of the alpha matte box to the blue dot at the right. This is how it should look like in the Node Editor . The upper box is the overlay clip, the lower is the alpha matte clip:
:
The alpha matte clip is now applied as the alpha channel of the overlay clip and we are done! You can check the preview video to make sure that the background video is showing through properly under the overlay.
Happy video editing!