用 FFmpeg 将视频高质量转换为 GIF 动画
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "video-to-gif" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/hve-core/main/.github/skills/experimental/video-to-gif/SKILL.md 2. 保存为 ~/.claude/skills/video-to-gif/SKILL.md 3. 装好后重载技能,告诉我可以用了
请将这个视频转换为高质量 GIF,优先使用 FFmpeg 双通道调色板优化,并输出可下载文件。
返回一个优化后的 GIF 文件链接。
把这段短视频导出为较小体积的 GIF,保持颜色尽量准确,默认参数即可。
生成体积更小、颜色更稳的 GIF。
这是一段 HDR 视频,请自动进行色调映射后再转换为 GIF,保证兼容 SDR 显示。
输出完成色调映射的 GIF 文件。
产品经理、设计师或开发者想把一段演示视频快速变成可分享的 GIF。这个技能适合在文档、社区帖或聊天中展示关键操作片段。
当你需要比单次转换更好的色彩和更小的文件体积时,这个技能会使用两遍调色板优化生成 GIF。适合需要控制资源大小的场景。
如果源视频是 HDR,它会自动检测并进行色调映射,帮助输出更适合 SDR 显示的 GIF。适合处理来自现代设备的视频素材。
这是一个使用 FFmpeg 双通道调色板优化将视频转换为 GIF 的技能说明。文档介绍了转换原理、FFmpeg 安装前提、跨平台快速开始、文件搜索顺序、HDR 自动检测与色调映射,以及主要参数默认值和可选算法。
This skill converts video files to optimized GIF animations using FFmpeg two-pass palette optimization.
The two-pass conversion process generates superior quality GIFs compared to single-pass approaches. Pass one analyzes the video and creates an optimized color palette. Pass two applies that palette to produce the final GIF with better color fidelity and smaller file sizes.
After successful conversion, include a file link to the GIF in the response with the absolute file path:
/absolute/path/to/filename.gif
This allows the user to open the file and review it.
FFmpeg is required and must be available in your system PATH.
brew install ffmpeg
sudo apt update && sudo apt install ffmpeg
Using Chocolatey:
choco install ffmpeg
Using winget:
winget install FFmpeg.FFmpeg
Verify installation:
ffmpeg -version
Convert a video using default settings (10 FPS, 1280px width, sierra2_4a dithering):
scripts/convert.sh input.mp4
scripts/convert.ps1 -InputPath input.mp4
Output saves to input.gif by default.
When a filename is provided without a full path, the script searches in this order:
~/Movies/ (macOS) or ~/Videos/ (Linux)~/Downloads/~/Desktop/This allows natural commands like convert.sh demo.mov without specifying full paths.
The script automatically detects HDR video content via ffprobe by checking for BT.2020 color primaries or SMPTE 2084 transfer characteristics. When HDR is detected, tonemapping is applied automatically to produce SDR-compatible GIF output with proper color preservation.
Use --tonemap to select the tonemapping algorithm:
| Algorithm | Characteristics |
|---|---|
| hable | Filmic curve, good highlight rolloff (default) |
| reinhard | Preserves more color saturation |
| mobius | Similar to reinhard with better highlights |
| bt2390 | ITU standard, more conservative |
| Parameter | Flag (bash) | Flag (PowerShell) | Default | Description |
|---|---|---|---|---|
| Input file | --input | -InputPath | (required) | Source video file path |
| Output file | --output | -OutputPath | input.gif | Destination GIF file path |
| Frame rate | --fps | -Fps | 10 | Frames per second |
| Width | --width | -Width | 1280 | Output width in pixels |
| Dithering | --dither | -Dither | sierra2_4a | Dithering algorithm |
| Tonemapping | --tonemap | -Tonemap | hable | HDR tonemapping algorithm |
| Skip palette | --skip-palette | -SkipPalette | false | Use single-pass mode |
| Start time | --start | -Start | 0 | Start time in seconds |
| Duration | --duration | -Duration | (full video) | Duration to convert in seconds |
| Loop count | --loop | -Loop | 0 | GIF loop count (0 = infinite) |
FPS controls animation smoothness and file size. Lower values reduce file size but create choppier motion.
| FPS | Use Case |
|---|---|
| 5 | Simple animations, icons |
| 10 | General use (default) |
| 15 | Smooth motion, UI demos |
| 24 | Near-video quality |
…
这是一个用 FFmpeg 把视频转换成 GIF 的技能,核心是两遍调色板优化。它能在保持更好色彩的同时,尽量减小 GIF 体积。
需要系统中安装 FFmpeg,并且可在 PATH 中直接调用。文档给出了 macOS、Linux 和 Windows 的安装方式。
会。文档说明它会通过 ffprobe 检测 HDR,并在需要时自动进行色调映射。可用 `--tonemap` 选择算法。
为设计思维教练提供身份、流程与状态基线
帮助你写出更规范、可维护的 Python 代码
将设计思维成果整理为可交接的 RPI 输入与上下文
将回复压缩为极简风格,同时保留技术准确性
通过 Python CLI 自动读写 Mural 内容并管理小组件
从多视角审查代码变更,输出结构化问题与风险。
用 FFmpeg 将按顺序的画面和配音合成为讲解型 MP4 视频
根据文字描述生成适合 Slack 使用的动态 GIF 或表情动画。
帮助用户制作适配 Slack 的动画 GIF,并检查规格与动画效果。
从视频中提取关键帧或短片段,便于分析、剪辑与内容制作。
用命令行搜索并下载 GIF 素材,还可提取静帧与拼贴图。
帮助用户完成素材剪辑、结构编排、AI增强与成片润色的视频制作流程。