К основному содержанию
скилл CX Codex

video-to-gif · microsoft — скилл для Claude Code: что делает и как установить

Скилл video-to-gif конвертирует видеофайлы в оптимизированные GIF через двухпроходной алгоритм FFmpeg. Помогает подготовить чёткие анимации интерфейса или превью прямо из терминала.

MIT ★ 1 627 обновлён 2026-10-25

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add microsoft/hve-core --skill video-to-gif -a claude-code
Открыть на GitHub

Что делает video-to-gif

Скилл автоматизирует создание анимаций из видеофайлов с помощью скриптов scripts/convert.sh и scripts/convert.ps1. В основе лежит двухпроходной рендеринг через FFmpeg: сначала утилита рассчитывает оптимальную 256-цветную палитру под конкретный ролик, а вторым проходом собирает итоговую анимацию. По умолчанию скрипт устанавливает частоту 10 FPS, ширину 1280 пикселей и дизеринг sierra2_4a.

Инструмент умеет распознавать HDR-контент через ffprobe по профилям BT.2020 или SMPTE 2084, переводя картинку в SDR с алгоритмом тональной компрессии hable. Если полный путь к видео не передан, поиск автоматически идёт по текущей папке, корню проекта, каталогам Movies, Downloads и Desktop.

Без установленного в PATH бинарника FFmpeg скрипты не сработают. Таймаут выполнения команд ограничен 600 секундами, а путь сохранения файла не должен совпадать с исходным роликом.

Какие задачи решает

  • Сконвертировать запись экрана в GIF с двухпроходной палитрой
  • Преобразовать HDR-видео в формат SDR без потери насыщенности цветов
  • Вырезать нужный отрезок из скринкаста по таймкодам старта и длительности
  • Сжать видеоролик до заданного разрешения для документации или PR

Примеры запросов агенту

  • Сделай GIF из файла demo.mov с шириной 800 пикселей и частотой 15 кадров в секунду.
  • Сконвертируй первые 10 секунд видео screencast.mp4, начиная с 5-й секунды.
  • Преобразуй запись hdr_clip.mp4 в гифку с алгоритмом тональной компрессии reinhard.

Как установить video-to-gif

1Через Skills CLI (Vercel)

npx skills add microsoft/hve-core --skill video-to-gif -a claude-code

2Вручную: положить файлы

~/.claude/skills/video-to-gif/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/video-to-gif/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о video-to-gif

Как установить video-to-gif в Claude Code?

Выполните команду npx skills add microsoft/hve-core --skill video-to-gif -a claude-code.

Что делает скилл video-to-gif?

Запускает скрипты конвертации видео в GIF через двухпроходной режим FFmpeg. Первая фаза строит точную палитру цветов, а вторая собирает файл с нужным разрешением и дизерингом.

Что требуется настроить перед первым запуском?

В операционной системе должен быть установлен FFmpeg и добавлен в системный PATH. Без этой утилиты вызов скрипта завершится с ошибкой.

Исходный текст

SKILL.md · MIT
---
name: video-to-gif
description: 'Video-to-GIF conversion with FFmpeg two-pass optimization'
license: MIT
compatibility: 'Requires FFmpeg on PATH'
metadata:
  authors: "microsoft/hve-core"
  spec_version: "1.0"
  last_updated: "2026-09-27"
---

# 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:

```markdown
/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

```bash
brew install ffmpeg
```

### Linux (Debian/Ubuntu)

```bash
sudo apt update && sudo apt install ffmpeg
```

### Windows

Using Chocolatey:

```powershell
choco install ffmpeg
```

Using winget:

```powershell
winget install FFmpeg.FFmpeg
```

Verify installation:

```bash
ffmpeg -version
```

## Quick Start

Convert a video using default settings (10 FPS, 1280px width, sierra2_4a dithering):

```bash
scripts/convert.sh input.mp4
```

```powershell
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:

| 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:

```bash
# 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:

| 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:

```bash
# 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:

```bash
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)

```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)

```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:

```bash
scripts/convert.sh hdr-footage.mov
```

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

```bash
# 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:

```bash
# 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:

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

## Troubleshooting

### FFmpeg not found

Verify FFmpeg is in your PATH:

```bash
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:

```bash
# 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.

```bash
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.

© microsoft · MIT · microsoft/hve-core

Похожие скиллы

Все скиллы по теме «Автоматизация и no-code: n8n, Zapier, Make» →

Сначала — video-to-gif от других авторов.

video-to-gif zc277584121 Скилл video-to-gif делает из видео несколько GIF с разными настройками и складывает их в одну папку, чтобы вы глазами выбрали подходящий. CX Codex +1 3 900установок mermaid-to-gif zc277584121 Скилл mermaid-to-gif превращает Mermaid-диаграммы из .mmd и .md в анимированные GIF с четырьмя стилями анимации. CX Codex +1 3 900установок demo-video Alireza Rezvani Скилл demo-video превращает описания сцен и скриншоты в готовые демо-ролики или GIF с озвучкой и анимацией прямо в Claude Code. CX Codex +1 708установок anime-reaction-gif LIghtJUNction Плагин anime-reaction-gif для Claude Code и Codex генерирует анимационные реакции в формате GIF и MP4 из набора ключевых поз. Собирает姿势图 через встроенный image_gen, нарезает кадры и склеивает цикл через FFmpeg. CX Codex ★ 1 596звёзд репо media-toolkit dkyazzentwatwa Скилл media-toolkit для Claude Code обрезает, конвертирует и анализирует аудио и видео Python-скриптами. Обрабатывает субтитры, тайм-лапс, GIF и пакетные операции. CX Codex +1 184установок video-transcript-downloader steipete Скилл video-transcript-downloader для Claude Code и Codex: достаёт транскрипт из видео одной командой и скачивает видео, аудио или субтитры через yt-dlp. Доклад читается быстрее, чем смотрится. CX Codex +1 1 100установок convert-video Samarth Gupta Скилл convert-video обрабатывает видео через FFmpeg по текстовым запросам: меняет контейнеры, обрезает хронометраж, ускоряет дорожки и масштабирует кадр. CX Codex +1 ★ 276звёзд репо

Из того же набора148

Весь набор →
Accessibility Reviewer Субагент Accessibility Reviewer для Claude Code профилирует репозиторий, проверяет доступность по WCAG 2.2 и ARIA APG, перепроверяет находки и составляет отчёт. CX Codex +1 ★ 1 627звёзд репо rpi-plan-critique Скилл rpi-plan-critique проводит независимую оценку плана реализации RPI без его изменения. Помогает проверить реализуемость задач и согласовать замечания перед стартом работы. CX Codex +1 ★ 1 627звёзд репо DT Learning Tutor Субагент DT Learning Tutor ведёт курс по Design Thinking: девять методов, проверки понимания после каждого модуля, темп под уровень ученика. CX Codex +1 ★ 1 627звёзд репо experiment-design Скилл experiment-design для Claude Code помогает превращать неизвестность в проверяемые гипотезы и отсеивать непроверяемые идеи, чтобы получить результат для принятия решения. CX Codex +1 ★ 1 627звёзд репо powershell Правило задаёт соглашения для скриптов, модулей и файлов данных PowerShell. Claude Code применяет их к файлам .ps1, .psm1 и .psd1. CX Codex +1 ★ 1 627звёзд репо PowerPoint Subagent Субагент PowerPoint Subagent для Claude Code извлекает содержимое презентаций, создаёт слайды по YAML-схеме, собирает колоды и проверяет их качество. Автоматизирует создание презентаций. CX Codex +1 ★ 1 627звёзд репо hve-slides Скилл hve-slides помогает создавать, обновлять и проверять интерактивные HTML-презентации в проекте HVE Core с поддержкой клавиатуры и режима докладчика. CX Codex +1 ★ 1 627звёзд репо licensing-posture Правило licensing-posture задаёт, как оформлять цитаты, пересказ и атрибуцию сторонних стандартов. Оно пригодится при работе с файлами в skills и .copilot-tracking. CX Codex +1 ★ 1 627звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой