mini_arcade_core.runtime.capture.video ====================================== .. py:module:: mini_arcade_core.runtime.capture.video .. autoapi-nested-parse:: Video recording management. Classes ------- .. autoapisummary:: mini_arcade_core.runtime.capture.video.VideoRecordConfig mini_arcade_core.runtime.capture.video.VideoRecorder Module Contents --------------- .. py:class:: VideoRecordConfig Configuration for video recording. :ivar fps (int): Desired output frames per second. :ivar capture_fps (int): Actual capture frames per second to reduce stalls. :ivar ext (str): File extension for saved frames. :ivar frames_dir (str): Directory to save recorded frames. :ivar prefix (str): Prefix for recording session directories. .. py:attribute:: fps :type: int :value: 60 .. py:attribute:: capture_fps :type: int :value: 15 .. py:attribute:: ext :type: str :value: 'png' .. py:attribute:: frames_dir :type: str :value: 'recordings' .. py:attribute:: prefix :type: str :value: 'run_' .. py:class:: VideoRecorder(cfg: VideoRecordConfig | None = None) Video recording management. .. py:attribute:: cfg .. py:attribute:: active :type: bool :value: False .. py:attribute:: run_id :type: str :value: '' .. py:attribute:: base_dir :type: pathlib.Path | None :value: None .. py:method:: start(*, out_dir: pathlib.Path | None = None) -> pathlib.Path Start video recording. :param out_dir: Optional output directory for recorded frames. :type out_dir: Path | None :return: Path to the directory where video frames are saved. :rtype: Path .. py:method:: stop() -> None Stop video recording. .. py:method:: should_capture(frame_index: int) -> bool Check if the current frame index should be captured based on the capture frequency. :param frame_index: The current frame index. :type frame_index: int :return: True if the frame should be captured, False otherwise. :rtype: bool .. py:method:: 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. :param frame_index: The current frame index. :type frame_index: int :raise: RuntimeError: If the recorder is not active.