ClawSkills logoClawSkills

GifHorse

搜索视频对话并创建带有时轴字幕的反应 GIF。非常适合从电影和电视节目中制作适合做成梗的片段。

介绍

# GifHorse - Dialogue Search & GIF Creator

通过搜索对话并添加定时字幕,从您的视频库中制作表情 GIF。

## GifHorse 的功能

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

## 设置

### 首次设置

1. 安装 gifhorse(通过上方的安装按钮) 2. 安装 FFmpeg-full 以渲染字幕(通过上方的安装按钮) 3. 转录您的视频库(自动下载字幕):

```bash cd ~/gifhorse && source venv/bin/activate gifhorse transcribe ~/Movies ```

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

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

或使用激活助手:

```bash source ~/gifhorse/activate.sh ```

## 可用命令

### 转录视频

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

```bash # Default: downloads subtitles from online providers (fast, recommended) gifhorse transcribe /path/to/videos

# Use only local .srt files (no downloading, no Whisper) gifhorse transcribe /path/to/videos --use-subtitles

# Use Whisper AI (slow but works for any video) gifhorse transcribe /path/to/video.mp4 --use-whisper

# Re-transcribe videos already in database gifhorse transcribe /path/to/videos --force ```

### 仅下载字幕

下载 .srt 文件而不存储到数据库中:

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

### 搜索对话

在整个库中查找台词:

```bash # Basic search gifhorse search "memorable quote"

# Search with surrounding context gifhorse search "memorable quote" --context 2

# Show all results (no limit) gifhorse search "memorable quote" --all

# Custom result limit (default: 100) gifhorse search "memorable quote" --limit 50 ```

### 创建前预览

确切查看将被捕获的内容:

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

### 创建 GIF

生成带字幕的 GIF:

```bash # Basic GIF (auto-named from dialogue, saved to exports/) gifhorse create "memorable quote" 1

# Explicit output path gifhorse create "memorable quote" 1 -o reaction.gif

# High quality for social media gifhorse create "quote" 1 --width 720 --fps 24 --quality high

# Include conversation context gifhorse create "quote" 1 --include-before 2 --include-after 1

# Substitute words in subtitles (repeatable, target segments by number from preview) gifhorse create "the age of men" 1 --include-after 1 \ -s 1 "men" "standardized software" \ -s 2 "orc" "custom applications"

# Clean replace (no strikethrough) gifhorse create "quote" 1 -r 1 "old word" "new word"

# Create and send via iMessage gifhorse create "quote" 1 --send gifhorse create "quote" 1 --send-to "+15551234567" ```

### 管理数据库

```bash # Remove videos by path pattern (SQL LIKE wildcards) gifhorse remove "%Adventure Time%" gifhorse remove "%S01%" --yes

# Check subtitle status for a directory gifhorse subtitle-status ~/Videos gifhorse subtitle-status ~/Videos --missing-only ```

### 检查状态

```bash # See transcription stats gifhorse stats

# List all transcribed videos gifhorse list ```

### 配置

```bash # Set phone number for iMessage sending gifhorse config --set-phone "+15551234567"

# Show current configuration 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` 等。

## iMessage

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

**注意:** 所有 GIF 都会自动在右下角包含一个微妙的“gifhorse”水印。

## 常见工作流程

### 快速反应 GIF

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

### 完整对话交流

```bash 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 ```

### 替换文字的梗图

```bash 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 的高质量版本

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

### 带有对话后反应的场景

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

### 创建并通过 iMessage 发送

```bash 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”

激活虚拟环境:

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

### 字幕渲染错误

确保已安装 FFmpeg-full:

```bash brew install ffmpeg-full ```

### 找不到视频文件

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

## 网络共享支持

GifHorse 支持网络挂载的视频:

```bash # Mount network share (macOS) open "smb://server-ip/share-name"

# Transcribe from network 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

更多产品