名称: 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"}]}}}
通过搜索对白并添加时轴字幕,从您的视频库中创建反应 GIF。
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(根据对白自动命名,保存到 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-after。include-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 等。--send - 将创建的 GIF 通过 iMessage 发送到配置的电话号码(仅限 macOS)。--send-to NUMBER - 发送到特定电话号码(覆盖配置)。注意: 所有 GIF 都会自动在右下角包含一个不显眼的 "gifhorse" 水印。
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"
gifhorse create "quote" 1 --width 720 --fps 24 --quality high -o tweet.gif
gifhorse create "memorable line" 1 --padding-after 3.0
gifhorse config --set-phone "+15551234567"
gifhorse create "quote" 1 --send
preview 命令在创建前验证时间点。gifhorse transcribe,字幕会自动获取。--padding-after 而非 --include-after。--context 2 以查看周围对白。--force 更新转录。subtitle-status 查看哪些视频需要字幕。激活虚拟环境:
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。
- 从数据库中移除视频。
- 检查其视频集合的字幕状态。
MIT