Interface VideoAnalyzeRequestRich

Rich video analysis request with scene detection, transcription, and RAG indexing support.

Extends the simpler VideoAnalyzeRequest pattern with fine-grained control over scene detection thresholds, description detail, and optional RAG indexing of analysis results.

Example

const request: VideoAnalyzeRequestRich = {
video: 'https://example.com/demo.mp4',
sceneThreshold: 0.3,
transcribeAudio: true,
descriptionDetail: 'detailed',
onProgress: (evt) => console.log(`${evt.phase}: ${evt.progress}%`),
};
interface VideoAnalyzeRequestRich {
    video: string | Buffer<ArrayBufferLike>;
    prompt?: string;
    sceneThreshold?: number;
    transcribeAudio?: boolean;
    descriptionDetail?: DescriptionDetail;
    maxFrames?: number;
    maxScenes?: number;
    indexForRAG?: boolean;
    onProgress?: ((event) => void);
}

Properties

video: string | Buffer<ArrayBufferLike>

Video to analyze — either a URL string or a raw Buffer. When a URL is provided, the pipeline downloads the video to a temporary file before processing.

prompt?: string

Optional analysis prompt or question that should guide the final answer. When omitted, the analyzer produces a general-purpose summary.

sceneThreshold?: number

Threshold for scene change detection (0-1). Lower values detect more scene boundaries (more sensitive); higher values only detect dramatic cuts.

Default

0.3
transcribeAudio?: boolean

Whether to transcribe the audio track using Whisper. When enabled, each scene's transcript is populated and a full transcript is included in the analysis.

Default

true
descriptionDetail?: DescriptionDetail

How detailed scene descriptions should be.

Default

'detailed'
maxFrames?: number

Maximum number of frames to sample from the extracted frame set. When the extracted frame count exceeds this value, frames are evenly downsampled before scene detection and description.

maxScenes?: number

Maximum number of scenes to detect. Prevents runaway analysis on very long videos with many cuts.

Default

100
indexForRAG?: boolean

Whether to index scene descriptions and transcripts into the RAG vector store for later retrieval.

Default

false
onProgress?: ((event) => void)

Optional callback invoked as analysis progresses through phases. Called with a VideoAnalysisProgressEvent at each phase transition and when per-scene progress updates are available.

Type declaration