microsoft/hve-core/video-to-gif
Claude Code and agent skill by microsoft/hve-core
- vendor
Checking that the SKILL.md file is still in the repository.
Video-to-GIF conversion with FFmpeg two-pass optimization
Install
npx vskill@latest install microsoft/hve-core/video-to-gifSKILL.md
The same SKILL.md was published earlier as microsoft/hve-core/video-to-gif.
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:
This allows the user to open the file and review it.
Prerequisites
FFmpeg is required and must be available in your system PATH.
macOS
Linux (Debian/Ubuntu)
Windows
Using Chocolatey:
Using winget:
Verify installation:
Quick Start
Convert a video using default settings (10 FPS, 1280px width, sierra2_4a dithering):
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:
- Current working directory
- Workspace root (if inside a project)
~/Movies/(macOS) or~/Videos/(Linux)~/Downloads/~/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:
| 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 |
Parameters Reference
| 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) | |
| Timeout | VIDEO_TO_GIF_TIMEOUT (env) | -TimeoutSeconds | 600 | Seconds allowed for each ffprobe/ffmpeg run |
The output path must differ from the input path. Both scripts refuse to run when the output resolves to the input, which includes the default output for a .gif input, so pass an explicit output path in that case. An existing file at a different output path is overwritten.
Each ffprobe and ffmpeg invocation is stopped when it exceeds the timeout. When the HDR probe fails or times out, the input is treated as SDR and conversion continues.
Frame Rate (FPS)
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 |
Width
Width sets the output horizontal resolution in pixels. Height scales proportionally to maintain aspect ratio.
| Width | Use Case | |
|---|---|---|
| 320 | Thumbnails, previews | |
| 640 | Documentation | |
| 800 | Presentations | |
| 1280 | High detail (default) |
Dithering Algorithms
Dithering determines how the 256-color GIF palette approximates the original colors.
| Algorithm | Quality | Speed | Best For | |
|---|---|---|---|---|
| sierra2_4a | High | Medium | General use (default) | |
| floyd_steinberg | High | Slow | Photographic content | |
| bayer | Medium | Fast | Graphics with solid colors | |
| none | Low | Fastest | Stylized/posterized look |
Time Range Selection
Use --start and --duration to convert a specific portion of the video:
Loop Control
Use --loop to control GIF repeat behavior:
| Value | Behavior | |
|---|---|---|
| 0 | Loop forever | |
| 1 | Play once | |
| N | Play N times |
Two-Pass vs Single-Pass
Two-Pass (Default)
Two-pass conversion creates a custom palette from the source video, then applies it:
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:
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)
convert.ps1 (PowerShell)
Examples
HDR Video Conversion
HDR content is detected automatically. No special flags are needed:
The script applies hable tonemapping by default. Use --tonemap to try different algorithms:
Time Range Extraction
Extract a specific segment from a longer video:
Documentation Thumbnails
Create compact thumbnails for documentation:
Troubleshooting
FFmpeg not found
Verify FFmpeg is in your PATH:
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
bayerdithering for faster processing - Use
--durationto 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:
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.
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.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 2 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/experimental/video-to-gif/SKILL.md
Popularity
- Repository stars
- 1,492
- Repository forks
- 318
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/hve-core/video-to-gif)