analyze_video
Detect visual anomalies in video files by computing surprise scores between frames. Returns anomaly windows and top timestamps for UI changes or video defects.
Instructions
Extract frames from a video file, run them through the ViT encoder, and compute frame-to-frame surprise scores. Returns timestamp array, surprise scores, z-score normalized scores, anomaly windows (>2σ spikes), and top N anomaly timestamps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | Number of top anomaly timestamps to return (default 5). | |
| video_path | Yes | Path to an mp4 or webm video file. | |
| sigma_threshold | No | Z-score threshold to flag as anomaly window (default 2.0). | |
| frame_sample_rate | No | Sample one frame every N seconds (default 1). Increase for long videos. |