video-diff-checker 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- video_diff_checker-0.1.0/LICENSE +21 -0
- video_diff_checker-0.1.0/PKG-INFO +216 -0
- video_diff_checker-0.1.0/README.md +187 -0
- video_diff_checker-0.1.0/pyproject.toml +47 -0
- video_diff_checker-0.1.0/setup.cfg +4 -0
- video_diff_checker-0.1.0/src/video_diff_checker/__init__.py +3 -0
- video_diff_checker-0.1.0/src/video_diff_checker/cli.py +629 -0
- video_diff_checker-0.1.0/src/video_diff_checker/common_options.py +64 -0
- video_diff_checker-0.1.0/src/video_diff_checker/detect/__init__.py +35 -0
- video_diff_checker-0.1.0/src/video_diff_checker/detect/detector.py +333 -0
- video_diff_checker-0.1.0/src/video_diff_checker/detect/errors.py +17 -0
- video_diff_checker-0.1.0/src/video_diff_checker/detect/extractor.py +180 -0
- video_diff_checker-0.1.0/src/video_diff_checker/detect/models.py +79 -0
- video_diff_checker-0.1.0/src/video_diff_checker/detect/runner.py +167 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/__init__.py +57 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/filtergraph.py +109 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/models.py +66 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/probe.py +204 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/progress.py +77 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/runner.py +180 -0
- video_diff_checker-0.1.0/src/video_diff_checker/diff/score_parser.py +188 -0
- video_diff_checker-0.1.0/src/video_diff_checker/ffmpeg_utils.py +136 -0
- video_diff_checker-0.1.0/src/video_diff_checker/gpu_utils.py +116 -0
- video_diff_checker-0.1.0/src/video_diff_checker/grid/__init__.py +25 -0
- video_diff_checker-0.1.0/src/video_diff_checker/grid/filtergraph.py +327 -0
- video_diff_checker-0.1.0/src/video_diff_checker/grid/models.py +60 -0
- video_diff_checker-0.1.0/src/video_diff_checker/grid/runner.py +478 -0
- video_diff_checker-0.1.0/src/video_diff_checker/logger.py +37 -0
- video_diff_checker-0.1.0/src/video_diff_checker/messages.py +158 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/__init__.py +1 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/errors.py +13 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/evaluator.py +114 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/json_formatter.py +122 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/messages.py +82 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/models.py +121 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/runner.py +287 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/score_reader.py +87 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/segments_reader.py +97 -0
- video_diff_checker-0.1.0/src/video_diff_checker/report/text_formatter.py +129 -0
- video_diff_checker-0.1.0/src/video_diff_checker.egg-info/PKG-INFO +216 -0
- video_diff_checker-0.1.0/src/video_diff_checker.egg-info/SOURCES.txt +76 -0
- video_diff_checker-0.1.0/src/video_diff_checker.egg-info/dependency_links.txt +1 -0
- video_diff_checker-0.1.0/src/video_diff_checker.egg-info/entry_points.txt +2 -0
- video_diff_checker-0.1.0/src/video_diff_checker.egg-info/requires.txt +4 -0
- video_diff_checker-0.1.0/src/video_diff_checker.egg-info/top_level.txt +1 -0
- video_diff_checker-0.1.0/tests/test_cli.py +1635 -0
- video_diff_checker-0.1.0/tests/test_common_options.py +79 -0
- video_diff_checker-0.1.0/tests/test_detect_detector.py +165 -0
- video_diff_checker-0.1.0/tests/test_detect_errors.py +58 -0
- video_diff_checker-0.1.0/tests/test_detect_integration.py +424 -0
- video_diff_checker-0.1.0/tests/test_detect_json.py +224 -0
- video_diff_checker-0.1.0/tests/test_detect_models.py +147 -0
- video_diff_checker-0.1.0/tests/test_detect_runner.py +342 -0
- video_diff_checker-0.1.0/tests/test_detect_segments.py +364 -0
- video_diff_checker-0.1.0/tests/test_detect_validation.py +240 -0
- video_diff_checker-0.1.0/tests/test_diff_integration.py +256 -0
- video_diff_checker-0.1.0/tests/test_diff_models.py +243 -0
- video_diff_checker-0.1.0/tests/test_diff_validation.py +216 -0
- video_diff_checker-0.1.0/tests/test_e2e.py +397 -0
- video_diff_checker-0.1.0/tests/test_ffmpeg_utils.py +112 -0
- video_diff_checker-0.1.0/tests/test_filtergraph.py +207 -0
- video_diff_checker-0.1.0/tests/test_gpu_utils.py +86 -0
- video_diff_checker-0.1.0/tests/test_grid_filtergraph.py +291 -0
- video_diff_checker-0.1.0/tests/test_grid_models.py +92 -0
- video_diff_checker-0.1.0/tests/test_grid_runner.py +350 -0
- video_diff_checker-0.1.0/tests/test_logger.py +49 -0
- video_diff_checker-0.1.0/tests/test_messages.py +53 -0
- video_diff_checker-0.1.0/tests/test_progress.py +124 -0
- video_diff_checker-0.1.0/tests/test_report_e2e.py +482 -0
- video_diff_checker-0.1.0/tests/test_report_evaluator.py +278 -0
- video_diff_checker-0.1.0/tests/test_report_json_formatter.py +270 -0
- video_diff_checker-0.1.0/tests/test_report_runner.py +342 -0
- video_diff_checker-0.1.0/tests/test_report_score_reader.py +202 -0
- video_diff_checker-0.1.0/tests/test_report_segments_reader.py +141 -0
- video_diff_checker-0.1.0/tests/test_report_text_formatter.py +159 -0
- video_diff_checker-0.1.0/tests/test_runner.py +435 -0
- video_diff_checker-0.1.0/tests/test_score_parser.py +271 -0
- video_diff_checker-0.1.0/tests/test_validate_inputs.py +207 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hidano
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: video-diff-checker
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A CLI tool that compares two video files and automates pixel-level diff detection
|
|
5
|
+
Author: Hidano
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Hidano/VideoDiffChecker
|
|
8
|
+
Project-URL: Repository, https://github.com/Hidano/VideoDiffChecker
|
|
9
|
+
Project-URL: Issues, https://github.com/Hidano/VideoDiffChecker/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/Hidano/VideoDiffChecker/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: video,diff,comparison,ffmpeg
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
19
|
+
Classifier: Operating System :: MacOS
|
|
20
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Environment :: Console
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest; extra == "dev"
|
|
27
|
+
Requires-Dist: ruff; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# Video Diff Checker
|
|
31
|
+
|
|
32
|
+
2つの動画ファイル(旧版/新版)を比較し、ピクセルレベルの差分検出・区間抽出・グリッド比較動画生成・レポート出力を自動化する Python CLI ツール。
|
|
33
|
+
|
|
34
|
+
## 特徴
|
|
35
|
+
|
|
36
|
+
- フレーム単位のピクセル差分検出(PSNR/SSIM スコア算出)
|
|
37
|
+
- 変化区間の自動検出とパート動画抽出(マージン・統合ギャップの調整可)
|
|
38
|
+
- 2x2 グリッド比較動画の生成(旧版 / 新版 / 差分 / 情報パネル)
|
|
39
|
+
- 変更サマリーレポート出力(JSON / テキスト形式)
|
|
40
|
+
- `compare` コマンドで差分検出からレポート生成まで一括実行
|
|
41
|
+
|
|
42
|
+
## 前提条件
|
|
43
|
+
|
|
44
|
+
- Python 3.10 以上
|
|
45
|
+
- FFmpeg 6.0 以上(PATH に含まれている必要あり)
|
|
46
|
+
- 対応 OS: Windows 10/11, macOS 12+, Ubuntu 22.04+
|
|
47
|
+
|
|
48
|
+
## インストール
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install video-diff-checker
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
開発用:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://github.com/Hidano/VideoDiffChecker.git
|
|
58
|
+
cd VideoDiffChecker
|
|
59
|
+
pip install -e ".[dev]"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 使い方
|
|
63
|
+
|
|
64
|
+
### 一括実行(compare)
|
|
65
|
+
|
|
66
|
+
差分検出 → 区間特定 → パート抽出 → グリッド生成 → レポート出力を一括で実行する。
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
video-diff-checker compare old.mp4 new.mp4
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
出力先を指定する場合:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
video-diff-checker compare old.mp4 new.mp4 -o ./output/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
閾値やマージンを調整する場合:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
video-diff-checker compare old.mp4 new.mp4 --threshold 0.90 --margin 60 --merge-gap 20
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 差分検出のみ(diff)
|
|
85
|
+
|
|
86
|
+
フレーム単位のピクセル差分動画とスコア CSV を生成する。
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
video-diff-checker diff old.mp4 new.mp4
|
|
90
|
+
video-diff-checker diff old.mp4 new.mp4 -o ./output/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 区間検出(detect)
|
|
94
|
+
|
|
95
|
+
スコア CSV を解析し、変化区間を特定して segments.json を出力する。
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
video-diff-checker detect scores.csv
|
|
99
|
+
video-diff-checker detect scores.csv --threshold 0.90 --margin 60 --merge-gap 20 --fps 24.0
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### パート動画抽出(extract)
|
|
103
|
+
|
|
104
|
+
segments.json に基づき、旧版・新版・差分動画からパート動画を切り出す。
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
video-diff-checker extract old.mp4 new.mp4 diff.mp4 --segments segments.json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### グリッド比較動画生成(grid)
|
|
111
|
+
|
|
112
|
+
2x2 グリッド比較動画(旧版 / 新版 / 差分 / 情報パネル)を生成する。
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
video-diff-checker grid old.mp4 new.mp4 diff.mp4 --segments segments.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### レポート生成(report)
|
|
119
|
+
|
|
120
|
+
スコア CSV と segments.json から変更サマリーレポートを生成する。
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
video-diff-checker report scores.csv segments.json
|
|
124
|
+
video-diff-checker report scores.csv segments.json --format json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## コマンドリファレンス
|
|
128
|
+
|
|
129
|
+
### 共通オプション
|
|
130
|
+
|
|
131
|
+
以下のオプションは `compare`, `diff`, `detect`, `extract`, `grid` で共通で使用できる(`report` を除く)。
|
|
132
|
+
|
|
133
|
+
| オプション | 短縮形 | 説明 | デフォルト |
|
|
134
|
+
|---|---|---|---|
|
|
135
|
+
| `--verbose` | `-v` | 詳細ログを出力する | `false` |
|
|
136
|
+
| `--threshold` | `-t` | SSIM ベースの閾値(0.0 - 1.0) | `0.95` |
|
|
137
|
+
| `--gpu` | - | GPU アクセラレーションを使用する | `false` |
|
|
138
|
+
|
|
139
|
+
### compare
|
|
140
|
+
|
|
141
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
144
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
145
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
146
|
+
| `--margin` | セグメント前後に追加するマージン(フレーム数) | `30` |
|
|
147
|
+
| `--merge-gap` | セグメント統合のギャップ閾値(フレーム数) | `15` |
|
|
148
|
+
|
|
149
|
+
### diff
|
|
150
|
+
|
|
151
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
154
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
155
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
156
|
+
|
|
157
|
+
### detect
|
|
158
|
+
|
|
159
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| `scores_csv` (必須) | スコア CSV ファイルのパス | - |
|
|
162
|
+
| `--margin` | セグメント前後に追加するマージン(フレーム数) | `30` |
|
|
163
|
+
| `--merge-gap` | セグメント統合のギャップ閾値(フレーム数) | `15` |
|
|
164
|
+
| `--fps` | フレームレート(時刻計算用) | `30.0` |
|
|
165
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
166
|
+
|
|
167
|
+
### extract
|
|
168
|
+
|
|
169
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
172
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
173
|
+
| `diff` (必須) | 差分動画ファイルのパス | - |
|
|
174
|
+
| `--segments` (必須) | segments.json ファイルのパス | - |
|
|
175
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
176
|
+
| `--workers` | 並列ワーカー数の上限 | CPU コア数 |
|
|
177
|
+
|
|
178
|
+
### grid
|
|
179
|
+
|
|
180
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
181
|
+
|---|---|---|
|
|
182
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
183
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
184
|
+
| `diff` (必須) | 差分動画ファイルのパス | - |
|
|
185
|
+
| `--segments` (必須) | segments.json ファイルのパス | - |
|
|
186
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
187
|
+
| `--workers` | 並列ワーカー数の上限 | CPU コア数 |
|
|
188
|
+
|
|
189
|
+
### report
|
|
190
|
+
|
|
191
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| `scores_csv` (必須) | スコア CSV ファイルのパス | - |
|
|
194
|
+
| `segments_json` (必須) | segments.json ファイルのパス | - |
|
|
195
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
196
|
+
| `--format` | 出力形式(`json` / `text` / `all`) | `all` |
|
|
197
|
+
| `--verbose`, `-v` | 詳細ログを出力する | `false` |
|
|
198
|
+
|
|
199
|
+
## 処理フロー
|
|
200
|
+
|
|
201
|
+
`compare` コマンドは以下の 4 ステージをパイプラインで順次実行する。各ステージは個別のサブコマンドとしても単独で使用できる。
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
diff --> detect --> extract --> grid --> report
|
|
205
|
+
(F-01) (F-02) (F-02) (F-03) (F-04)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
1. **diff (F-01)**: FFmpeg の `blend=all_mode=difference` フィルタでフレーム単位のピクセル差分動画を生成し、PSNR/SSIM スコアを CSV に出力する
|
|
209
|
+
2. **detect (F-02)**: スコア CSV を閾値で解析し、変化区間(セグメント)を特定する。マージン追加や近接セグメントの統合を行う
|
|
210
|
+
3. **extract (F-02)**: 特定されたセグメントに基づき、旧版・新版・差分動画からパート動画を切り出す
|
|
211
|
+
4. **grid (F-03)**: パート動画を 2x2 グリッド(旧版 / 新版 / 差分 / 情報パネル)に合成し、`drawtext` でオーバーレイを付与する
|
|
212
|
+
5. **report (F-04)**: スコアとセグメント情報から変更サマリーレポートを JSON/テキスト形式で生成する
|
|
213
|
+
|
|
214
|
+
## ライセンス
|
|
215
|
+
|
|
216
|
+
MIT License. 詳細は [LICENSE](LICENSE) を参照。
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Video Diff Checker
|
|
2
|
+
|
|
3
|
+
2つの動画ファイル(旧版/新版)を比較し、ピクセルレベルの差分検出・区間抽出・グリッド比較動画生成・レポート出力を自動化する Python CLI ツール。
|
|
4
|
+
|
|
5
|
+
## 特徴
|
|
6
|
+
|
|
7
|
+
- フレーム単位のピクセル差分検出(PSNR/SSIM スコア算出)
|
|
8
|
+
- 変化区間の自動検出とパート動画抽出(マージン・統合ギャップの調整可)
|
|
9
|
+
- 2x2 グリッド比較動画の生成(旧版 / 新版 / 差分 / 情報パネル)
|
|
10
|
+
- 変更サマリーレポート出力(JSON / テキスト形式)
|
|
11
|
+
- `compare` コマンドで差分検出からレポート生成まで一括実行
|
|
12
|
+
|
|
13
|
+
## 前提条件
|
|
14
|
+
|
|
15
|
+
- Python 3.10 以上
|
|
16
|
+
- FFmpeg 6.0 以上(PATH に含まれている必要あり)
|
|
17
|
+
- 対応 OS: Windows 10/11, macOS 12+, Ubuntu 22.04+
|
|
18
|
+
|
|
19
|
+
## インストール
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install video-diff-checker
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
開発用:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/Hidano/VideoDiffChecker.git
|
|
29
|
+
cd VideoDiffChecker
|
|
30
|
+
pip install -e ".[dev]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 使い方
|
|
34
|
+
|
|
35
|
+
### 一括実行(compare)
|
|
36
|
+
|
|
37
|
+
差分検出 → 区間特定 → パート抽出 → グリッド生成 → レポート出力を一括で実行する。
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
video-diff-checker compare old.mp4 new.mp4
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
出力先を指定する場合:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
video-diff-checker compare old.mp4 new.mp4 -o ./output/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
閾値やマージンを調整する場合:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
video-diff-checker compare old.mp4 new.mp4 --threshold 0.90 --margin 60 --merge-gap 20
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 差分検出のみ(diff)
|
|
56
|
+
|
|
57
|
+
フレーム単位のピクセル差分動画とスコア CSV を生成する。
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
video-diff-checker diff old.mp4 new.mp4
|
|
61
|
+
video-diff-checker diff old.mp4 new.mp4 -o ./output/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 区間検出(detect)
|
|
65
|
+
|
|
66
|
+
スコア CSV を解析し、変化区間を特定して segments.json を出力する。
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
video-diff-checker detect scores.csv
|
|
70
|
+
video-diff-checker detect scores.csv --threshold 0.90 --margin 60 --merge-gap 20 --fps 24.0
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### パート動画抽出(extract)
|
|
74
|
+
|
|
75
|
+
segments.json に基づき、旧版・新版・差分動画からパート動画を切り出す。
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
video-diff-checker extract old.mp4 new.mp4 diff.mp4 --segments segments.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### グリッド比較動画生成(grid)
|
|
82
|
+
|
|
83
|
+
2x2 グリッド比較動画(旧版 / 新版 / 差分 / 情報パネル)を生成する。
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
video-diff-checker grid old.mp4 new.mp4 diff.mp4 --segments segments.json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### レポート生成(report)
|
|
90
|
+
|
|
91
|
+
スコア CSV と segments.json から変更サマリーレポートを生成する。
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
video-diff-checker report scores.csv segments.json
|
|
95
|
+
video-diff-checker report scores.csv segments.json --format json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## コマンドリファレンス
|
|
99
|
+
|
|
100
|
+
### 共通オプション
|
|
101
|
+
|
|
102
|
+
以下のオプションは `compare`, `diff`, `detect`, `extract`, `grid` で共通で使用できる(`report` を除く)。
|
|
103
|
+
|
|
104
|
+
| オプション | 短縮形 | 説明 | デフォルト |
|
|
105
|
+
|---|---|---|---|
|
|
106
|
+
| `--verbose` | `-v` | 詳細ログを出力する | `false` |
|
|
107
|
+
| `--threshold` | `-t` | SSIM ベースの閾値(0.0 - 1.0) | `0.95` |
|
|
108
|
+
| `--gpu` | - | GPU アクセラレーションを使用する | `false` |
|
|
109
|
+
|
|
110
|
+
### compare
|
|
111
|
+
|
|
112
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
115
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
116
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
117
|
+
| `--margin` | セグメント前後に追加するマージン(フレーム数) | `30` |
|
|
118
|
+
| `--merge-gap` | セグメント統合のギャップ閾値(フレーム数) | `15` |
|
|
119
|
+
|
|
120
|
+
### diff
|
|
121
|
+
|
|
122
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
125
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
126
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
127
|
+
|
|
128
|
+
### detect
|
|
129
|
+
|
|
130
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| `scores_csv` (必須) | スコア CSV ファイルのパス | - |
|
|
133
|
+
| `--margin` | セグメント前後に追加するマージン(フレーム数) | `30` |
|
|
134
|
+
| `--merge-gap` | セグメント統合のギャップ閾値(フレーム数) | `15` |
|
|
135
|
+
| `--fps` | フレームレート(時刻計算用) | `30.0` |
|
|
136
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
137
|
+
|
|
138
|
+
### extract
|
|
139
|
+
|
|
140
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
143
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
144
|
+
| `diff` (必須) | 差分動画ファイルのパス | - |
|
|
145
|
+
| `--segments` (必須) | segments.json ファイルのパス | - |
|
|
146
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
147
|
+
| `--workers` | 並列ワーカー数の上限 | CPU コア数 |
|
|
148
|
+
|
|
149
|
+
### grid
|
|
150
|
+
|
|
151
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| `old` (必須) | 旧動画ファイルのパス | - |
|
|
154
|
+
| `new` (必須) | 新動画ファイルのパス | - |
|
|
155
|
+
| `diff` (必須) | 差分動画ファイルのパス | - |
|
|
156
|
+
| `--segments` (必須) | segments.json ファイルのパス | - |
|
|
157
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
158
|
+
| `--workers` | 並列ワーカー数の上限 | CPU コア数 |
|
|
159
|
+
|
|
160
|
+
### report
|
|
161
|
+
|
|
162
|
+
| 引数/オプション | 説明 | デフォルト |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| `scores_csv` (必須) | スコア CSV ファイルのパス | - |
|
|
165
|
+
| `segments_json` (必須) | segments.json ファイルのパス | - |
|
|
166
|
+
| `--output`, `-o` | 出力ディレクトリのパス | `./vdc-output/` |
|
|
167
|
+
| `--format` | 出力形式(`json` / `text` / `all`) | `all` |
|
|
168
|
+
| `--verbose`, `-v` | 詳細ログを出力する | `false` |
|
|
169
|
+
|
|
170
|
+
## 処理フロー
|
|
171
|
+
|
|
172
|
+
`compare` コマンドは以下の 4 ステージをパイプラインで順次実行する。各ステージは個別のサブコマンドとしても単独で使用できる。
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
diff --> detect --> extract --> grid --> report
|
|
176
|
+
(F-01) (F-02) (F-02) (F-03) (F-04)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
1. **diff (F-01)**: FFmpeg の `blend=all_mode=difference` フィルタでフレーム単位のピクセル差分動画を生成し、PSNR/SSIM スコアを CSV に出力する
|
|
180
|
+
2. **detect (F-02)**: スコア CSV を閾値で解析し、変化区間(セグメント)を特定する。マージン追加や近接セグメントの統合を行う
|
|
181
|
+
3. **extract (F-02)**: 特定されたセグメントに基づき、旧版・新版・差分動画からパート動画を切り出す
|
|
182
|
+
4. **grid (F-03)**: パート動画を 2x2 グリッド(旧版 / 新版 / 差分 / 情報パネル)に合成し、`drawtext` でオーバーレイを付与する
|
|
183
|
+
5. **report (F-04)**: スコアとセグメント情報から変更サマリーレポートを JSON/テキスト形式で生成する
|
|
184
|
+
|
|
185
|
+
## ライセンス
|
|
186
|
+
|
|
187
|
+
MIT License. 詳細は [LICENSE](LICENSE) を参照。
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "video-diff-checker"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A CLI tool that compares two video files and automates pixel-level diff detection"
|
|
5
|
+
requires-python = ">= 3.10"
|
|
6
|
+
dependencies = []
|
|
7
|
+
authors = [{name = "Hidano"}]
|
|
8
|
+
license = "MIT"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
keywords = ["video", "diff", "comparison", "ffmpeg"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.10",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Operating System :: Microsoft :: Windows",
|
|
19
|
+
"Operating System :: MacOS",
|
|
20
|
+
"Operating System :: POSIX :: Linux",
|
|
21
|
+
"Environment :: Console",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/Hidano/VideoDiffChecker"
|
|
26
|
+
Repository = "https://github.com/Hidano/VideoDiffChecker"
|
|
27
|
+
Issues = "https://github.com/Hidano/VideoDiffChecker/issues"
|
|
28
|
+
Changelog = "https://github.com/Hidano/VideoDiffChecker/blob/main/CHANGELOG.md"
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
video-diff-checker = "video_diff_checker.cli:main"
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest",
|
|
36
|
+
"ruff",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[build-system]
|
|
40
|
+
requires = ["setuptools"]
|
|
41
|
+
build-backend = "setuptools.build_meta"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.packages.find]
|
|
44
|
+
where = ["src"]
|
|
45
|
+
|
|
46
|
+
[tool.pytest.ini_options]
|
|
47
|
+
pythonpath = ["src"]
|