heres the fix: Root cause: overlay_np = overlay_image[0].cpu().numpy() was placed outside the loop, so only the first frame of the overlay was ever used — effectively freezing it for the entire sequence.
Key fixes:
Both clips are indexed per-frame inside the loop — base_image[base_idx] and overlay_image[overlay_idx] are now both fetched on every iteration.
New frame_mismatch input handles the case where the two videos have different lengths:
loop_overlay (default) — loops the overlay if it's shorter than the base
loop_base — loops the base if it's shorter
trim_to_shortest — output stops at the shorter clip's last frame
trim_to_longest — loops whichever clip is shorter to match the longer one
overlay_rgba is now computed inside the loop from the per-frame overlay_np, so every overlay frame gets properly converted and padded before blending.
heres the fix: Root cause: overlay_np = overlay_image[0].cpu().numpy() was placed outside the loop, so only the first frame of the overlay was ever used — effectively freezing it for the entire sequence.
Key fixes: