bencher.results.composable_container.composable_container_video =============================================================== .. py:module:: bencher.results.composable_container.composable_container_video Classes ------- .. autoapisummary:: bencher.results.composable_container.composable_container_video.RenderCfg bencher.results.composable_container.composable_container_video.ComposableContainerVideo Module Contents --------------- .. py:class:: RenderCfg Configuration class for video rendering options. This class controls how videos and images are composed and rendered together. It provides options for timing, layout, appearance, and labeling of the output. .. attribute:: compose_method Method to compose multiple clips (sequence, right, down, overlay). Defaults to ComposeType.sequence. :type: ComposeType .. attribute:: var_name Variable name for labeling. Defaults to None. :type: str, optional .. attribute:: var_value Variable value for labeling. Defaults to None. :type: str, optional .. attribute:: background_col RGB color for background. Defaults to white (255, 255, 255). :type: tuple[int, int, int] .. attribute:: duration Target duration for the composed video in seconds. Defaults to 10.0. :type: float .. attribute:: default_duration Fallback duration when duration is None. Defaults to 10.0. :type: float .. attribute:: duration_target If True, tries to match target duration while respecting frame duration constraints. If False, uses exact duration. Defaults to True. :type: bool .. attribute:: min_frame_duration Minimum duration for each frame in seconds. Defaults to 1/30. :type: float .. attribute:: max_frame_duration Maximum duration for each frame in seconds. Defaults to 2.0. :type: float .. attribute:: margin Margin size in pixels to add around clips. Defaults to 0. :type: int .. py:attribute:: compose_method :type: bencher.results.composable_container.composable_container_base.ComposeType .. py:attribute:: var_name :type: str | None :value: None .. py:attribute:: var_value :type: str | None :value: None .. py:attribute:: background_col :type: tuple[int, int, int] :value: (255, 255, 255) .. py:attribute:: duration :type: float :value: 10.0 .. py:attribute:: default_duration :type: float :value: 10.0 .. py:attribute:: duration_target :type: bool :value: True .. py:attribute:: min_frame_duration :type: float :value: 0.03333333333333333 .. py:attribute:: max_frame_duration :type: float :value: 2.0 .. py:attribute:: margin :type: int :value: 0 .. py:class:: ComposableContainerVideo Bases: :py:obj:`bencher.results.composable_container.composable_container_base.ComposableContainerBase` A base class for renderer backends. A composable renderer .. py:method:: append(obj: moviepy.VideoClip | moviepy.ImageClip | str | numpy.ndarray) -> None Appends an image or video to the container :param obj: Any representation of an image or video :type obj: VideoClip | ImageClip | str | np.ndarray :raises RuntimeWarning: if file format is not recognised .. py:method:: calculate_duration(frames, render_cfg: RenderCfg) .. py:method:: render(render_cfg: RenderCfg | None = None, **kwargs) -> moviepy.CompositeVideoClip Composes the images/videos into a single image/video based on the type of compose method :param compose_method: optionally override the default compose type. Defaults to None. :type compose_method: ComposeType, optional :returns: A composite video clip containing the images/videos added via append() :rtype: CompositeVideoClip .. py:method:: to_video(render_args: RenderCfg | None = None) -> str Returns the composite video clip as a webm file path :returns: webm filepath :rtype: str .. py:method:: deep() .. py:method:: extend_clip(clip: moviepy.VideoClip, desired_duration: float)