Texture2D can save images with a transparent background. In Texture2D, a separate alpha channel is typically used to describe the transparency of background pixels. In Metal’s fragment shader, colors and alpha values of each pixel can be obtained by sampling the texture, and they can be used for subsequent processing.
In Metal Shader, you can replace the color you want to make transparent by comparing it with a literal color using the texture2d and its sampling coordinates passed to the fragment shader.
AVCaptureMovieFileOutput and AVAssetWriter are both APIs for recording video on iOS / Mac devices, are both int AVFoundation, but they have some differences.