从视频片段裁剪缩放变速以制作GIF动态表情
npx skills add https://github.com/cafe3310/public-agent-skills --skill gemini-omni-video-to-sticker-gif
此技能专门用于将任意视频(如 MP4)转换为高品质的 GIF 动态表情包。在制作微信表情包等场景下,它提供了从“坐标校准”到“动图生成”的完整工作流。支持在截图中绘制红黄相间的像素坐标刻度(精确到 50px),帮助用户精确确定裁剪范围。
关键词: 视频转GIF, 微信表情包, 坐标定位, GIF加速, 帧定格, ffmpeg
gemini-omni-video-to-sticker-gif/
├── SKILL.md
└── scripts/
└── video_to_gif.py # 核心处理脚本
脚本 video_to_gif.py 接收以下参数:
video_path (位置参数): 输入视频文件的绝对路径。-o, --output: 输出 file 路径。如果是 --grid 模式,输出为 PNG 预览图;否则输出为 GIF 动图。--ss: 截取起始时间(例如 2.5,单位为秒,默认为 0.0)。-t, --duration: 截取的时长(例如 3.5,单位为秒)。--to: 截取的结束时间(例如 6.0,单位为秒)。如果提供了 --to,会自动计算时长 duration = to - ss。--crop: 裁剪区域。支持以下两种格式:w:h:x:y (FFmpeg 标准格式,如 700:700:292:10)x,y,w,h (如 292,10,700,700 或 xy292x10 wh700x700 格式)--scale: 输出尺寸(例如 600:600,默认为 600:600)。--speed: 播放速度倍数(例如 1.5,默认为 1.0,大于 1.0 为加速,小于 1.0 为减速)。--freeze: 最后一帧定格时长(例如 0.4,单位为秒,默认为 0.0,即不定格)。--grid: 启用网格模式。开启后不会生成 GIF,而是提取 --ss 时间点的一帧,并在其上叠加像素坐标刻度(红线代表 100px,黄虚线代表 50px),用于精确定位。如果您不确定坐标,先生成一张带有坐标网格 of 预览帧(第 2.0s 处):
python3 <path_to_skill>/scripts/video_to_gif.py /path/to/video.mp4 --ss 2.0 --grid -o /path/to/preview_grid.png
根据预览图确定的坐标 x=352, y=39, w=630, h=630,截取 2.5s - 6.0s 视频段,制作 1.5 倍速表情包:
python3 <path_to_skill>/scripts/video_to_gif.py /path/to/video.mp4 --ss 2.5 --to 6.0 --crop 630:630:352:39 --speed 1.5 -o /path/to/output.gif
python3 <path_to_skill>/scripts/video_to_gif.py /path/to/video.mp4 --ss 2.2 --to 6.2 --crop 700:700:319:10 --speed 1.2 --freeze 0.4 -o /path/to/output_freeze.gif
ffmpeg 和 ffprobe,并已加入环境变量。x + w 或 y + h 不能超出视频原始的分辨率,否则 ffmpeg 会报错。可以使用 ffprobe 先查看视频原始分辨率,或直接参考生成的 --grid 图像的边缘刻度。Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Improves the quality of images, especially screenshots, by enhancing resolution, sharpness, and clarity. Perfect for preparing images for presentations, documentation, or social media posts.
Downloads videos from YouTube and other platforms for offline viewing, editing, or archival. Handles various formats and quality options.
Lightweight WSI tile extraction and preprocessing. Use for basic slide processing tissue detection, tile extraction, stain normalization for H&E images. Best for simple pipelines, dataset preparation, quick tile-based analysis. For advanced spatial proteomics, multiplexed imaging, or deep learning pipelines use pathml.
Microscopy data management platform. Access images via Python, retrieve datasets, analyze pixels, manage ROIs/annotations, batch processing, for high-content screening and microscopy workflows.
Python library for working with DICOM (Digital Imaging and Communications in Medicine) files. Use this skill when reading, writing, or modifying medical imaging data in DICOM format, extracting pixel data from medical images (CT, MRI, X-ray, ultrasound), anonymizing DICOM files, working with DICOM metadata and tags, converting DICOM images to other formats, handling compressed DICOM data, or processing medical imaging datasets. Applies to tasks involving medical image analysis, PACS systems, radiology workflows, and healthcare imaging applications.
This skill should be used when working with pre-trained transformer models for natural language processing, computer vision, audio, or multimodal tasks. Use for text generation, classification, question answering, translation, summarization, image classification, object detection, speech recognition, and fine-tuning models on custom datasets.
Take cafe3310/gemini-omni-video-to-sticker-gif from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.