SuperAPI AI Directory

compose-video

Design & creation

View repository

Updated 10-15 17:17

About this skill

Compose video

Use ffmpeg for video post-processing and multi-clip composition.

Positioning

Important: video continuity is now ensured by the /generate-video --continuous mode. This skill is mainly used to:

  1. Add background music - Add BGM to a continuous video
  2. Multi-episode composition - Merge videos from multiple episodes
  3. Add intro/outro - Insert intro/outro
  4. Fallback - When continuous generation fails, splice independent scene videos

Use cases

1. Add background music

python .claude/skills/compose-video/scripts/compose_video.py \
    my_project script.json \
    --input output/episode_01.mp4 \
    --music background_music.mp3 \
    --music-volume 0.3

2. Merge multi-episode videos

python .claude/skills/compose-video/scripts/compose_video.py \
    my_project script.json \
    --merge-episodes 1 2 3 \
    --output final_movie.mp4

3. Add intro/outro

python .claude/skills/compose-video/scripts/compose_video.py \
    my_project script.json \
    --intro intro.mp4 \
    --outro outro.mp4 \
    --output final_with_intro.mp4

4. Fallback splicing (not recommended)

When continuous generation is unavailable, splice independent scene videos:

python .claude/skills/compose-video/scripts/compose_video.py \
    my_project script.json \
    --fallback-mode \
    --output chapter_01_final.mp4

Workflow

  1. Load project and script

    • If no project name is specified, ask the user
    • From projects/{项目名}/scripts/ load the script
    • Check output/ for continuous videos in the directory
  2. Select processing mode

    • Add BGM
    • Merge multiple episodes
    • Add intro/outro
    • Fallback splicing
  3. Perform processing

    • Use ffmpeg for the corresponding processing
    • Keep the original video unchanged
    • Output to projects/{项目名}/output/

Transition types (fallback mode)

According to the transition_to_next field in the script:

Type ffmpeg filter
cut Direct splicing
fade xfade=transition=fade:duration=0.5
dissolve xfade=transition=dissolve:duration=0.5
wipe xfade=transition=wipeleft:duration=0.5

Environment requirements

  • ffmpeg is installed and in PATH
  • Continuous videos or scene videos have been generated
  • Video resolutions are consistent (9:16 portrait)

Output options

  1. Add BGM - Mix original audio and background music
  2. Merge videos - Splice multiple videos into one
  3. Add intro/outro - Insert material at the beginning and end of the video

Pre-processing checks

  • Continuous videos or scene videos exist and are playable
  • Video resolutions are consistent (9:16 portrait)
  • Background music file exists (if needed)
  • Intro/outro files exist (if needed)

Recommended workflow

  1. Use /generate-video --continuous --episode N to generate a coherent video
  2. Use /compose-video to add BGM (optional)
  3. Use /compose-video to add intro/outro (optional)