SuperAPI AI 工具集

gifgrep

设计与创作

查看项目

更新于 10-16 04:31

技能介绍

用途:通过 GIPHY 与 Tenor 的 API 搜索 GIF,下载结果,并借助 ffmpeg 提取单帧或拼合多帧缩略图。

主要能力:搜索 GIPHY(api.giphy.com 的 /v1/gifs/search)与 Tenor(tenor.googleapis.com 的 /v2/search);下载指定 GIF URL;从 GIF 提取第一帧、指定时间点的单帧,或按帧率、缩放与网格生成 contact sheet。

必要用法:先获取密钥,GIPHY 在 https://developers.giphy.com/dashboard/,Tenor 在 https://tenor.com/gifapi。配置环境变量: export GIPHY_API_KEY="your-giphy-key" export TENOR_API_KEY="your-tenor-key" Tenor 密钥可选,未设置时使用演示密钥。搜索示例: curl "https://api.giphy.com/v1/gifs/search?api_key=${GIPHY_API_KEY}&q=hello&limit=5" | jq '.data[].images.original.url' curl "https://tenor.googleapis.com/v2/search?key=${TENOR_API_KEY}&q=hello&limit=5" | jq '.results[].media_formats.gif.url' 下载:curl -O "https://media.giphy.com/media/xxx/giphy.gif" 提取首帧:ffmpeg -i animation.gif -vf "select=eq(n,0)" -vsync vfr still.png 按时间取帧:ffmpeg -i animation.gif -ss 1.5 -frames:v 1 still.png 生成拼图:ffmpeg -i animation.gif -vf "fps=5,scale=100:-1,tile=3x3" sheet.png

适用场景:需要批量收集 GIF 素材、从动图抽取表情或封面帧、制作帧预览图的流程。

限制:需自行申请并配置 API 密钥;搜索受各平台接口配额与内容分级参数(如 &rating=g)约束;ffmpeg 需本地已安装;下载与缓存策略由使用者自行处理,资料未提供具体缓存实现、收费与平台支持信息。