本文へ移動
cccskills
無料GitHub で公開日本語紹介

short-form-ffmpeg-cookbook

FFmpegのコマンド例を使い、動画を縦型に整え、字幕の追加やクリップの編集、音声とBGMの調整を行うスキルです。

原文原文の説明を見る

Short-form FFmpeg cookbook: copyable commands for Reels. Turns raw footage into a 1080×1920 9:16 MP4 for Reels, TikTok and Shorts with burned-in captions (SRT or ASS), trims and joins clips, and lays music under the voice with ducking. Every command was run on test media. Free and local; works in Claude Code, Codex and Grok, or on the varg ffmpeg tool (credits) when the agent has no shell. Use when the user wants to crop to vertical, burn subtitles, cut or join clips, or add background music with FFmpeg. NOT for animated word-by-word captions (use Remotion or HyperFrames caption skills) or for choosing an editing service (use varg-video-editing).

hashgraph-online/awesome-codex-pluginsスター 1,440(GitHub 1,440 + cccskills 0)
連携ツールTikTok

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 横動画をSNS向けの縦型にしたいとき
  • 字幕を動画に焼き込みたいとき
  • 複数のクリップをカット・連結したいとき
  • 話し声に合わせてBGMを調整したいとき

日本語での紹介

できること

動画の情報を ffprobe で確認し、用途に合わせて加工するための FFmpeg コマンド例を案内します。横長やサイズの異なる映像を 9:16 の縦型に切り抜く方法に加え、全体を残して背景をぼかす方法も扱います。SRT や ASS の字幕を映像に焼き込む、字幕を切り替え可能な形式で付ける、動画を指定区間でカットする、クリップを連結する、といった作業にも対応します。音声では、話し声に合わせてBGMを抑えるダッキングや、一定音量で重ねる方法、音楽への置き換えを扱います。加工後に ffprobe やフレーム画像で確認する手順も含まれています。

こんなときに便利

Reels、TikTok、Shorts向けに手元の動画を縦型にしたいときや、字幕・BGMを加えて短い動画に仕上げたいときに向いています。コマンドラインでローカル処理するほか、シェルを使えない環境ではクレジット制の varg ffmpeg ツールを使う方法も記載されています。

使い方の例

  • 「この動画を9:16にして、全体が見えるよう背景をぼかしてください」
  • 「SRT字幕を焼き込み、話している間はBGMを小さくしてください」
  • 「この2本をつなぎ、冒頭の不要な部分をカットしてください」

注意点

ローカル実行には ffmpeg と ffprobe が必要です。字幕の焼き込みには libass を含む FFmpeg が必要です。シェルを使わない場合の varg ツールはクレジット制です。BGMには自作またはプラットフォームで利用許諾された音源を使います。逐語的に文字が動くアニメーション字幕の作成や、編集サービスの選定は対象外です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Short-form FFmpeg cookbook: copyable commands for Reels

Input: a video (any size), optionally an SRT file and a music track. Output: a 1080×1920 9:16 MP4 ready for Reels, TikTok and Shorts. Probe first, run one recipe at a time, check the result with ffprobe and a frame grab before the next step.

ffprobe -v error -show_entries stream=codec_type,codec_name,width,height,r_frame_rate -show_entries format=duration -of compact=p=0 input.mp4

1. Crop to 9:16 vertical

# center crop, full height
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920,setsar=1" -c:v libx264 -crf 20 -c:a copy vertical.mp4
# subject off-center: add the x offset in px
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih:200:0,scale=1080:1920,setsar=1" -c:v libx264 -crf 20 -c:a copy vertical.mp4
# keep the whole frame over a blurred copy
ffmpeg -i input.mp4 -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=20:2[bg];[0:v]scale=1080:-2[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2,setsar=1" -c:v libx264 -crf 20 -c:a copy vertical-blur.mp4

2. Burn in captions

ffmpeg -i vertical.mp4 -vf "subtitles=subs.srt:force_style='FontName=Arial,FontSize=14,Bold=1,Outline=2,Alignment=2,MarginV=60'" -c:v libx264 -crf 20 -c:a copy captioned.mp4
# styled or karaoke captions: convert, edit the .ass, burn
ffmpeg -i subs.srt subs.ass
ffmpeg -i vertical.mp4 -vf "ass=subs.ass" -c:v libx264 -crf 20 -c:a copy captioned.mp4
# soft subtitles (switchable, no re-encode)
ffmpeg -i input.mp4 -i subs.srt -map 0 -map 1 -c copy -c:s mov_text -metadata:s:s:0 language=eng soft.mp4

Keep captions out of the bottom 14% and the right edge of a 9:16 frame, where the platform buttons sit. Check a frame: ffmpeg -ss 2 -i captioned.mp4 -frames:v 1 frame.png, then read it.

3. Trim and join

# frame-accurate trim (re-encodes)
ffmpeg -ss 00:00:05 -to 00:00:12 -i input.mp4 -c:v libx264 -crf 18 -c:a aac clip.mp4
# instant lossless trim (cuts on keyframes, may start a few seconds off)
ffmpeg -ss 00:00:05 -to 00:00:12 -i input.mp4 -c copy clip.mp4
# join clips with the same codec, size and frame rate
printf "file 'clip1.mp4'\nfile 'clip2.mp4'\n" > list.txt
ffmpeg -f concat -safe 0 -i list.txt -c copy joined.mp4
# join clips that differ: scale and pad each to 1080x1920, then concat
ffmpeg -i a.mp4 -i b.mp4 -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v0];[1:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v1];[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -crf 20 -c:a aac joined.mp4

Every clip in the concat filter needs an audio track; give a silent one -f lavfi -i anullsrc=r=48000:cl=stereo -shortest.

4. Music under the voice

# duck the music while people talk
ffmpeg -i input.mp4 -i music.mp3 -filter_complex "[0:a]asplit=2[voice][key];[1:a]volume=0.4[m];[m][key]sidechaincompress=threshold=0.03:ratio=8:attack=20:release=400[ducked];[voice][ducked]amix=inputs=2:duration=first:normalize=0[a]" -map 0:v -map "[a]" -c:v copy -c:a aac output.mp4
# flat music bed
ffmpeg -i input.mp4 -i music.mp3 -filter_complex "[1:a]volume=0.25[m];[0:a][m]amix=inputs=2:duration=first:normalize=0[a]" -map 0:v -map "[a]" -c:v copy -c:a aac output.mp4
# replace the sound, loop the track, fade out (20 s video)
ffmpeg -i input.mp4 -stream_loop -1 -i music.mp3 -map 0:v -map 1:a -c:v copy -c:a aac -shortest -af "afade=t=out:st=18:d=2" output.mp4
# loudness check (platforms normalize to about -14 LUFS)
ffmpeg -i output.mp4 -af ebur128 -f null -

Use music you made or licensed for the platform. normalize=0 needs FFmpeg 4.4 or later.

No shell

Send the same command to the varg ffmpeg tool (MCP call_tool, or POST https://api.varg.ai/v2/ffmpeg), or use its resize, trim and slice tools, with URLs in and out. Priced in credits, with an estimate before it runs. Tutorials: https://skills.varg.ai/burn-captions-with-ffmpeg/, https://skills.varg.ai/crop-a-video-to-vertical-with-ffmpeg/, https://skills.varg.ai/trim-and-join-video-clips-with-ffmpeg/, https://skills.varg.ai/add-music-to-a-video-with-ffmpeg/.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

accelerate-local-work

無料概要あり

複数の独立したローカル作業を安全性と依存関係を確認して実行計画にまとめ、対応環境では並列化やAppleシリコン向け処理の選択を支援します。

  • ビルドやテストの独立した処理を並列化したいとき
  • 複数段階の作業計画を安全に実行したいとき
  • Appleシリコン向け処理の候補を確認したいとき
hashgraph-online/awesome-codex-plugins1,4362026年10月27日 更新

ad-creative-testing

無料概要あり

TikTokやMeta広告の勝ちパターンを分解し、異なる切り口のテスト案や予算、評価時期を整理して、数値から継続・修正・停止を判断するスキルです。

  • 勝ち広告を分解して次のテスト案を作りたいとき
  • 広告の本数やテスト予算を決めたいとき
  • 似た広告案の成果が変わらない原因を探したいとき
hashgraph-online/awesome-codex-plugins1,4402026年10月30日 更新

add

無料概要あり

将来の読み手が理由を知りたくなる未決定や暫定対応を、技術的負債として登録し、後から項目ごとに整理できるスキルです。

  • 暫定対応を負債として記録したいとき
  • TODOや未完了作業を管理したいとき
  • 負債の影響箇所や解消条件を残したいとき
hashgraph-online/awesome-codex-plugins1,4402026年10月30日 更新

adk-framework-adapters

無料概要あり

LangChain、EINO、AutoGen、AgentScope、CrewAI向けのコード雛形やAPI対応、プロジェクト構成を参照し、バージョン確認を踏まえてAIエージェント開発を支援します。

  • 指定したフレームワークで雛形を作りたいとき
  • 複数のエージェントフレームワークを比較したいとき
  • ツール定義やメモリ設定の例を参照したいとき
hashgraph-online/awesome-codex-plugins1,4362026年10月26日 更新

agent-debug-fixer

無料概要あり

エラーやテスト失敗、画面の異常などを再現して原因を特定し、テストで確認しながら影響を絞った修正を進めるデバッグ用スキルです。

  • テスト失敗の根本原因を調べたいとき
  • 画面や機能の不具合を小さく修正したいとき
  • 再発防止のテストを先に用意したいとき
hashgraph-online/awesome-codex-plugins1,4402026年10月30日 更新

agent-dev-workshop

無料概要あり

対話を通じてAI Agentの要件整理から設計、ツール定義、コード生成、動作確認まで6段階で進め、実行可能なプロジェクトを作ります。

  • Agentの要件と設計を整理したいとき
  • 実行可能なAgentの試作品を作りたいとき
  • ツールやPromptの構成を決めたいとき
hashgraph-online/awesome-codex-plugins1,4362026年10月26日 更新

hashgraph-online のスキルをすべて見る

このスキルの問題を報告する