← 返回 Skills 市场
zzlupus

Mp4 To Gif

作者 ZZLupus · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
68
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install mp4-to-gif
功能描述
Use when the user wants to convert MP4 video files to GIF format, or asks about video-to-GIF conversion with quality/size control
使用说明 (SKILL.md)

MP4 to GIF Conversion

Overview

Convert MP4 videos to high-quality GIFs using ffmpeg's two-pass palette method. The two-pass approach produces significantly better color quality than direct conversion.

When to Use

  • User wants to convert MP4 (or other video) to GIF
  • User needs to create GIFs from video for documentation, demos, or sharing
  • User asks about reducing GIF file size or improving GIF quality

Prerequisites

  • ffmpeg must be installed and available in PATH

Core Method

Two-pass palette-based conversion (always use this over single-pass):

# Pass 1: Generate optimized palette
ffmpeg -y -i \x3Cinput> -vf "fps=15,scale=480:-1:flags=lanczos,palettegen=stats_mode=diff" /tmp/palette.png

# Pass 2: Convert using palette
ffmpeg -y -i \x3Cinput> -i /tmp/palette.png -lavfi "fps=15,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" \x3Coutput>

Quick Reference

Parameter Default Effect
fps 15 Frame rate — lower = smaller file, choppier motion
scale width 480 Output width in px — height auto-calculated (-1)
lanczos High-quality downscaling filter
stats_mode=diff Palette optimized for frame differences (better for motion)
dither=bayer Ordered dithering, good balance of quality/size
bayer_scale 5 Dither strength (0-5), higher = more dithering
diff_mode=rectangle Only update changed regions (smaller file)

Size vs Quality Tradeoffs

Goal Adjust
Smaller file Lower fps (10), smaller width (320), or trim duration
Smoother motion Higher fps (24-30), but file size increases significantly
Better colors Use stats_mode=full for static/slow content
Sharper Increase width (640-800), costs more file size

Bundled Scripts

Two scripts are bundled alongside this SKILL.md. Use the one matching the current platform.

Windows (PowerShell)mp4_to_gif.ps1:

& "\x3Cthis-skill-dir>/mp4_to_gif.ps1" -InputFile \x3Cinput>                    # Defaults: 480px, 15fps
& "\x3Cthis-skill-dir>/mp4_to_gif.ps1" -InputFile \x3Cinput> -Width 640 -Fps 20 # Custom settings
& "\x3Cthis-skill-dir>/mp4_to_gif.ps1" -InputFile \x3Cinput> -OutputFile \x3Coutput> # Custom output name

Linux / macOS (Bash)mp4_to_gif.sh:

bash "\x3Cthis-skill-dir>/mp4_to_gif.sh" -i \x3Cinput>                    # Defaults: 480px, 15fps
bash "\x3Cthis-skill-dir>/mp4_to_gif.sh" -i \x3Cinput> -w 640 -f 20      # Custom settings
bash "\x3Cthis-skill-dir>/mp4_to_gif.sh" -i \x3Cinput> -o \x3Coutput>        # Custom output name

When Claude invokes this skill, resolve \x3Cthis-skill-dir> to the absolute path of the directory containing this SKILL.md.

Common Mistakes

  • Single-pass conversion (ffmpeg -i in.mp4 out.gif) — produces terrible banding and color artifacts. Always use the two-pass palette method.
  • Too high fps — 30fps GIFs are massive. 15fps is usually sufficient for demos.
  • Too wide — 480px is good for most uses. Full 1080p GIFs are impractically large.
  • Forgetting to clean up palette — Delete the temporary palette.png after conversion.
安全使用建议
This skill looks safe for local video-to-GIF conversion. Before using it, make sure ffmpeg is installed from a trusted source and choose the output path carefully because existing GIF files may be overwritten.
功能分析
Type: OpenClaw Skill Name: mp4-to-gif Version: 1.0.0 The skill bundle provides a legitimate utility for converting MP4 videos to high-quality GIFs using ffmpeg's two-pass palette method. The included Bash (mp4_to_gif.sh) and PowerShell (mp4_to_gif.ps1) scripts are well-structured, using standard practices for temporary file handling and parameter passing. No indicators of malicious intent, data exfiltration, or prompt injection were found.
能力评估
Purpose & Capability
The SKILL.md and bundled scripts consistently focus on MP4/video-to-GIF conversion using ffmpeg's palette workflow.
Instruction Scope
The conversion commands are user-directed and purpose-aligned, but they use ffmpeg's overwrite flag, so an existing output GIF can be replaced.
Install Mechanism
There is no install spec, but the skill requires ffmpeg to already be installed; the registry requirements do not declare that binary dependency.
Credentials
The scripts read a specified input video, create a temporary palette file, and write a specified or default GIF output; no broad file access or external data transfer is shown.
Persistence & Privilege
No credentials, privileged access, background services, startup hooks, or persistent agent state are present in the artifacts.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mp4-to-gif
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mp4-to-gif 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the mp4-to-gif skill. - Provides two-pass, palette-based MP4 to GIF conversion using ffmpeg for high-quality results. - Includes scripts for Windows (PowerShell) and Linux/macOS (Bash) with customizable parameters. - Offers detailed guidance on quality/size tradeoffs and optimal settings. - Highlights common mistakes and best practices for video-to-GIF conversion.
元数据
Slug mp4-to-gif
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Mp4 To Gif 是什么?

Use when the user wants to convert MP4 video files to GIF format, or asks about video-to-GIF conversion with quality/size control. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 68 次。

如何安装 Mp4 To Gif?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install mp4-to-gif」即可一键安装,无需额外配置。

Mp4 To Gif 是免费的吗?

是的,Mp4 To Gif 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Mp4 To Gif 支持哪些平台?

Mp4 To Gif 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Mp4 To Gif?

由 ZZLupus(@zzlupus)开发并维护,当前版本 v1.0.0。

💬 留言讨论