bencher.results.composable_container.composable_container_video
Classes
Configuration class for video rendering options. |
|
A base class for renderer backends. A composable renderer |
Module Contents
- class bencher.results.composable_container.composable_container_video.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.
- compose_method
Method to compose multiple clips (sequence, right, down, overlay). Defaults to ComposeType.sequence.
- Type:
- var_name
Variable name for labeling. Defaults to None.
- Type:
str, optional
- var_value
Variable value for labeling. Defaults to None.
- Type:
str, optional
- background_col
RGB color for background. Defaults to white (255, 255, 255).
- Type:
tuple[int, int, int]
- duration
Target duration for the composed video in seconds. Defaults to 10.0.
- Type:
float
- default_duration
Fallback duration when duration is None. Defaults to 10.0.
- Type:
float
- duration_target
If True, tries to match target duration while respecting frame duration constraints. If False, uses exact duration. Defaults to True.
- Type:
bool
- min_frame_duration
Minimum duration for each frame in seconds. Defaults to 1/30.
- Type:
float
- max_frame_duration
Maximum duration for each frame in seconds. Defaults to 2.0.
- Type:
float
- margin
Margin size in pixels to add around clips. Defaults to 0.
- Type:
int
- var_name: str | None = None
- var_value: str | None = None
- background_col: tuple[int, int, int] = (255, 255, 255)
- duration: float = 10.0
- default_duration: float = 10.0
- duration_target: bool = True
- min_frame_duration: float = 0.03333333333333333
- max_frame_duration: float = 2.0
- margin: int = 0
- class bencher.results.composable_container.composable_container_video.ComposableContainerVideo
Bases:
bencher.results.composable_container.composable_container_base.ComposableContainerBaseA base class for renderer backends. A composable renderer
- append(obj: moviepy.VideoClip | moviepy.ImageClip | str | numpy.ndarray) None
Appends an image or video to the container
- Parameters:
obj (VideoClip | ImageClip | str | np.ndarray) – Any representation of an image or video
- Raises:
RuntimeWarning – if file format is not recognised
- 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
- Parameters:
compose_method (ComposeType, optional) – optionally override the default compose type. Defaults to None.
- Returns:
A composite video clip containing the images/videos added via append()
- Return type:
CompositeVideoClip
- to_video(render_args: RenderCfg | None = None) str
Returns the composite video clip as a webm file path
- Returns:
webm filepath
- Return type:
str
- deep()
- extend_clip(clip: moviepy.VideoClip, desired_duration: float)