SuperAPI AI Directory

video-breakdown

Design & creation

View repository

Updated 10-15 17:31

About this skill

Video Breakdown

Overview

The video shot breakdown skill uses local FFmpeg to automatically break down a video into frame-by-frame shots, providing a keyframe image and time information for each shot. No external backend service is required.

Prerequisites

  • Install FFmpeg locally:brew install ffmpeg

Usage Steps

Method 1: Process the video URL directly

python scripts/process_video.py "https://example.com/video.mp4"

Method 2: Upload a local file and then process it

# 1. 上传本地视频到 TOS
python scripts/video_upload.py "/path/to/video.mp4"

# 2. 用返回的 video_url 处理
python scripts/process_video.py "<video_url>"

Environment Variables

Variable Name Required Description
FFMPEG_BIN No FFmpeg path, defaults to ffmpeg
FFPROBE_BIN No FFprobe path, defaults to ffprobe
VOLCENGINE_ACCESS_KEY Required when uploading Volcengine Access Key
VOLCENGINE_SECRET_KEY Required when uploading Volcengine Secret Key
DATABASE_TOS_BUCKET No TOS bucket name
DATABASE_TOS_REGION No TOS region, defaults to cn-beijing

Output Format

{
  "task_id": "xxx",
  "duration": 30.5,
  "resolution": "1920x1080",
  "segment_count": 12,
  "segments": [
    {
      "index": 1,
      "start": 0.0,
      "end": 3.0,
      "frame_paths": ["path/to/frame.jpg"]
    }
  ]
}

Troubleshooting

Issue Solution
FFmpeg not found Install FFmpeg: brew install ffmpeg
Upload failed Check the AK/SK configuration and TOS bucket
Video download failed Confirm that the URL is valid and publicly accessible