Metadata-Version: 2.4
Name: twat-video
Version: 2.1.7
Summary: Video processing helpers for the twat plugin ecosystem
Project-URL: Documentation, https://github.com/twardoch/twat-video#readme
Project-URL: Issues, https://github.com/twardoch/twat-video/issues
Project-URL: Source, https://github.com/twardoch/twat-video
Author-email: Adam Twardoch <adam+github@twardoch.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ffmpeg,media,twat-plugin,video
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: twat>=1.8.1
Provides-Extra: all
Requires-Dist: binary; extra == 'all'
Requires-Dist: build; extra == 'all'
Requires-Dist: dev; extra == 'all'
Requires-Dist: docs; extra == 'all'
Requires-Dist: test; extra == 'all'
Provides-Extra: binary
Requires-Dist: cx-freeze>=6.15.0; extra == 'binary'
Requires-Dist: pyinstaller>=6.0.0; extra == 'binary'
Provides-Extra: build
Requires-Dist: build>=0.10.0; extra == 'build'
Requires-Dist: hatch-vcs>=0.4.0; extra == 'build'
Requires-Dist: hatchling>=1.27.0; extra == 'build'
Requires-Dist: twine>=4.0.0; extra == 'build'
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.56; extra == 'docs'
Requires-Dist: mkdocs>=1.6.1; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.28.0; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.14; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest-benchmark[histogram]>=4.0.0; extra == 'test'
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
Requires-Dist: pytest-xdist>=3.5.0; extra == 'test'
Requires-Dist: pytest>=7.0.0; extra == 'test'
Description-Content-Type: text/markdown

# twat-video

`twat-video` is the video domain package for the `twat` plugin ecosystem. It builds reusable, testable ffmpeg command wrappers and delegates AI video generation to `twat_genai` when such provider engines are available.

## Font-organizer preservation

This repository used to package `font_organizer`. The canonical copy now exists in `plugins/repos/twat_font` as `twat_font`, with the same organizer/core modules and CLI surface. The old source tree is left in this repo only as historical material; the build now packages `src/twat_video`.

## Requirements

Install `ffmpeg` and `ffprobe` for real media processing. Tests exercise command construction with `dry_run=True` and do not require media binaries.

## Python API

```python
from twat_video import crop_scale, import_audio, split_segment

crop_scale("input.mp4", "square.mp4", crop="1080:1080:420:0", scale="720:720")
split_segment("input.mp4", "clip.mp4", start=12.5, duration=4.0)
import_audio("silent.mp4", "voice.wav", "dubbed.mp4")
```

Implemented deterministic helpers:

- ffmpeg boundary: `run_command`, `run_ffmpeg`, `probe_video`.
- video geometry/timing: `crop_scale`, `change_fps`, `split_segment`, `reverse_video`.
- composition: `merge_by_gap`, `ken_burns`.
- audio/subtitle operations: `import_audio`, `extract_subtitles`, `repair_srt_text`, `add_reverb`.
- visual effect: `add_grain`.

## CLI

```bash
python -m twat_video --help
python -m twat_video crop-scale in.mp4 out.mp4 --crop 1080:1080:420:0 --scale 720:720 --dry-run
python -m twat_video fps in.mp4 out.mp4 24 --dry-run
python -m twat_video split in.mp4 clip.mp4 --start 1.5 --duration 3 --dry-run
python -m twat_video import-audio silent.mp4 voice.wav dubbed.mp4 --dry-run
python -m twat_video ken-burns still.png out.mp4 --duration 5 --dry-run
```

## AI video boundary

`generate_video()` is a narrow adapter. It imports `twat_genai` and calls a future `twat_genai.generate_video` provider API if present; it does not embed SkyReels, WAN, Chutes, or other provider clients.

## Reference scripts

Reusable patterns from `vidcropscale.py`, `vidfps`, `vidframedrop.py`, `vidsplit.py`, `vidreverse`, `vidmergebygap.py`, `vidkenburns.py`, `vidgrainer.py`, `vidreverb.py`, `vidimportaudio`, `mkv2srt.py`, and `srtmultifix.py` are represented as package APIs.

Watermark removal, menu-bar automation, JSON presets, batch shell wrappers, and local renaming/upload workflows remain in `reference/bin-img-vid/` because they are workstation-specific one-offs or policy-sensitive scripts rather than reusable package behavior.
