def __init__(
        self,
        video_path,
        video_settings,
        width,
        height,
        background_color=(128, 128, 128),
        coordinates_name="topleft",
        coordinates_value=(0, 0),
    ):
        """Store arguments, set image and rect."""
        ### store arguments

        self.video_path = video_path
        self.video_settings = video_settings

        ### set image and rect

        self.image = render_rect(width, height, background_color)

        self.clean_image = self.image.copy()

        self.video_data = VIDEO_DATA_DB[video_path][video_settings]

        self.frames = deque(self.video_data)

        blit_aligned(
            self.frames[0],
            self.image,
            retrieve_pos_from="center",
            assign_pos_to="center",
        )

        rect = self.rect = self.image.get_rect()
        setattr(rect, coordinates_name, coordinates_value)
Store arguments, set image and rect.
nodezator/videopreview/cache.py