darwin.extractor package

Submodules

darwin.extractor.video module

darwin.extractor.video.extract_artifacts(source_file: str, output_dir: str, storage_key_prefix: str, *, fps: float = 0.0, segment_length: int = 2, repair: bool = False, save_metadata: bool = False, extract_preview_frames: bool = True, primary_frames_quality: int = 1) Dict[source]

Extracts video artifacts including segments, frames, thumbnail for read-only registration in the Darwin platform.

Parameters:
  • source_file – Path to source video file

  • output_dir – Directory to store generated artifacts

  • storage_key_prefix – Prefix for storage keys

  • fps – Desired frames per second (0.0 for native fps), defaults to 0.0

  • segment_length – Length of each segment in seconds, defaults to 2

  • repair – If True, attempt to repair video if errors are detected, defaults to False

  • save_metadata – If True, save metadata to a file, defaults to False

  • extract_preview_frames – If True (default), extract preview frames used for playback scrubbing. If False, skip extraction (system will use video segments for preview, which is less precise).

  • primary_frames_quality – Quality setting for primary display frames. 1 (default) means use PNG format (lossless). 2-31 means use JPEG with that quality (2=best, 31=worst).

Returns:

Dict containing metadata and paths to generated artifacts

Raises:

FileNotFoundError – If source_file does not exist

Module contents

Video extraction functionality for Darwin.