Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

video-to-gif视频转 gif

Agent Skill

用于辅助视频生成、动画合成、脚本化剪辑或 Remotion 等视频项目开发。它适合让 Agent 组织镜头、生成素材说明、维护合成代码或排查渲染问题。使用时需要确认分辨率、时长、素材路径和导出格式;涉及外部素材、人物肖像或商业发布时,应先核对版权授权和内容审核要求。

总安装

238

周安装

10

GitHub Stars

1,003

下载量

83
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:video-to-gif(视频转 gif)
来源仓库:https://github.com/microsoft/hve-core
仓库路径:skills/video-to-gif
安装命令:
npx skills add https://github.com/microsoft/hve-core --skill video-to-gif
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/microsoft/hve-core --skill video-to-gif

简介

用于辅助视频生成、动画合成或 Remotion 项目开发。

  • 适合组织镜头、生成素材说明或排查渲染问题。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 使用时需确认分辨率、时长和素材路径,涉及版权内容应先核对授权。
  • video-to-gif 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Video-to-GIF Conversion Skill

This skill converts video files to optimized GIF animations using FFmpeg two-pass palette optimization.

Overview

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.

Response Format

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.

Prerequisites

FFmpeg is required and must be available in your system PATH.

macOS

brew install ffmpeg

Linux (Debian/Ubuntu)

sudo apt update && sudo apt install ffmpeg

Windows

Using Chocolatey:

choco install ffmpeg

Using winget:

winget install FFmpeg.FFmpeg

Verify installation:

ffmpeg -version

Quick Start

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.

File Search Behavior

When a filename is provided without a full path, the script searches in this order:

  1. Current working directory
  2. Workspace root (if inside a project)
  3. ~/Movies/ (macOS) or ~/Videos/ (Linux)
  4. ~/Downloads/
  5. ~/Desktop/

This allows natural commands like convert.sh demo.mov without specifying full paths.

HDR Handling

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:

AlgorithmCharacteristics
hableFilmic curve, good highlight rolloff (default)
reinhardPreserves more color saturation
mobiusSimilar to reinhard with better highlights
bt2390ITU standard, more conservative

Parameters Reference

ParameterFlag (bash)Flag (PowerShell)DefaultDescription
Input file--input-InputPath(required)Source video file path
Output file--output-OutputPathinput.gifDestination GIF file path
Frame rate--fps-Fps10Frames per second
Width--width-Width1280Output width in pixels
Dithering--dither-Dithersierra2_4aDithering algorithm
Tonemapping--tonemap-TonemaphableHDR tonemapping algorithm
Skip palette--skip-palette-SkipPalettefalseUse single-pass mode
Start time--start-Start0Start time in seconds
Duration--duration-Duration(full video)Duration to convert in seconds
Loop count--loop-Loop0GIF loop count (0 = infinite)

Frame Rate (FPS)

FPS controls animation smoothness and file size. Lower values reduce file size but create choppier motion.

FPSUse Case
5Simple animations, icons
10General use (default)
15Smooth motion, UI demos
24Near-video quality

Width

Width sets the output horizontal resolution in pixels. Height scales proportionally to maintain aspect ratio.

WidthUse Case
320Thumbnails, previews
640Documentation
800Presentations
1280High detail (default)

Dithering Algorithms

Dithering determines how the 256-color GIF palette approximates the original colors.

AlgorithmQualitySpeedBest For
sierra2_4aHighMediumGeneral use (default)
floyd_steinbergHighSlowPhotographic content
bayerMediumFastGraphics with solid colors
noneLowFastestStylized/posterized look

Time Range Selection

Use --start and --duration to convert a specific portion of the video:

# Start at 5 seconds, convert 10 seconds
scripts/convert.sh --input video.mp4 --start 5 --duration 10

Loop Control

Use --loop to control GIF repeat behavior:

ValueBehavior
0Loop forever
1Play once
NPlay N times

Two-Pass vs Single-Pass

Two-Pass (Default)

Two-pass conversion creates a custom palette from the source video, then applies it:

# Pass 1: Generate palette
ffmpeg -i input.mp4 \
  -vf "fps=10,scale=1280:-1:flags=lanczos,palettegen=stats_mode=diff" \
  -y /tmp/palette.png

# Pass 2: Create GIF
ffmpeg -i input.mp4 -i /tmp/palette.png \
  -filter_complex "fps=10,scale=1280:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=sierra2_4a:diff_mode=rectangle" \
  -loop 0 -y output.gif

Two-pass produces better color accuracy and typically smaller files.

Single-Pass

Single-pass skips palette generation and uses FFmpeg's default 256-color palette:

ffmpeg -i input.mp4 \
  -vf "fps=10,scale=1280:-1:flags=lanczos" \
  -loop 0 -y output.gif

Single-pass processes faster but produces lower quality output with potential color banding.

Use single-pass via --skip-palette (bash) or -SkipPalette (PowerShell).

Script Reference

convert.sh (Bash)

# Basic usage
scripts/convert.sh video.mp4

# Custom output path
scripts/convert.sh --input video.mp4 --output demo.gif

# Adjust quality parameters
scripts/convert.sh --input video.mp4 --fps 15 --width 640 --dither floyd_steinberg

# HDR video with custom tonemapping
scripts/convert.sh --input hdr-video.mov --tonemap reinhard

# Extract a 10-second clip starting at 5 seconds
scripts/convert.sh --input video.mp4 --start 5 --duration 10

# Create a GIF that plays only once
scripts/convert.sh --input video.mp4 --loop 1

# Fast single-pass mode
scripts/convert.sh --input video.mp4 --skip-palette

convert.ps1 (PowerShell)

# Basic usage
scripts/convert.ps1 -InputPath video.mp4

# Custom output path
scripts/convert.ps1 -InputPath video.mp4 -OutputPath demo.gif

# Adjust quality parameters
scripts/convert.ps1 -InputPath video.mp4 -Fps 15 -Width 640 -Dither floyd_steinberg

# HDR video with custom tonemapping
scripts/convert.ps1 -InputPath hdr-video.mov -Tonemap reinhard

# Extract a 10-second clip starting at 5 seconds
scripts/convert.ps1 -InputPath video.mp4 -Start 5 -Duration 10

# Create a GIF that plays only once
scripts/convert.ps1 -InputPath video.mp4 -Loop 1

# Fast single-pass mode
scripts/convert.ps1 -InputPath video.mp4 -SkipPalette

Examples

HDR Video Conversion

HDR content is detected automatically. No special flags are needed:

scripts/convert.sh hdr-footage.mov

The script applies hable tonemapping by default. Use --tonemap to try different algorithms:

# Use reinhard for more saturated colors
scripts/convert.sh --input hdr-footage.mov --tonemap reinhard

Time Range Extraction

Extract a specific segment from a longer video:

# Convert seconds 30-45 of a screencast
scripts/convert.sh --input screencast.mp4 --start 30 --duration 15 --fps 15

Documentation Thumbnails

Create compact thumbnails for documentation:

scripts/convert.sh --input demo.mp4 --width 320 --fps 8

Troubleshooting

FFmpeg not found

Verify FFmpeg is in your PATH:

which ffmpeg  # macOS/Linux
where.exe ffmpeg  # Windows

If FFmpeg is installed but not found, add its directory to your PATH environment variable.

File not found

Ensure the file exists at the specified path. If providing only a filename, the script searches the workspace first, then common directories (~/Movies/, ~/Downloads/, ~/Desktop/). Use an absolute path if the file is in a different location.

Output file is too large

Reduce file size with these adjustments:

  • Lower FPS (try 8 or 5)
  • Reduce width (try 640 or 320)
  • Use bayer dithering for faster processing
  • Use --duration to convert only a portion of the video

Colors appear washed out

Switch to floyd_steinberg dithering for photographic content. Avoid none dithering unless a stylized look is intended.

HDR content looks wrong

Ensure FFmpeg 4.0+ is installed with zscale filter support. The script requires libzimg for HDR tonemapping. Install via:

# macOS
brew install zimg
brew reinstall ffmpeg

# Ubuntu
sudo apt install libzimg-dev

If colors still appear off, try a different tonemapping algorithm with --tonemap. The reinhard algorithm preserves more saturation, while bt2390 provides more conservative results.

Conversion fails with filter error

Ensure FFmpeg version 4.0 or later is installed. The palettegen and paletteuse filters require this version.

ffmpeg -version

Temporary palette file remains

The scripts clean up /tmp/palette.png (or $env:TEMP\palette.png on Windows) automatically. If conversion fails mid-process, remove this file manually.

*🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.*

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.41%
按下载量换算27

Claude

30.37%
按下载量换算25

Cursor

18.8%
按下载量换算16

Gemini CLI

9.48%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills