Structured video analysis pipeline that wires together scene detection, vision description, audio transcription, and LLM summarization.

Implements the base IVideoAnalyzer interface for simple analysis requests, and exposes an analyze() method for rich analysis with progress reporting, configurable detail levels, and optional RAG indexing.

All ffmpeg/ffprobe invocations use execFile (not exec) for safety — arguments are passed as arrays, preventing shell injection.

Implements

Constructors

Methods

Constructors

  • Create a new VideoAnalyzer with optional injected dependencies.

    Missing dependencies are auto-created with sensible defaults:

    • VisionPipeline: created lazily via createVisionPipeline() on first use
    • SceneDetector: created immediately with default thresholds
    • SpeechToTextProvider: left undefined — transcription skipped when missing

    Parameters

    Returns VideoAnalyzer

Methods

  • Run the full video analysis pipeline with scene detection, vision descriptions, optional audio transcription, and LLM summarization.

    The pipeline executes these stages sequentially:

    1. Extract frames — decode video at 1fps via ffmpeg
    2. Detect scenes — run SceneDetector over extracted frames
    3. Describe scenes — send key frames to VisionPipeline
    4. Transcribe audio — (optional) extract audio and run STT
    5. Summarize — generate overall summary via LLM

    Progress events are emitted at each phase transition when onProgress is provided.

    Parameters

    Returns Promise<VideoAnalysisRich>

    Rich analysis result with scenes, summary, and optional RAG chunks.

    Throws

    If ffprobe/ffmpeg are not installed on the system.

    Throws

    If the video buffer is empty or invalid.