Skip to content

Instantly share code, notes, and snippets.

@uwezi
uwezi / 20240309_opencv.py
Last active December 1, 2025 15:57
[video inclusion in Manim] Include video objects picture-in-picture. #manim #animate #video #opencv #videomobject
import cv2 # needs opencv-python https://pypi.org/project/opencv-python/
from PIL import Image, ImageOps
from dataclasses import dataclass
@dataclass
class VideoStatus:
time: float = 0
videoObject: cv2.VideoCapture = None
def __deepcopy__(self, memo):
return self