Metadata-Version: 2.4
Name: sanchousf-ai-toolkit-video
Version: 0.1.0
Summary: Fast, lossless (zero-reencode) video container & track manipulation toolkit
Author: sanchousf
Author-email: sanchousf@gmail.com
License-Expression: MIT
Project-URL: Homepage, https://github.com/sanchousf/ai-toolkit
Project-URL: Repository, https://github.com/sanchousf/ai-toolkit
Project-URL: Issues, https://github.com/sanchousf/ai-toolkit/issues
Project-URL: Documentation, https://github.com/sanchousf/ai-toolkit#readme
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: static-ffmpeg>=2.5
Provides-Extra: test
Requires-Dist: pytest>=8.0.0; extra == "test"
Requires-Dist: pytest-cov>=7.0.0; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
Requires-Dist: setuptools>=61.0; extra == "dev"
Requires-Dist: wheel; extra == "dev"

# Video Toolkit (`video/`)

Fast, lossless (**zero-reencode**) video container and track manipulation toolkit for single files or batch folders.

## Why MKVToolNix + FFmpeg?

- **Zero re-encoding**: Video, audio, and subtitle bitstreams are copied directly at disk/I/O speed rather than decoded and re-encoded.
- **MKVToolNix (`mkvmerge`, `mkvextract`, `mkvpropedit`)**: Default backend for `.mkv`/`.mka`/`.mks`/`.webm`. Handles complex subtitle formats (SRT, ASS, PGS/SUP, VobSub), chapters, attachments, and instant **in-place** flag/language edits via `mkvpropedit`.
- **FFmpeg (`ffmpeg -c copy`, `ffprobe`)**: Optional/automatic backend for `.mp4`/`.mov`/`.ts`/etc. when you want non-MKV output containers or when MKVToolNix is not installed.
- **Zero Python dependencies**: Uses Python 3.9+ standard library only.

---

## Quick Start

Run directly with Python (`python -m video ...`) or via the `video` / `video-tracks` console scripts after `pip install -e video/`:

```bash
# Inspect tracks in a file or a whole folder
video tracks info movie.mkv
video tracks info ./movies --recursive

# Add a subtitle or audio track without re-encoding
video tracks add movie.mkv --track movie.en.srt --lang eng --default

# Batch-add matching sidecar files (Movie.en.srt, Movie.spa.forced.ass, Movie.ac3, etc.)
video tracks add ./movies --auto-sidecars --in-place --jobs 4

# Extract all audio & subtitle tracks (or filter by type/language/id)
video tracks extract movie.mkv
video tracks extract ./movies --type subtitles --lang eng,spa --output-dir ./subs

# Remove tracks without re-encoding
video tracks remove movie.mkv --no-subtitles --output movie.clean.mkv
video tracks remove ./movies --keep-lang eng --in-place

# Update track language/name/flags in-place (instant header edit via mkvpropedit)
video tracks set-flags movie.mkv --id 1 --lang eng --name "English 5.1" --default

# Install bundled AI agent skills (e.g. video-tool)
video --install-skills
video --install-skills global --agent claude
video install-skills --list-skills
```

Add `--dry-run` to any modifying command to preview the exact `mkvmerge`/`mkvextract`/`mkvpropedit`/`ffmpeg` commands without touching any files.

---

## Running Tests

```bash
cd video
pytest
```
