cutcaption 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.
- cutcaption-0.1.0/LICENSE +21 -0
- cutcaption-0.1.0/PKG-INFO +390 -0
- cutcaption-0.1.0/README.md +361 -0
- cutcaption-0.1.0/pyproject.toml +56 -0
- cutcaption-0.1.0/setup.cfg +4 -0
- cutcaption-0.1.0/src/cutcaption/__init__.py +5 -0
- cutcaption-0.1.0/src/cutcaption/__main__.py +6 -0
- cutcaption-0.1.0/src/cutcaption/_version.py +3 -0
- cutcaption-0.1.0/src/cutcaption/chunking.py +240 -0
- cutcaption-0.1.0/src/cutcaption/cli.py +347 -0
- cutcaption-0.1.0/src/cutcaption/config.py +258 -0
- cutcaption-0.1.0/src/cutcaption/doctor.py +143 -0
- cutcaption-0.1.0/src/cutcaption/exporters/__init__.py +1 -0
- cutcaption-0.1.0/src/cutcaption/exporters/ass.py +97 -0
- cutcaption-0.1.0/src/cutcaption/exporters/json.py +67 -0
- cutcaption-0.1.0/src/cutcaption/exporters/srt.py +61 -0
- cutcaption-0.1.0/src/cutcaption/media.py +23 -0
- cutcaption-0.1.0/src/cutcaption/models.py +93 -0
- cutcaption-0.1.0/src/cutcaption/pipeline.py +151 -0
- cutcaption-0.1.0/src/cutcaption/render.py +76 -0
- cutcaption-0.1.0/src/cutcaption/styles.py +149 -0
- cutcaption-0.1.0/src/cutcaption/transcribe.py +131 -0
- cutcaption-0.1.0/src/cutcaption/utils/__init__.py +1 -0
- cutcaption-0.1.0/src/cutcaption/utils/ffmpeg.py +143 -0
- cutcaption-0.1.0/src/cutcaption/utils/logging.py +7 -0
- cutcaption-0.1.0/src/cutcaption/utils/paths.py +82 -0
- cutcaption-0.1.0/src/cutcaption.egg-info/PKG-INFO +390 -0
- cutcaption-0.1.0/src/cutcaption.egg-info/SOURCES.txt +43 -0
- cutcaption-0.1.0/src/cutcaption.egg-info/dependency_links.txt +1 -0
- cutcaption-0.1.0/src/cutcaption.egg-info/entry_points.txt +2 -0
- cutcaption-0.1.0/src/cutcaption.egg-info/requires.txt +11 -0
- cutcaption-0.1.0/src/cutcaption.egg-info/top_level.txt +1 -0
- cutcaption-0.1.0/tests/test_chunking.py +151 -0
- cutcaption-0.1.0/tests/test_cli.py +40 -0
- cutcaption-0.1.0/tests/test_config.py +147 -0
- cutcaption-0.1.0/tests/test_doctor.py +81 -0
- cutcaption-0.1.0/tests/test_export_ass.py +37 -0
- cutcaption-0.1.0/tests/test_export_json.py +56 -0
- cutcaption-0.1.0/tests/test_export_srt.py +51 -0
- cutcaption-0.1.0/tests/test_ffmpeg_utils.py +88 -0
- cutcaption-0.1.0/tests/test_paths.py +114 -0
- cutcaption-0.1.0/tests/test_pipeline.py +159 -0
- cutcaption-0.1.0/tests/test_render.py +90 -0
- cutcaption-0.1.0/tests/test_styles.py +73 -0
- cutcaption-0.1.0/tests/test_transcribe.py +192 -0
cutcaption-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cutcaption contributors
|
|
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,390 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cutcaption
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Fast local CLI/TUI for generating styled burned-in captions for videos.
|
|
5
|
+
Author: cutcaption contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: captions,subtitles,whisper,video,cli
|
|
8
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Multimedia :: Video
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: faster-whisper<2,>=1.1
|
|
21
|
+
Requires-Dist: pysubs2<2,>=1.7
|
|
22
|
+
Requires-Dist: rich<15,>=13.9
|
|
23
|
+
Requires-Dist: tomli<3,>=2.0; python_version < "3.11"
|
|
24
|
+
Requires-Dist: typer<1,>=0.12
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest<9,>=8.0; extra == "dev"
|
|
27
|
+
Requires-Dist: ruff<1,>=0.8; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# cutcaption
|
|
31
|
+
|
|
32
|
+
**cutcaption — CapCut-like captions from your terminal**
|
|
33
|
+
|
|
34
|
+
Generate clean, styled, burned-in captions for one video or a folder of videos using faster-whisper.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pipx install cutcaption
|
|
38
|
+
cutcaption video.mp4
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
By default, cutcaption transcribes your video, builds short creator-friendly captions, writes subtitles, and burns styled captions into a new video.
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cutcaption video.mp4
|
|
47
|
+
cutcaption ./videos --preset shorts --style pop
|
|
48
|
+
cutcaption video.mp4 --srt --no-burn
|
|
49
|
+
cutcaption doctor
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Common outputs:
|
|
53
|
+
|
|
54
|
+
- `video.srt` for standard subtitles
|
|
55
|
+
- `video.ass` when styled captions are needed for burning
|
|
56
|
+
- `video.json` when JSON metadata is enabled
|
|
57
|
+
- `video_captioned.mp4` for the burned-in captioned video
|
|
58
|
+
|
|
59
|
+
For folders, cutcaption writes to a `captioned/` folder unless you pass `--output`.
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
If you already have `pipx`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pipx install cutcaption
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If you do not have `pipx` yet, install it first.
|
|
70
|
+
|
|
71
|
+
macOS/Linux:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python3 -m pip install --user pipx
|
|
75
|
+
python3 -m pipx ensurepath
|
|
76
|
+
pipx install cutcaption
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Windows:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
py -m pip install --user pipx
|
|
83
|
+
py -m pipx ensurepath
|
|
84
|
+
pipx install cutcaption
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Then restart your terminal if needed and run:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cutcaption video.mp4
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Alternative: install with `pip`.
|
|
94
|
+
|
|
95
|
+
macOS/Linux:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
python3 -m pip install --user cutcaption
|
|
99
|
+
cutcaption video.mp4
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Windows:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
py -m pip install --user cutcaption
|
|
106
|
+
cutcaption video.mp4
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Requirements:
|
|
110
|
+
|
|
111
|
+
- Python 3.10+
|
|
112
|
+
- `ffmpeg` and `ffprobe` for burned-in captions and media probing
|
|
113
|
+
- faster-whisper model files download on first use
|
|
114
|
+
|
|
115
|
+
## Development Install
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git clone https://github.com/your-org/cutcaption.git
|
|
119
|
+
cd cutcaption
|
|
120
|
+
pip install -e ".[dev]"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Run tests:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python -m pytest
|
|
127
|
+
python -m ruff check .
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Usage
|
|
131
|
+
|
|
132
|
+
Caption one video:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
cutcaption video.mp4
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Choose an output folder:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cutcaption video.mp4 --output ./out
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Caption a folder:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
cutcaption ./videos --output ./captioned
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Caption a folder recursively:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cutcaption ./videos --recursive
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Export subtitles without rendering a video:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
cutcaption video.mp4 --srt --ass --no-burn
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Write JSON metadata:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
cutcaption video.mp4 --json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Replace existing outputs:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
cutcaption video.mp4 --overwrite
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Preview planned jobs without transcription:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
cutcaption ./videos --dry-run
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Batch Examples
|
|
181
|
+
|
|
182
|
+
Fast batch captions for short-form clips:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
cutcaption ./clips --preset shorts --style pop --recursive
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Create only subtitle files for a batch:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
cutcaption ./clips --srt --ass --no-burn
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Skip files that already have requested outputs:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
cutcaption ./clips --skip-existing
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Force regeneration:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
cutcaption ./clips --overwrite
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
`--jobs` is accepted for future parallel processing. Processing is currently sequential.
|
|
207
|
+
|
|
208
|
+
## Styles
|
|
209
|
+
|
|
210
|
+
List available styles:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cutcaption styles
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Examples:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
cutcaption video.mp4 --style clean
|
|
220
|
+
cutcaption video.mp4 --style bold
|
|
221
|
+
cutcaption video.mp4 --style pop
|
|
222
|
+
cutcaption video.mp4 --style minimal
|
|
223
|
+
cutcaption video.mp4 --style boxed
|
|
224
|
+
cutcaption video.mp4 --style shorts
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Style guide:
|
|
228
|
+
|
|
229
|
+
- `clean`: readable white text, moderate outline, no box
|
|
230
|
+
- `bold`: larger uppercase captions with thicker outline
|
|
231
|
+
- `pop`: big creator-style uppercase captions with thick outline and shadow
|
|
232
|
+
- `minimal`: smaller captions with a thin outline
|
|
233
|
+
- `boxed`: readable text over a semi-transparent box
|
|
234
|
+
- `shorts`: one spoken word at a time for fast short-form videos
|
|
235
|
+
|
|
236
|
+
## Presets
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
cutcaption video.mp4 --preset shorts
|
|
240
|
+
cutcaption video.mp4 --preset youtube
|
|
241
|
+
cutcaption video.mp4 --preset podcast
|
|
242
|
+
cutcaption video.mp4 --preset default
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
`shorts` is the default and is tuned for short creator videos.
|
|
246
|
+
|
|
247
|
+
## Config File
|
|
248
|
+
|
|
249
|
+
Create a starter config:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
cutcaption init
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Use a config file:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
cutcaption video.mp4 --config cutcaption.toml
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Example:
|
|
262
|
+
|
|
263
|
+
```toml
|
|
264
|
+
output = "captioned"
|
|
265
|
+
|
|
266
|
+
[transcription]
|
|
267
|
+
model = "small"
|
|
268
|
+
mode = "balanced"
|
|
269
|
+
language = "" # auto
|
|
270
|
+
device = "auto"
|
|
271
|
+
compute_type = "auto"
|
|
272
|
+
|
|
273
|
+
[caption]
|
|
274
|
+
preset = "shorts"
|
|
275
|
+
style = "pop"
|
|
276
|
+
max_words = 5
|
|
277
|
+
max_lines = 2
|
|
278
|
+
min_caption_duration = 0.25
|
|
279
|
+
max_caption_duration = 2.5
|
|
280
|
+
|
|
281
|
+
[render]
|
|
282
|
+
burn = true
|
|
283
|
+
srt = true
|
|
284
|
+
ass = false
|
|
285
|
+
json = true
|
|
286
|
+
|
|
287
|
+
[batch]
|
|
288
|
+
recursive = false
|
|
289
|
+
skip_existing = true
|
|
290
|
+
overwrite = false
|
|
291
|
+
jobs = 1
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
See [examples/cutcaption.toml](examples/cutcaption.toml).
|
|
295
|
+
|
|
296
|
+
## Doctor
|
|
297
|
+
|
|
298
|
+
Check local tools and dependencies:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
cutcaption doctor
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Use this first when rendering or transcription fails.
|
|
305
|
+
|
|
306
|
+
## Troubleshooting
|
|
307
|
+
|
|
308
|
+
### ffmpeg not found
|
|
309
|
+
|
|
310
|
+
Install ffmpeg and make sure `ffmpeg` and `ffprobe` are on your `PATH`.
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# macOS
|
|
314
|
+
brew install ffmpeg
|
|
315
|
+
|
|
316
|
+
# Ubuntu/Debian
|
|
317
|
+
sudo apt install ffmpeg
|
|
318
|
+
|
|
319
|
+
# Windows
|
|
320
|
+
winget install Gyan.FFmpeg
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Then run:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
cutcaption doctor
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Model download is slow
|
|
330
|
+
|
|
331
|
+
faster-whisper downloads the selected model on first use. The first run can take longer depending on model size and network speed. Use a smaller model for quicker startup:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
cutcaption video.mp4 --model small --mode fast
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### CUDA is not working
|
|
338
|
+
|
|
339
|
+
CPU transcription works by default. If CUDA setup is unreliable, use the default device or force CPU in your config:
|
|
340
|
+
|
|
341
|
+
```toml
|
|
342
|
+
[transcription]
|
|
343
|
+
device = "cpu"
|
|
344
|
+
compute_type = "int8"
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Run:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
cutcaption doctor
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Output already exists
|
|
354
|
+
|
|
355
|
+
By default, cutcaption skips existing requested outputs in batch mode. To regenerate files:
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
cutcaption video.mp4 --overwrite
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
To fail instead of skipping existing files:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
cutcaption video.mp4 --no-skip-existing
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
## Roadmap
|
|
368
|
+
|
|
369
|
+
- Parallel batch processing
|
|
370
|
+
- Live style preview
|
|
371
|
+
- More caption animation presets
|
|
372
|
+
- Current-word highlighting
|
|
373
|
+
- GPU setup helpers
|
|
374
|
+
- More export formats
|
|
375
|
+
|
|
376
|
+
## Contributing
|
|
377
|
+
|
|
378
|
+
Contributions are welcome. For local work:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
pip install -e ".[dev]"
|
|
382
|
+
python -m pytest
|
|
383
|
+
python -m ruff check .
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Keep changes focused, add tests for behavior changes, and update docs when user-facing commands or config options change.
|
|
387
|
+
|
|
388
|
+
## License
|
|
389
|
+
|
|
390
|
+
MIT. See [LICENSE](LICENSE).
|