gif-generation

Post-process video files and generate optimized GIFs. Converts webm/mp4

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gif-generation" with this command: npx skills add athola/nm-scry-gif-generation

Night Market Skill — ported from claude-night-market/scry. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Table of Contents

GIF Generation Skill

Post-process video files (webm/mp4) and generate optimized GIF output with configurable quality settings.

When To Use

  • Converting recordings to animated GIF format
  • Creating lightweight demo animations

When NOT To Use

  • High-quality video output - use full recording tools
  • Static image generation without animation needs

Overview

This skill handles the conversion of video recordings (typically from browser automation) to GIF format. It provides multiple quality presets and optimization options to balance file size with visual quality.

Required TodoWrite Items

- Validate input video file exists
- Check ffmpeg installation
- Execute GIF conversion
- Verify output and report results

Verification: Run the command with --help flag to verify availability.

Process

Step 1: Validate Input File

Confirm the source video file exists and is a supported format:

# Check file exists and get info
if [[ -f "$INPUT_FILE" ]]; then
    file "$INPUT_FILE"
    ffprobe -v quiet -show_format -show_streams "$INPUT_FILE" 2>/dev/null | head -20
else
    echo "Error: Input file not found: $INPUT_FILE"
    exit 1
fi

Verification: Run the command with --help flag to verify availability.

Supported input formats: .webm, .mp4, .mov, .avi

Step 2: Check ffmpeg Installation

Verify ffmpeg is available:

if ! command -v ffmpeg &> /dev/null; then
    echo "Error: ffmpeg is not installed"
    echo "Install with: sudo apt install ffmpeg (Linux) or brew install ffmpeg (macOS)"
    exit 1
fi
ffmpeg -version | head -1

Verification: Run the command with --help flag to verify availability.

Step 3: Execute Conversion

Choose the appropriate conversion command based on quality requirements:

Basic Conversion (Fast, Larger File)

ffmpeg -i input.webm -vf "fps=10,scale=800:-1" output.gif

Verification: Run the command with --help flag to verify availability.

High Quality with Palette Generation (Recommended)

ffmpeg -i input.webm -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif

Verification: Run the command with --help flag to verify availability.

Maximum Quality with Dithering

ffmpeg -i input.webm -vf "fps=15,scale=1024:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256:stats_mode=single[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5" output.gif

Verification: Run the command with --help flag to verify availability.

Optimization Options

OptionDescriptionRecommended Value
fpsFrames per second10-15 for smooth, 5-8 for smaller files
scaleWidth in pixels (-1 maintains aspect ratio)800 for web, 480 for thumbnails
flags=lanczosHigh-quality scaling algorithmAlways use for best quality
palettegenGenerate optimized color paletteUse for quality-critical output
ditherDithering algorithmbayer for patterns, floyd_steinberg for smooth

Common Presets

# Thumbnail (small, fast loading)
ffmpeg -i input.webm -vf "fps=8,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" thumbnail.gif

# Documentation (balanced)
ffmpeg -i input.webm -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" docs.gif

# High-fidelity demo
ffmpeg -i input.webm -vf "fps=15,scale=1024:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256[p];[s1][p]paletteuse" demo.gif

Verification: Run the command with --help flag to verify availability.

Step 4: Verify Output

Confirm successful conversion and report metrics:

if [[ -f "$OUTPUT_FILE" ]]; then
    echo "GIF generated successfully: $OUTPUT_FILE"

    # Report file size
    SIZE=$(du -h "$OUTPUT_FILE" | cut -f1)
    echo "File size: $SIZE"

    # Get dimensions and frame count
    ffprobe -v quiet -select_streams v:0 -show_entries stream=width,height,nb_frames -of csv=p=0 "$OUTPUT_FILE"
else
    echo "Error: GIF generation failed"
    exit 1
fi

Verification: Run the command with --help flag to verify availability.

Exit Criteria

  • Input file validated as existing video format
  • ffmpeg confirmed available
  • GIF file created at specified output path
  • Output file size reported to user
  • No ffmpeg errors during conversion

Troubleshooting

Large Output File

Reduce quality settings:

# Lower fps and resolution
ffmpeg -i input.webm -vf "fps=8,scale=640:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" smaller.gif

Verification: Run the command with --help flag to verify availability.

Color Banding

Use dithering:

ffmpeg -i input.webm -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse=dither=floyd_steinberg" smooth.gif

Verification: Run the command with --help flag to verify availability.

Slow Conversion

Use basic conversion without palette generation for speed:

ffmpeg -i input.webm -vf "fps=10,scale=800:-1" quick.gif

Verification: Run the command with --help flag to verify availability.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated