Communitygithub.com

1596941391qq/ai-openclaw-skeletons

Full-stack video post-production Skill: Whisper transcription → auto-editor silence removal → ffmpeg fine editing (PIP magnifier/chapter titles/acceleration/subtitle burning) → Remotion animated clips → HyperFrames branded videos. Suitable for tutorial video post-production, talking head dead air removal, promo video generation, and multi-platform export.

What is ai-openclaw-skeletons?

This AI agent skill provides a comprehensive, end-to-end video post-production pipeline, integrating six core modules from raw recording to finished product. It begins with Whisper for speech-to-text transcription, then uses auto-editor to automatically remove silent segments (jump cuts). The core ffmpeg module handles sophisticated fine editing including picture-in-picture (PIP) magnifiers, animated chapter titles, variable speed acceleration, and subtitle burning with proper font support. For motion graphics and branding, it leverages Remotion to create animated intros/outros and data visualizations, while HyperFrames enables HTML/CSS-to-video rendering for branded content with optional AI digital avatars via HeyGen. The skill supports platforms like YouTube, WeChat Video, Xiaohongshu, Twitter/X, and LinkedIn with platform-optimized export presets, and enforces quality standards such as CRF 17 encoding and faststart for web playback.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/1596941391qq/ai-openclaw-skeletons/tree/HEAD/Packs/video-editor-skill-pack

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Video Editor Full — Full-Stack Video Post-Production Skill

Integrates 6 major capabilities into a one-stop video post-production Skill, from raw screen recording to finished product, all AI-driven.

Capability Matrix

ModuleToolPurposeDependency
TranscriptionWhisper (base/small/medium)Speech → SRT subtitlesPython + openai-whisper
Silence Removalauto-editorAutomatic jump cuts for dead airPython + auto-editor
Fine Editingffmpeg filter_complexPIP magnifier, chapter titles, acceleration, drawbox highlightsffmpeg 7.0+
Subtitlesffmpeg subtitles filterBurn SRT (supports Chinese Microsoft YaHei)ffmpeg + font
AnimationRemotionIntros/outros, data visualization, dynamic chartsNode.js 18+ + Remotion
Branded VideosHyperFramesHTML/CSS → video, AI digital avatarNode.js + HeyGen API Key

Workflow Overview

┌─────────────┐     ┌──────────────┐     ┌─────────────────┐
│  Raw Video   │────▶│  Analyze &   │────▶│  Content        │
│              │     │  Transcribe  │     │  Planning        │
└─────────────┘     └──────────────┘     └─────────────────┘
                                                   │
                    ┌──────────────────────────────┼──────────────────┐
                    ▼                              ▼                  ▼
            ┌──────────────┐            ┌─────────────────┐  ┌──────────────┐
            │ auto-editor  │            │ ffmpeg Fine     │  │ Remotion     │
            │ Silence/Jump │            │ PIP+Chapters+   │  │ Intros/Outros│
            │ Cuts         │            │ Acceleration    │  │              │
            └──────┬───────┘            └────────┬────────┘  └──────┬───────┘
                   │                             │                   │
                   └─────────────────────────────┼───────────────────┘
                                                 ▼
                                        ┌─────────────────┐
                                        │  Subtitle Burn  │
                                        │  + Final Export │
                                        └─────────────────┘

Prerequisites

# Required
pip install openai-whisper auto-editor
# ffmpeg must be in PATH (7.0+ recommended)
ffmpeg -version

# Optional: Remotion (intro/outro animations)
npx create-video@latest --blank

# Optional: HyperFrames (branded videos)
# Requires HeyGen API Key, see templates/hyperframes-config.example.json

Module Details


Module 1: Analysis & Transcription

Step 1: Video Metadata

ffprobe -v quiet -print_format json -show_format -show_streams input.mp4

Focus on: resolution, frame rate, duration, codec, bitrate.

Step 2: Extract Key Frames (every 5 seconds)

mkdir -p frames
ffmpeg -i input.mp4 -vf "fps=1/5" -q:v 2 frames/frame_%03d.jpg

Use visual analysis to determine key UI areas, chapter boundaries, and magnifier targets.

Step 3: Whisper Transcription

import whisper
model = whisper.load_model("base")  # "base" is fine for Chinese, "medium" is more accurate but slower
result = model.transcribe("audio.wav", language="zh")

After outputting SRT, manual calibration is required:

  • Proper nouns (product names, technical terms)
  • Timeline alignment (especially drift in the latter half)
  • Homophone errors

Module 2: auto-editor Silence Removal

# Basic usage: remove all silent segments
auto-editor input.mp4 --margin 0.2s --output no_silence.mp4

# Conservative mode: only remove silence longer than 1 second
auto-editor input.mp4 --min-clip-length 1s --margin 0.3s --output no_silence.mp4

# Export timeline (no direct rendering, for subsequent ffmpeg fine editing)
auto-editor input.mp4 --export timeline:api

Note: After auto-editor removes silence, the timeline changes. Subtitles must be generated or realigned after silence removal.

Recommended order: Original video → auto-editor → re-transcribe/align subtitles → ffmpeg fine editing


Module 3: ffmpeg Fine Editing (Core)

3.1 PIP Magnifier (Picture-in-Picture)

# Key: Use force_original_aspect_ratio for crop area to avoid stretching
PIP_W, PIP_H = 300, 188  # Target PIP window size

# filter_complex snippet:
# crop → scale (maintain ratio) → pad (add black borders) → drawbox (yellow border)
f"[pip{i}]crop={cw}:{ch}:{cx}:{cy},"
f"scale={PIP_W}:{PIP_H}:force_original_aspect_ratio=decrease,"
f"pad={PIP_W}:{PIP_H}:(ow-iw)/2:(oh-ih)/2:color=0x1a1a2e,"
f"drawbox=x=0:y=0:w={PIP_W}:h={PIP_H}:color=yellow:t=2"
f"[pip{i}s]"

3.2 Chapter Titles (drawtext fade)

# Display titles at chapter transition points, with fade in/out
f"drawtext=text='{title}':"
f"fontfile='C\\:/Windows/Fonts/msyh.ttc':"
f"fontsize=28:fontcolor=white:borderw=3:[email protected]:"
f"x=(w-text_w)/2:y=30:"
f"alpha='if(lt(t,{start}),0,if(lt(t,{start}+0.4),(t-{start})/0.4,"
f"if(lt(t,{end}-0.4),1,if(lt(t,{end}),({end}-t)/0.4,0))))':"
f"enable='between(t,{fade_in},{fade_out})'"

3.3 Acceleration

# Video acceleration
f"[vout]setpts=PTS/{SPEED}[vfinal]"
# Audio acceleration (atempo range 0.5-2.0, chain if exceeding)
f"[0:a]atempo={SPEED}[afinal]"

3.4 Subtitle Timeline Synchronization

After acceleration, subtitle timecodes must be adjusted synchronously:

new_start = original_start / SPEED
new_end = original_end / SPEED

3.5 Full Build Template

See scripts/build_template.py


Module 4: Remotion Animated Clips

Suitable for generating intros, outros, transition animations, and data visualizations.

# Initialize Remotion project
npx create-video@latest my-intro --blank

# Write animation in src/Composition.tsx
# Render to MP4
npx remotion render src/index.ts MyComp out/intro.mp4

Generated clips are concatenated to the main video via ffmpeg concat:

# concat list
echo "file 'intro.mp4'" > list.txt
echo "file 'main.mp4'" >> list.txt
echo "file 'outro.mp4'" >> list.txt
ffmpeg -f concat -safe 0 -i list.txt -c copy final.mp4

Remotion Agent Skill Installation:

# Official skill (recommended)
git clone https://github.com/remotion-dev/skills.git ~/.claude/skills/remotion

Module 5: HyperFrames Branded Videos

Renders HTML/CSS/JS into video frames, suitable for brand promotion and website-to-video conversion.

# Installation
npm install @anthropic-ai/hyperframes

# Basic usage: HTML → MP4
npx hyperframes render --input composition.html --output brand.mp4

Requires HeyGen API Key for Avatar digital human functionality. Configuration template: templates/hyperframes-config.example.json


Module 6: Final Export

Subtitle Burning (Final Step)

ffmpeg -y -i video_no_sub.mp4 \
  -vf "subtitles='srt_path':force_style='FontSize=13,FontName=Microsoft YaHei,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2,Shadow=1,MarginV=22,Bold=1'" \
  -c:v libx264 -preset slow -crf 17 \
  -c:a copy -pix_fmt yuv420p -movflags +faststart \
  output.mp4

Multi-Platform Export

PlatformResolutionAspect RatioDuration Limit
YouTube1920x108016:9None
WeChat Video1080x19209:1660s (recommended)
Xiaohongshu1080x13504:55min
Twitter/X1280x72016:92:20
LinkedIn1920x108016:910min
# Vertical crop example (16:9 → 9:16)
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" -crf 18 vertical.mp4

Quality Guidelines

  1. CRF 17 + slow preset — Standard quality for tutorial videos
  2. yuv420p — Compatible with all players
  3. faststart — Enables instant web playback
  4. lanczos — Preferred scaling algorithm
  5. No more than 2 encoding passes — Avoid generational loss
  6. Burn subtitles last — Ensure timeline alignment

Common Pitfalls

  • Windows paths in ffmpeg subtitles filter require / and : must be escaped as \:
  • Whisper on Windows must use Windows paths (cannot use /tmp/)
  • atempo range is 0.5-2.0, chain if exceeding: atempo=2.0,atempo=1.5 = 3x
  • Mismatched PIP crop area and target window aspect ratios cause stretching; must use force_original_aspect_ratio
  • auto-editor changes the timeline; any previous subtitles become invalid
  • If filter_complex is too long to pass on the command line, use -filter_complex_script to write to a file

File Structure

video-editor-skill-pack/
├── SKILL.md                          # This file
├── scripts/
│   ├── build_template.py             # ffmpeg fine editing build template
│   ├── transcribe.py                 # Whisper transcription script
│   ├── adjust_srt_speed.py           # SRT timeline speed adjustment
│   └── analyze_frames.py             # Key frame extraction + analysis
├── templates/
│   ├── hyperframes-config.example.json
│   └── remotion-intro/               # Remotion intro template (to be populated)
└── examples/
    └── tutorial-video-workflow.md    # Tutorial video full workflow example

Related Skills