Video To Gifのロゴ

Video To Gif

組織
cognyai
video-to-gif

Convert an MP4 (e.g. a HyperFrames render or a screen recording) to a high-quality GIF using FFmpeg's two-pass palette method. Picks the right preset for the target surface — Slack/DMs/Twitter/email/Reddit/GitHub — so you don't ship a 40MB GIF to a 5MB inbox.

Add to TypingMind

概要

公開者cognyai
リポジトリclaude-code-marketing-skills
スキル名video-to-gif
スター
111
フォーク
15
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    cognyaiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Video To Gif」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/cognyai/claude-code-marketing-skills/tree/main/skills/video-to-gif
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cognyai/claude-code-marketing-skills.git /tmp/claude-code-marketing-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-marketing-skills/skills/video-to-gif .claude/skills/video-to-gif
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでVideo To Gifを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にVideo To Gifを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Video To Gifは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Video to GIF

Convert a video (MP4, MOV, WebM) to a GIF that's actually small and actually looks good on the surface you're posting to. Pairs naturally with /tiktok-launch-video, /reddit-launch-video, and /linkedin-launch-video for sharing renders in places where MP4 isn't supported (Slack threads, X cards, GitHub READMEs, transactional emails).

GIF is a terrible video format — but it's everywhere, so we use FFmpeg's two-pass palettegen / paletteuse flow to make it look as good as the format allows.

Works with

Runs locally on FFmpeg with zero accounts. One optional hand-off:

JobPrimaryAlso answers itWhat differs
Make the GIFFFmpeg (local)—Always available
Post it to X (enhanced when connected)X Organic tool_upload_media + tool_create_post—Asks first; needs the GIF at a public URL and ≤ 15 MB

Usage

/video-to-gif launch.mp4 — interactive, asks the target /video-to-gif launch.mp4 slack — Slack-tuned /video-to-gif launch.mp4 reddit — Reddit-comment-tuned /video-to-gif launch.mp4 github — GitHub README–tuned /video-to-gif launch.mp4 twitter — X / Twitter–tuned /video-to-gif launch.mp4 email — transactional / newsletter–tuned

Prerequisites

bash
ffmpeg -version | head -1   # must exist
ffprobe -version | head -1

If FFmpeg isn't installed:

bash
# macOS
brew install ffmpeg
# Debian/Ubuntu
sudo apt install ffmpeg

Steps

1. Inspect the source

Run ffprobe to get the source's duration, dimensions, and frame rate. You need these to pick the right preset and to warn the user before producing something that won't fit.

bash
ffprobe -v error -show_entries stream=width,height,r_frame_rate -show_entries format=duration -of default=noprint_wrappers=1 <input>

Capture: source width, source height, source duration (seconds), source fps.

2. Pick the preset

If the user passed a target, use the matching preset. Otherwise ask. Each preset is tuned to the surface's actual size limits and aesthetic norms:

PresetWidthFPSLoopWhy
slack48012yes50MB upload cap; threads scroll fast; readability > smoothness
twitter48015yes15MB GIF cap; auto-converted to MP4 above the cap, kills the loop
reddit60015yes100MB cap but image-host sidebar dies past 20MB
github72015yes10MB README cap; over the cap GitHub silently drops the file
email48010yes5MB Gmail clip threshold; many ESPs strip animation past 1MB
web80018yesGeneric fallback for landing pages and product blogs

Rules of thumb:

  • If source is < 6 seconds, you can usually bump fps by ~3 without breaking the size budget.
  • If source is > 12 seconds, drop fps by 2–3 and consider trimming.
  • Never upscale — if source width is below the preset width, keep source width.
  • Strip audio (GIF can't carry it) — saves a step and removes accidental noise from screen captures.

3. Two-pass palette render (this is the only correct way)

A single-pass GIF render produces banded, dithered, oversized garbage. The right approach is two passes:

  1. Generate an optimal 256-color palette from the source.
  2. Apply that palette with Floyd-Steinberg dithering.

The pipeline is FFmpeg's palettegen filter feeding paletteuse. Do it as a single command using filter splits:

bash
ffmpeg -y -i "<input>" \
  -vf "fps=<FPS>,scale=<WIDTH>:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=floyd_steinberg" \
  -loop 0 \
  "<output.gif>"

Notes on the filter chain:

  • fps=<FPS> first — so palette is generated from the actual frames you'll keep.
  • scale=<WIDTH>:-1 keeps aspect; -1 rounds the height. Use -2 for codecs that need even dimensions (not needed for GIF, but harmless).
  • flags=lanczos is the best general-purpose downscaler.
  • stats_mode=diff weights moving regions higher when picking palette colors — sharper text, cleaner UI, less banding.
  • dither=floyd_steinberg is the best default. For UI / sharp edges with no gradients, try dither=bayer:bayer_scale=3 instead — slightly larger files but no dither noise on flat colors.
  • -loop 0 = infinite loop. Use -loop 1 to play once. (For Slack and Twitter, infinite loop is what users expect.)

Alternative for HyperFrames sources: if the input is still a HyperFrames project (not just its MP4), you can render the GIF straight from the composition, skipping the MP4 step: npx hyperframes render --format gif --fps 15 --gif-loop 0 --output out.gif from the project directory (--fps 15 is HyperFrames' recommended GIF rate; it still needs FFmpeg). It outputs at the composition's own size (its --resolution only scales up), so when the preset in step 2 is narrower than the composition, use the MP4 + palette pipeline below instead. Either way, check the cap as in step 4.

4. Render and verify

Run the command. Then verify:

bash
# Check the file size
ls -lh "<output.gif>"

# Check the GIF's actual dimensions and frame count
ffprobe -v error -count_frames -select_streams v:0 \
  -show_entries stream=width,height,nb_read_frames \
  -of default=noprint_wrappers=1 "<output.gif>"

If the file is larger than the preset's surface cap (see table above), do one of:

  1. Drop FPS by 2–3 and re-render (best quality preserved).
  2. Drop width by ~80px and re-render (text may get harder to read).
  3. Trim the source first (-ss <start> -t <duration>) and re-render.

Don't mix all three — change one variable at a time so you know what helped.

5. (Optional) Trim before converting

If the source is long, trim before the palette pass — the palette will be more accurate and the file smaller.

bash
# Take 8 seconds starting at 2.5s in
ffmpeg -y -ss 2.5 -t 8 -i "<input>" -c copy "<input>.trimmed.mp4"
# then run the two-pass palette command on .trimmed.mp4

-ss before -i is keyframe-fast but slightly imprecise. For frame-accurate trims, put -ss after -i (slower).

6. Hand the file back

Print:

  1. Path to the output GIF
  2. Final size on disk
  3. Final dimensions and frame count
  4. Surface cap status: "fits Slack (50MB) ✓" / "exceeds GitHub README cap (10MB), retry with fps=12 ✗"

Enhanced when connected (twitter preset only): if the workspace has X Organic connected and the user wants it posted, get a public URL for the GIF (on Cloud, mcp__cogny__mcp__cogny-image-gen__tool_request_upload_url plus the returned curl; otherwise ask for a hosted link), then call mcp__cogny__mcp__X_Organic__tool_upload_media(file_url, alt_text) and mcp__cogny__mcp__X_Organic__tool_create_post(text, media_ids). Both ask first, and the post goes live immediately, so show the exact text before posting.

One-liners (for when the user knows what they want)

bash
# Slack-tuned (480px / 12fps)
ffmpeg -y -i in.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=floyd_steinberg" -loop 0 out.gif

# Twitter-tuned (480px / 15fps)
ffmpeg -y -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=floyd_steinberg" -loop 0 out.gif

# GitHub README-tuned (720px / 15fps)
ffmpeg -y -i in.mp4 -vf "fps=15,scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=floyd_steinberg" -loop 0 out.gif

# Email-tuned (480px / 10fps, single loop)
ffmpeg -y -i in.mp4 -vf "fps=10,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=floyd_steinberg" -loop 0 out.gif

Common mistakes

  1. Single-pass GIF render — ffmpeg -i in.mp4 out.gif produces ugly, oversized output. Always use the palette pipeline.
  2. Upscaling — never scale GIFs up; they go from "bad" to "extremely bad". Match or downscale only.
  3. High FPS for talking-head content — anything above 18fps is wasted on a GIF; drop to 12–15fps and put the bytes into resolution instead.
  4. Including audio — GIF can't carry it. If you need audio, the surface supports MP4 and you should ship MP4 instead.
  5. Long GIFs (> 15s) — if you need 30+ seconds, you probably need MP4 or WebP, not GIF. Ask the user if a different format works.
  6. Sending a 40MB GIF to email — most ESPs strip the animation past 1MB, leaving the recipient with a static first frame. Use the email preset or fall back to a static PNG hero with a link.

Related

  • /tiktok-launch-video, /reddit-launch-video, /linkedin-launch-video — produce the source MP4 this skill converts
  • /welcome-series, /winback-engine — places where a small embedded GIF lifts engagement

よくある質問

AIスキル「Video To Gif」では何ができますか?

Convert an MP4 (e.g. a HyperFrames render or a screen recording) to a high-quality GIF using FFmpeg's two-pass palette method. Picks the right preset for the target surface — Slack/DMs/Twitter/email/Reddit/GitHub — so you don't ship a 40MB GIF to a 5MB inbox.

TypingMindでVideo To Gifを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Video To Gifはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにVideo To Gifをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/cognyai/claude-code-marketing-skills/tree/main/skills/video-to-gifを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Video To Gifを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Video To Gifで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもVideo To Gifを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Video To Gif」は無料ですか?

cognyaiがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇