mini_arcade_core.runtime.capture.video

Video recording management.

Classes

VideoRecordConfig

Configuration for video recording.

VideoRecorder

Video recording management.

Module Contents

class mini_arcade_core.runtime.capture.video.VideoRecordConfig

Configuration for video recording.

Variables:
  • (int) (capture_fps) – Desired output frames per second.

  • (int) – Actual capture frames per second to reduce stalls.

  • (str) (prefix) – File extension for saved frames.

  • (str) – Directory to save recorded frames.

  • (str) – Prefix for recording session directories.

fps: int = 60
capture_fps: int = 15
ext: str = 'png'
frames_dir: str = 'recordings'
prefix: str = 'run_'
class mini_arcade_core.runtime.capture.video.VideoRecorder(cfg: VideoRecordConfig | None = None)

Video recording management.

cfg
active: bool = False
run_id: str = ''
base_dir: pathlib.Path | None = None
start(*, out_dir: pathlib.Path | None = None) pathlib.Path

Start video recording.

Parameters:

out_dir (Path | None) – Optional output directory for recorded frames.

Returns:

Path to the directory where video frames are saved.

Return type:

Path

stop() None

Stop video recording.

should_capture(frame_index: int) bool

Check if the current frame index should be captured based on the capture frequency.

Parameters:

frame_index (int) – The current frame index.

Returns:

True if the frame should be captured, False otherwise.

Return type:

bool

next_paths() tuple[pathlib.Path, pathlib.Path, int]

Returns: (tmp_bmp_path, out_png_path, out_frame_index) out_frame_index increases only when we actually capture.

Parameters:

frame_index (int) – The current frame index.

Raise:

RuntimeError: If the recorder is not active.