viral_clip_extractor
Analyze video audio to detect high-energy moments, then extract them as platform-optimized clips using hardware-accelerated encoding.
Instructions
Analyze a video to find the most engaging viral moments and extract them as clips. Uses librosa RMS energy analysis + Non-Maximum Suppression for moment detection, then VideoToolbox hardware-accelerated encoding for frame-accurate clipping.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_path | Yes | Absolute path to the input video file (.mp4, .mov, .webm) | |
| clip_duration | No | Target duration for each clip in seconds (5, 10, 15, 30, or 45) | |
| num_clips | No | Number of top viral moments to extract (default 3) | |
| output_dir | No | Output directory for clips (defaults to video's directory) | |
| platform | No | Target platform for aspect ratio (tiktok, reels, shorts, story, feed, twitter, youtube, original) | original |
| start_time | No | Manual override — if >= 0, extracts a single clip starting at this second (bypasses AI scan) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |