OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  gifhorse:搜索视频对话并创建带同步字幕的反应类 GIF

gifhorse:搜索视频对话并创建带同步字幕的反应类 GIF

 
  oracle ·  2026-02-16 21:30:58 · 3 次点击  · 0 条评论  

名称: gifhorse
描述: 搜索视频对白并创建带有时轴字幕的反应 GIF。非常适合从电影和电视剧中制作适合制作表情包的片段。
主页: https://github.com/Coyote-git/gifhorse
元数据: {"clawdbot":{"emoji":"🐴","requires":{"bins":["gifhorse","ffmpeg"]},"install":[{"id":"gifhorse-setup","kind":"shell","command":"git clone https://github.com/Coyote-git/gifhorse.git ~/gifhorse && cd ~/gifhorse && python3 -m venv venv && source venv/bin/activate && pip install -e .","bins":["gifhorse"],"label":"安装 gifhorse CLI 工具"},{"id":"ffmpeg-full","kind":"shell","command":"brew install ffmpeg-full","bins":["ffmpeg"],"label":"安装 FFmpeg-full (macOS)"}],"config":{"examples":[{"GIFHORSE_DB":"~/gifhorse/transcriptions.db"}]}}}


GifHorse - 对白搜索与 GIF 制作器

通过搜索对白并添加时轴字幕,从您的视频库中创建反应 GIF。

GifHorse 的功能

  1. 转录视频 - 通过下载字幕、使用本地 .srt 文件或 Whisper AI 来提取带时间戳的对白。
  2. 搜索对白 - 即时在整个视频库中查找台词。
  3. 预览片段 - 在创建 GIF 前,精确查看将要捕获的内容。
  4. 创建 GIF - 生成带有精确时轴字幕和可选水印的 GIF。

安装设置

首次设置

  1. 安装 gifhorse(通过上方的安装按钮)。
  2. 安装 FFmpeg-full 用于字幕渲染(通过上方的安装按钮)。
  3. 转录您的视频库(自动下载字幕):
cd ~/gifhorse && source venv/bin/activate
gifhorse transcribe ~/Movies

gifhorse 命令必须在虚拟环境中运行。您可以通过以下方式激活它:

cd ~/gifhorse && source venv/bin/activate

或者使用激活助手脚本:

source ~/gifhorse/activate.sh

可用命令

转录视频

从视频中提取对白(每个视频只需执行一次):

# 默认:从在线提供商下载字幕(快速,推荐)
gifhorse transcribe /path/to/videos

# 仅使用本地 .srt 文件(不下载,不使用 Whisper)
gifhorse transcribe /path/to/videos --use-subtitles

# 使用 Whisper AI(速度慢,但适用于任何视频)
gifhorse transcribe /path/to/video.mp4 --use-whisper

# 重新转录数据库中已有的视频
gifhorse transcribe /path/to/videos --force

仅下载字幕

下载 .srt 文件但不存入数据库:

gifhorse fetch-subtitles /path/to/videos
gifhorse fetch-subtitles /path/to/videos --skip-existing

搜索对白

在整个库中查找台词:

# 基础搜索
gifhorse search "memorable quote"

# 搜索包含前后文
gifhorse search "memorable quote" --context 2

# 显示所有结果(无限制)
gifhorse search "memorable quote" --all

# 自定义结果限制(默认:100)
gifhorse search "memorable quote" --limit 50

创建前预览

精确查看将要捕获的内容:

gifhorse preview "memorable quote" 1
gifhorse preview "quote" 1 --include-before 1 --include-after 1

创建 GIF

生成带字幕的 GIF:

# 基础 GIF(根据对白自动命名,保存到 exports/)
gifhorse create "memorable quote" 1

# 指定输出路径
gifhorse create "memorable quote" 1 -o reaction.gif

# 社交媒体高质量
gifhorse create "quote" 1 --width 720 --fps 24 --quality high

# 包含对话上下文
gifhorse create "quote" 1 --include-before 2 --include-after 1

# 替换字幕中的词语(可重复,通过预览中的编号定位片段)
gifhorse create "the age of men" 1 --include-after 1 \
  -s 1 "men" "standardized software" \
  -s 2 "orc" "custom applications"

# 干净替换(无删除线)
gifhorse create "quote" 1 -r 1 "old word" "new word"

# 创建并通过 iMessage 发送
gifhorse create "quote" 1 --send
gifhorse create "quote" 1 --send-to "+15551234567"

管理数据库

# 按路径模式移除视频(SQL LIKE 通配符)
gifhorse remove "%Adventure Time%"
gifhorse remove "%S01%" --yes

# 检查目录的字幕状态
gifhorse subtitle-status ~/Videos
gifhorse subtitle-status ~/Videos --missing-only

检查状态

# 查看转录统计信息
gifhorse stats

# 列出所有已转录的视频
gifhorse list

配置

# 设置用于 iMessage 发送的电话号码
gifhorse config --set-phone "+15551234567"

# 显示当前配置
gifhorse config --show

时间控制选项

精确控制捕获内容:

  • --include-before N - 包含匹配项之前的 N 个对白片段。
  • --include-after N - 包含匹配项之后的 N 个对白片段。
  • --padding-before SECS - 在对白开始前添加缓冲秒数(默认:1.0)。
  • --padding-after SECS - 在对白结束后添加缓冲秒数(默认:1.0)。
  • --start-offset SECS - 手动调整开始时间(可为负值)。
  • --end-offset SECS - 手动调整结束时间(可为负值)。

重要提示: 对于对白后的反应镜头,请使用 --padding-after 而不是 --include-afterinclude-after 选项会捕获直到下一个对白片段的所有时间(可能长达 30 秒以上!)。

质量选项

  • --quality low|medium|high - 调色板质量(影响文件大小)。
  • --fps N - 每秒帧数(默认:15,使用 24 以获得更流畅效果)。
  • --width N - 像素宽度(默认:480,使用 720 以获得高清效果)。

字幕选项

  • -s, --sub NUM OLD NEW - 替换片段中的词语(可重复)。被替换的词语会以红色删除线显示,替换词以红色显示。片段编号由 preview 命令显示。
  • -r, --replace NUM OLD NEW - 干净地替换词语(无删除线)。可重复。
  • --no-subtitles - 创建不带字幕叠加的 GIF。

输出

  • 默认输出文件名根据对白文本自动生成(例如 i_dont_think_so.gif)并保存到 exports/ 目录。
  • 使用 -o PATH 来覆盖。文件名冲突时会自动追加 _2_3 等。

iMessage 功能

  • --send - 将创建的 GIF 通过 iMessage 发送到配置的电话号码(仅限 macOS)。
  • --send-to NUMBER - 发送到特定电话号码(覆盖配置)。

注意: 所有 GIF 都会自动在右下角包含一个不显眼的 "gifhorse" 水印。

常用工作流

快速制作反应 GIF

gifhorse search "perfect"
gifhorse create "perfect" 1 --padding-after 2.0

完整对话交流

gifhorse search "key phrase"
gifhorse preview "key phrase" 1 --include-before 2 --include-after 1
gifhorse create "key phrase" 1 --include-before 2 --include-after 1

词语替换表情包

gifhorse preview "the age of men" 1 --include-after 1
gifhorse create "the age of men" 1 --include-after 1 \
  -s 1 "men" "standardized software" \
  -s 2 "orc" "custom applications"

用于 Twitter/X 的高质量 GIF

gifhorse create "quote" 1 --width 720 --fps 24 --quality high -o tweet.gif

包含对白后反应的场景

gifhorse create "memorable line" 1 --padding-after 3.0

创建并通过 iMessage 发送

gifhorse config --set-phone "+15551234567"
gifhorse create "quote" 1 --send

技巧与提示

  1. 始终先预览 - 使用 preview 命令在创建前验证时间点。
  2. 默认下载字幕 - 只需运行 gifhorse transcribe,字幕会自动获取。
  3. 注意文件大小 - 高质量 + 长时长 = 大文件(20 秒可能超过 20 MB)。
  4. 填充 vs 包含 - 对于反应镜头,使用 --padding-after 而非 --include-after
  5. 带上下文搜索 - 添加 --context 2 以查看周围对白。
  6. 使用 --force 重新转录 - 在获得更好的字幕后,使用 --force 更新转录。
  7. 检查字幕覆盖率 - 使用 subtitle-status 查看哪些视频需要字幕。

文件大小指南

  • 低质量,10秒,360p: ~1-2 MB
  • 中等质量,10秒,480p: ~3-5 MB
  • 高质量,20秒,720p: ~20+ MB

故障排除

"command not found: gifhorse"

激活虚拟环境:

cd ~/gifhorse && source venv/bin/activate

字幕渲染错误

确保已安装 FFmpeg-full:

brew install ffmpeg-full

找不到视频文件

数据库存储的是绝对路径。如果在转录后移动了视频,请在新位置重新转录。

网络共享支持

GifHorse 适用于网络挂载的视频:

# 挂载网络共享(macOS)
open "smb://server-ip/share-name"

# 从网络转录
gifhorse transcribe "/Volumes/server-ip/Movies"

何时使用此技能

当用户想要以下操作时,可以调用 gifhorse:
- 在其视频库中搜索对白或台词。
- 从电影或电视剧中创建反应 GIF。
- 制作带有替换词语的表情包 GIF。
- 为视频片段添加字幕。
- 转录视频以获得可搜索的对白。
- 在创建前预览 GIF 效果。
- 通过 iMessage 发送 GIF。
- 从数据库中移除视频。
- 检查其视频集合的字幕状态。

了解更多

  • GitHub: https://github.com/Coyote-git/gifhorse
  • 使用指南: https://github.com/Coyote-git/gifhorse/blob/main/USAGE_GUIDE.md
  • 路线图: https://github.com/Coyote-git/gifhorse/blob/main/ROADMAP.md

许可证

MIT

3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor