Files
b84330808andHarry 66db0e5b69 perf(video): composite on an opaque canvas so frames carry no mask
CompositeVideoClip treats a composite as transparent unless it is given
bg_color or use_bgclip. Every frame then starts from a transparent RGBA
canvas, the full-size first clip is alpha-composited onto it, and a
second, full-size float mask composite is computed. The writer stacks
that mask onto the frame and pipes RGBA to FFmpeg, where the H.264 output
drops the alpha channel again.

Four composites have an opaque clip covering the whole canvas, so the
mask is always fully opaque and only costs time:

- generate_video(): the combined footage under the subtitle clips, on
  every video with subtitles enabled
- _fit_clip_to_canvas() in contain mode: the black letterbox canvas
- slidein_transition() and slideout_transition(): the black canvas

Give them bg_color=(0, 0, 0), as render_image_zoom_video() already does.
The rendered frames are unchanged; the final MP4 files were
byte-identical before and after on the benchmark inputs.
2026-11-08 07:52:05 +08:00
..