Video Editor Full — フルスタック動画後期スキル
6つの主要機能を統合したオールインワン動画後期制作スキル。録画素材から完成品まで、AIによる完全自動処理を実現します。
機能マトリクス
| モジュール | ツール | 用途 | 依存関係 |
|---|---|---|---|
| 転写 | Whisper (base/small/medium) | 音声→字幕 SRT | Python + openai-whisper |
| 無音除去 | auto-editor | 自動ジャンプカット & 無音除去 | Python + auto-editor |
| 精密編集 | ffmpeg filter_complex | PIP拡大鏡、チャプタータイトル、速度変更、drawbox ハイライト | ffmpeg 7.0+ |
| 字幕 | ffmpeg subtitles filter | SRT 焼き込み(日本語フォント対応) | ffmpeg + フォント |
| アニメーション | Remotion | イントロ/アウトロ、データ可視化、動的グラフ | Node.js 18+ + Remotion |
| ブランド動画 | HyperFrames | HTML/CSS→動画、AIデジタルアバター | Node.js + HeyGen API Key |
ワークフロー概要
┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ 元動画 │────▶│ 分析 & 転写 │────▶│ コンテンツ計画 │
└─────────────┘ └──────────────┘ └─────────────────┘
│
┌──────────────────────────────┼──────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌─────────────────┐ ┌──────────────┐
│ auto-editor │ │ ffmpeg 精密編集 │ │ Remotion │
│ 無音除去 │ │ PIP+チャプター │ │ イントロ │
└──────┬───────┘ └────────┬────────┘ └──────┬───────┘
│ │ │
└─────────────────────────────┼───────────────────┘
▼
┌─────────────────┐
│ 字幕焼き込み │
│ + 最終書き出し │
└─────────────────┘
前提条件
# 必須
pip install openai-whisper auto-editor
# ffmpeg が PATH に含まれていること(推奨 7.0+)
ffmpeg -version
# オプション:Remotion(イントロ/アウトロアニメーション)
npx create-video@latest --blank
# オプション:HyperFrames(ブランド動画)
# HeyGen API Key が必要。テンプレートは templates/hyperframes-config.example.json を参照
モジュール詳細
モジュール 1:分析 & 転写
Step 1: 動画メタデータ
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
注目ポイント:解像度、フレームレート、長さ、コーデック、ビットレート。
Step 2: キーフレーム抽出(5秒ごと)
mkdir -p frames
ffmpeg -i input.mp4 -vf "fps=1/5" -q:v 2 frames/frame_%03d.jpg
視覚分析により、重要なUI領域、チャプター境界、拡大鏡のターゲットを特定します。
Step 3: Whisper 転写
import whisper
model = whisper.load_model("base") # 中国語は base で十分、medium はより正確だが遅い
result = model.transcribe("audio.wav", language="ja") # 言語は適宜変更
SRT 出力後は必ず手動で確認:
- 固有名詞(製品名、技術用語)
- タイムライン同期(特に後半でずれやすい)
- 同音異義語の誤り
モジュール 2:auto-editor 無音除去
# 基本:全ての無音区間を除去
auto-editor input.mp4 --margin 0.2s --output no_silence.mp4
# 保守モード:1秒以上の無音のみ除去
auto-editor input.mp4 --min-clip-length 1s --margin 0.3s --output no_silence.mp4
# タイムラインをエクスポート(レンダリングせず、後続の ffmpeg 精密編集で使用)
auto-editor input.mp4 --export timeline:api
注意: auto-editor で無音除去するとタイムラインが変わるため、字幕は無音除去後に生成または再同期が必要です。
推奨順序:元動画 → auto-editor → 再転写/字幕同期 → ffmpeg 精密編集
モジュール 3:ffmpeg 精密編集(中核)
3.1 PIP 拡大鏡(ピクチャー・イン・ピクチャー)
# 重要:crop 領域は force_original_aspect_ratio でアスペクト比を維持
PIP_W, PIP_H = 300, 188 # PIP ウィンドウサイズ
# filter_complex 断片:
# crop → scale(アスペクト比保持)→ pad(黒縁補完)→ drawbox(黄色枠)
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 チャプタータイトル(drawtext フェード)
# チャプター切り替え時にタイトルを表示、フェードイン/アウト
f"drawtext=text='{title}':"
f"fontfile='C\:/Windows/Fonts/msgothic.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 速度変更
# 動画速度変更
f"[vout]setpts=PTS/{SPEED}[vfinal]"
# 音声速度変更(atempo 範囲 0.5-2.0、超過時はチェーン)
f"[0:a]atempo={SPEED}[afinal]"
3.4 字幕タイムライン同期
速度変更後は字幕タイムコードも同期調整が必要:
new_start = original_start / SPEED
new_end = original_end / SPEED
3.5 完全ビルドテンプレート
scripts/build_template.py を参照
モジュール 4:Remotion アニメーションクリップ
イントロ、アウトロ、トランジションアニメーション、データ可視化の生成に最適。
# Remotion プロジェクトを初期化
npx create-video@latest my-intro --blank
# src/Composition.tsx でアニメーションを作成
# MP4 としてレンダリング
npx remotion render src/index.ts MyComp out/intro.mp4
生成されたクリップは ffmpeg concat で本編に結合:
# concat リスト
エコー "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 のインストール:
# 公式スキル(推奨)
git clone https://github.com/remotion-dev/skills.git ~/.claude/skills/remotion
モジュール 5:HyperFrames ブランド動画
HTML/CSS/JS を動画フレームとしてレンダリング。ブランドプロモーションやWebサイトの動画変換に最適。
# インストール
npm install @anthropic-ai/hyperframes
# 基本的な使い方:HTML → MP4
npx hyperframes render --input composition.html --output brand.mp4
アバター(デジタルヒューマン)機能を使用するには HeyGen API Key が必要です。
設定テンプレートは templates/hyperframes-config.example.json を参照。
モジュール 6:最終書き出し
字幕焼き込み(最終ステップ)
ffmpeg -y -i video_no_sub.mp4 \
-vf "subtitles='srt_path':force_style='FontSize=13,FontName=MS Gothic,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
マルチプラットフォーム書き出し
| プラットフォーム | 解像度 | アスペクト比 | 長さ制限 |
|---|---|---|---|
| YouTube | 1920x1080 | 16:9 | なし |
| 微信動画号 | 1080x1920 | 9:16 | 60秒(推奨) |
| 小紅書 | 1080x1350 | 4:5 | 5分 |
| Twitter/X | 1280x720 | 16:9 | 2:20 |
| 1920x1080 | 16:9 | 10分 |
# 縦画面クロップ例(16:9 → 9:16)
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" -crf 18 vertical.mp4
品質基準
- CRF 17 + slow preset — チュートリアル動画の標準品質
- yuv420p — 全プレイヤー互換
- faststart — ネット配信で即時再生
- lanczos — リサイズアルゴリズムの第一選択
- エンコードは2回まで — 世代損失を防ぐ
- 字幕は最後に焼き込む — タイムライン同期の確保
よくある落とし穴
- Windows パスは ffmpeg subtitles filter で
/を使用し、:は\:にエスケープ必須 - Whisper は Windows では Windows パスを使用(
/tmp/は不可) atempo範囲は 0.5-2.0、超過時はチェーン:atempo=2.0,atempo=1.5= 3倍速- PIP の crop 領域とターゲットウィンドウのアスペクト比が異なると引き伸ばしが発生、必ず
force_original_aspect_ratioを使用 - auto-editor でタイムラインが変わると、以前の字幕は全て無効になる
- filter_complex が長すぎる場合はコマンドラインで直接渡さず、
-filter_complex_scriptにファイルとして記述
ファイル構成
video-editor-skill-pack/
├── SKILL.md # 本ファイル
├── scripts/
│ ├── build_template.py # ffmpeg 精密編集ビルドテンプレート
│ ├── transcribe.py # Whisper 転写スクリプト
│ ├── adjust_srt_speed.py # SRT タイムライン速度調整
│ └── analyze_frames.py # キーフレーム抽出 + 分析
├── templates/
│ ├── hyperframes-config.example.json
│ └── remotion-intro/ # Remotion イントロテンプレート(準備中)
└── examples/
└── tutorial-video-workflow.md # チュートリアル動画の完全ワークフロー例