Skip to content

Reverse-engineer any video, shot by shot: filmed, AI-generated or coded, and how to remake it. Breakdowns in the open VIDEO.md format. 逆向一切视频,逐个镜头看是拍的、AI 生成的还是代码做的,再告诉你怎么复刻;拆解结果按 VIDEO.md 格式输出。

chore: 去掉重复安装的 opencv-python 并给依赖加上限;README 加手动安装;加 GitHub Actions 测试

june710d4c1b1ea2
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..6ed48f5
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,29 @@
+name: test
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+
+jobs:
+ pytest:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ python: ["3.10", "3.12"]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python }}
+ cache: pip
+ - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends ffmpeg
+ - name: install
+ run: |
+ python -m pip install -e ".[ocr,dev]"
+ # rapidocr 带进来的 opencv-python 和 headless 抢 cv2 目录,只留 headless
+ python -m pip uninstall -y opencv-python
+ python -m pip install --force-reinstall --no-deps "opencv-python-headless>=4.8,<5"
+ - run: python -m pytest -q
+ - run: python scripts/validate_capabilities.py --matrix
diff --git a/README.md b/README.md
index ee22df7..7cb1ffc 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,17 @@ Install https://github.com/JuneYaooo/rea-video, then break down this video: /pat
The agent installs the CLI, learns the workflow and runs the whole thing. You need ffmpeg and Python 3.10+.
+<details><summary>Install by hand</summary>
+
+```bash
+brew install ffmpeg # or: sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # installs the CLI (pip, or pipx / a local .venv if pip is blocked) and links the skill into ~/.claude, ~/.codex, ~/.agents
+rea-video --help
+```
+
+</details>
+
You get:
- a one-line summary, e.g. "41% AI video + 59% code UI, 8 s of real screen recording, library music at 122 BPM"
diff --git a/i18n/README_de.md b/i18n/README_de.md
index 260a391..e3ab9bf 100644
--- a/i18n/README_de.md
+++ b/i18n/README_de.md
@@ -52,6 +52,17 @@ Installiere https://github.com/JuneYaooo/rea-video und zerlege dann dieses Video
Der Agent installiert die CLI, lernt den Ablauf und führt alles aus. Du brauchst ffmpeg und Python 3.10+.
+<details><summary>Manuell installieren</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # installiert die CLI (pip, sonst pipx / lokales .venv) und verlinkt den Skill
+rea-video --help
+```
+
+</details>
+
Du bekommst:
- eine einzeilige Zusammenfassung, z. B. „41 % KI-Video + 59 % Code-UI, 8 s echte Bildschirmaufnahme, Archivmusik mit 122 BPM“
diff --git a/i18n/README_es.md b/i18n/README_es.md
index 117dbff..56d6b8d 100644
--- a/i18n/README_es.md
+++ b/i18n/README_es.md
@@ -52,6 +52,17 @@ Instala https://github.com/JuneYaooo/rea-video y luego analiza este vídeo: /pat
El agente instala la CLI, aprende el flujo de trabajo y lo ejecuta todo. Necesitas ffmpeg y Python 3.10+.
+<details><summary>Instalación manual</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # instala la CLI (pip, o pipx / .venv local) y enlaza el skill
+rea-video --help
+```
+
+</details>
+
Obtienes:
- un resumen de una línea, p. ej. "41 % vídeo con IA + 59 % UI en código, 8 s de grabación de pantalla real, música de biblioteca a 122 BPM"
diff --git a/i18n/README_fr.md b/i18n/README_fr.md
index 51e804b..cf5db71 100644
--- a/i18n/README_fr.md
+++ b/i18n/README_fr.md
@@ -52,6 +52,17 @@ Installe https://github.com/JuneYaooo/rea-video, puis décortique cette vidéo :
L'agent installe la CLI, apprend le processus et fait tout le travail. Il vous faut ffmpeg et Python 3.10+.
+<details><summary>Installation manuelle</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # installe la CLI (pip, sinon pipx / .venv local) et lie le skill
+rea-video --help
+```
+
+</details>
+
Vous obtenez :
- un résumé d'une ligne, par ex. « 41 % vidéo IA + 59 % interface en code, 8 s de vrai enregistrement d'écran, musique de bibliothèque à 122 BPM »
diff --git a/i18n/README_ja.md b/i18n/README_ja.md
index 102911f..e78989d 100644
--- a/i18n/README_ja.md
+++ b/i18n/README_ja.md
@@ -52,6 +52,17 @@ Install https://github.com/JuneYaooo/rea-video, then break down this video: /pat
エージェントが CLI をインストールし、ワークフローを学んで、すべてを実行します。ffmpeg と Python 3.10+ が必要です。
+<details><summary>手動でインストール</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # CLI をインストール(pip、だめなら pipx / ローカル .venv)し、skill をリンク
+rea-video --help
+```
+
+</details>
+
得られるもの:
- 1 行の要約。例:"41% AI video + 59% code UI, 8 s of real screen recording, library music at 122 BPM"
diff --git a/i18n/README_ko.md b/i18n/README_ko.md
index 882de67..d9aa3d6 100644
--- a/i18n/README_ko.md
+++ b/i18n/README_ko.md
@@ -52,6 +52,17 @@ https://github.com/JuneYaooo/rea-video 를 설치하고, 이 영상을 분석해
에이전트가 CLI를 설치하고, 워크플로를 익힌 뒤 전체 과정을 실행합니다. ffmpeg와 Python 3.10 이상이 필요합니다.
+<details><summary>직접 설치하기</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # CLI 설치(pip, 안 되면 pipx / 로컬 .venv) 후 skill 연결
+rea-video --help
+```
+
+</details>
+
결과물:
- 한 줄 요약. 예: "AI 영상 41% + 코드 UI 59%, 실제 화면 녹화 8초, 122 BPM 라이브러리 음악"
diff --git a/i18n/README_pt.md b/i18n/README_pt.md
index d012892..ae767e7 100644
--- a/i18n/README_pt.md
+++ b/i18n/README_pt.md
@@ -52,6 +52,17 @@ Instale https://github.com/JuneYaooo/rea-video e depois analise este vídeo: /pa
O agente instala a CLI, aprende o fluxo de trabalho e executa tudo. Você precisa de ffmpeg e Python 3.10+.
+<details><summary>Instalação manual</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # instala a CLI (pip, ou pipx / .venv local) e liga o skill
+rea-video --help
+```
+
+</details>
+
Você recebe:
- um resumo de uma linha, por exemplo "41% vídeo de IA + 59% interface em código, 8 s de gravação de tela real, música de biblioteca a 122 BPM"
diff --git a/i18n/README_ru.md b/i18n/README_ru.md
index 60173b4..c2440e8 100644
--- a/i18n/README_ru.md
+++ b/i18n/README_ru.md
@@ -52,6 +52,17 @@ rea-video создан для ИИ-агентов. В Claude Code, Codex или
Агент установит CLI, изучит порядок работы и проведёт весь процесс. Нужны ffmpeg и Python 3.10+.
+<details><summary>Установка вручную</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # ставит CLI (pip, иначе pipx / локальный .venv) и подключает skill
+rea-video --help
+```
+
+</details>
+
Вы получите:
- итог в одну строку, например: «41% ИИ-видео + 59% интерфейс на коде, 8 с настоящей записи экрана, библиотечная музыка 122 BPM»
diff --git a/i18n/README_zh.md b/i18n/README_zh.md
index 79729ac..eb5082b 100644
--- a/i18n/README_zh.md
+++ b/i18n/README_zh.md
@@ -50,6 +50,17 @@ rea-video 是给 AI 助手用的。在 Claude Code、Codex 这类能运行命令
agent 会自己装好命令行工具、读完拆解流程,然后从头跑完。电脑上需要有 ffmpeg 和 Python 3.10 以上。
+<details><summary>手动安装</summary>
+
+```bash
+brew install ffmpeg # sudo apt install ffmpeg
+git clone https://github.com/JuneYaooo/rea-video && cd rea-video
+bash scripts/install_skill.sh # 装命令行工具(pip 不让装时改用 pipx 或仓库内 .venv),并把 skill 链接到各 agent 目录
+rea-video --help
+```
+
+</details>
+
跑完你会拿到:
- 一句话结论,比如「AI 视频 41% + 代码界面 59%,有 8 秒真实录屏,曲库配乐 122 BPM」
diff --git a/pyproject.toml b/pyproject.toml
index 8107554..ec913d0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,15 +10,17 @@ readme = "README.md"
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
dependencies = [
- "numpy>=1.24",
- "opencv-python-headless>=4.8",
+ "numpy>=1.24,<3",
+ "opencv-python-headless>=4.8,<5",
"Pillow>=9.0",
"PyYAML>=6.0",
"onnxruntime>=1.16", # 人声/配乐分离(UVR MDX-Net,首次运行自动下载约 67 MB 模型)
]
[project.optional-dependencies]
-ocr = ["rapidocr-onnxruntime>=1.3"]
+# rapidocr 会顺带装 opencv-python(带 GUI 的那套),和上面的 headless 抢同一个 cv2 目录;
+# scripts/install_skill.sh 装完会删掉它、重装 headless。手动安装见 setup.md。
+ocr = ["rapidocr-onnxruntime>=1.3,<2"]
dev = ["pytest>=7", "jsonschema>=4"]
[project.scripts]
diff --git a/scripts/install_skill.sh b/scripts/install_skill.sh
index 5384827..cb8a85b 100755
--- a/scripts/install_skill.sh
+++ b/scripts/install_skill.sh
@@ -23,18 +23,30 @@ if [ -z "$PY" ] || ! py_ok "$PY"; then
exit 1
fi
+# rapidocr 依赖 opencv-python,和 rea-video 的 opencv-python-headless 共用 cv2 目录,后装的覆盖先装的。
+# 只留 headless 一套:删掉 opencv-python 后强制重装 headless(删除会带走共用文件)。
+dedupe_cv() { # 参数:能跑 pip 的命令,如 python -m pip / pipx runpip rea-video
+ if "$@" show opencv-python >/dev/null 2>&1; then
+ "$@" uninstall -y opencv-python >/dev/null
+ "$@" install --force-reinstall --no-deps "opencv-python-headless>=4.8,<5" >/dev/null
+ echo "已去掉重复的 opencv-python,只保留 opencv-python-headless"
+ fi
+}
+
# ---- 安装 CLI:pip -> (系统 Python 不让装时) pipx -> 仓库内 .venv ----
log="$(mktemp)"
trap 'rm -f "$log"' EXIT
if "$PY" -m pip install -e "$ROOT[ocr]" 2>&1 | tee "$log"; [ "${PIPESTATUS[0]}" -eq 0 ]; then
- :
+ dedupe_cv "$PY" -m pip
elif grep -qi "externally-managed" "$log"; then
echo "系统 Python 不允许直接 pip 安装(PEP 668),改用隔离环境。" >&2
if command -v pipx >/dev/null 2>&1; then
pipx install --force --python "$PY" -e "$ROOT[ocr]"
+ dedupe_cv pipx runpip rea-video
else
"$PY" -m venv "$ROOT/.venv"
"$ROOT/.venv/bin/python" -m pip install -e "$ROOT[ocr]"
+ dedupe_cv "$ROOT/.venv/bin/python" -m pip
mkdir -p "$HOME/.local/bin"
ln -sfn "$ROOT/.venv/bin/rea-video" "$HOME/.local/bin/rea-video"
echo "已装到 $ROOT/.venv,命令链接到 ~/.local/bin/rea-video"
diff --git a/skills/rea-video/references/setup.md b/skills/rea-video/references/setup.md
index e2a25ef..a647606 100644
--- a/skills/rea-video/references/setup.md
+++ b/skills/rea-video/references/setup.md
@@ -11,6 +11,9 @@ rea-video --help
pip 报 `externally-managed-environment`(Homebrew / 新版 Ubuntu 的系统 Python)时,不要加 `--break-system-packages`,改用
`pipx install "rea-video[ocr] @ git+https://github.com/JuneYaooo/rea-video"`,或直接跑 `install_skill.sh`(会自动改用 pipx 或仓库内 `.venv`)。
+手动装了 `[ocr]` 时,OCR 依赖会再装一套 `opencv-python`,和 rea-video 用的 `opencv-python-headless` 抢同一个 `cv2` 目录。装完跑一次:
+`pip uninstall -y opencv-python && pip install --force-reinstall --no-deps "opencv-python-headless>=4.8,<5"`(`install_skill.sh` 会自动做)。
+
## VLM 配置(建议,不强制)
**VLM(建议配置,不强制)**:VLM 是能看图/看视频的多模态大模型(Gemini、GPT-4o、豆包、Qwen-VL 等)。不开 VLM,工具只靠像素统计、帧率、OCR、元数据判断,照样能跑完、出报告,但**实拍 / AI / 3D 的区分明显变弱**,音效清单也只有信号层的低置信候选。开了 VLM,工具会把每个镜头的短片段和关键帧发给它,再和确定性结果融合。