Metadata-Version: 2.5
Name: captionkit
Version: 0.1.0
Summary: Local-first CLI that makes accurate captions for any video or audio in 90+ languages with Whisper — no cloud, no paid APIs.
Project-URL: Homepage, https://github.com/abubakar60675/captionkit
Project-URL: Repository, https://github.com/abubakar60675/captionkit
Project-URL: Issues, https://github.com/abubakar60675/captionkit/issues
Project-URL: Changelog, https://github.com/abubakar60675/captionkit/blob/main/CHANGELOG.md
Author: Muhammad Abubakar
License-Expression: MIT
License-File: LICENSE
Keywords: accessibility,ass,audio,captions,srt,subtitles,transcription,video,vtt,whisper
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: faster-whisper>=1.0.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# CaptionKit

**Local-first CLI that makes accurate captions for any video or audio in 90+ languages with Whisper — no cloud, no paid APIs.**

CaptionKit runs entirely on your machine. Your media never leaves your computer. It uses [faster-whisper](https://github.com/SYSTRAN/faster-whisper) for transcription and ffmpeg for burning captions into video — both free and open source.

<p align="center">
  <img src="https://raw.githubusercontent.com/abubakar60675/captionkit/main/assets/demo-terminal.gif" alt="CaptionKit terminal demo" width="700">
</p>

<p align="center">
  <img src="https://raw.githubusercontent.com/abubakar60675/captionkit/main/assets/demo-burn.gif" alt="CaptionKit karaoke burn demo" width="280">
</p>

## Why CaptionKit?

- **Free forever** — no API keys, no subscriptions, no usage limits
- **Private** — your files never leave your machine
- **Offline** — works without an internet connection (after model download)
- **Accurate** — powered by OpenAI's Whisper model via faster-whisper
- **90+ languages** — auto-detects the language or use `--language` to specify
- **Multiple formats** — outputs SRT, VTT, ASS, and JSON with word-level timestamps
- **Burn captions into video** — styled presets for YouTube Shorts, Reels, TikTok
- **Karaoke mode** — word-by-word highlight captions for short-form content
- **RTL and CJK support** — proper rendering for Arabic, Hebrew, Chinese, Japanese, Korean
- **Batch processing** — caption an entire folder in one command

## Install

Requires Python 3.10+ and ffmpeg.

```bash
# Install ffmpeg (if not already installed)
# macOS:   brew install ffmpeg
# Ubuntu:  sudo apt install ffmpeg
# Windows: https://ffmpeg.org/download.html

# Install from PyPI
pip install captionkit

# Or with pipx (isolated install)
pipx install captionkit
```

For GPU acceleration (optional):

```bash
# NVIDIA CUDA
pip install captionkit ctranslate2 nvidia-cublas-cu12 nvidia-cudnn-cu12
```

## Quick start

### Transcribe a file

```bash
# Auto-detect language, output SRT + VTT + ASS + JSON
captionkit transcribe video.mp4

# Specify language
captionkit transcribe podcast.mp3 --language en

# Use a larger model for better accuracy
captionkit transcribe interview.wav --model large-v3

# Translate to English
captionkit transcribe video_french.mp4 --translate
```

### Burn captions into video

```bash
# Clean captions for landscape video
captionkit burn video.mp4

# TikTok-style with karaoke highlighting
captionkit burn video.mp4 --preset tiktok-karaoke

# YouTube Shorts preset
captionkit burn video.mp4 --preset shorts

# Custom styling
captionkit burn video.mp4 --font "Noto Sans" --font-size 28 --position top
```

### Batch process a folder

```bash
# Transcribe all media files in a folder
captionkit batch ./videos/ --mode transcribe

# Burn captions into all videos with Reels preset
captionkit batch ./videos/ --mode burn --preset reels-karaoke
```

### List available presets

```bash
captionkit presets
```

## Presets

| Preset | Aspect | Karaoke | Use case |
|--------|--------|---------|----------|
| `clean` | 16:9 | No | Standard landscape video |
| `minimal` | 16:9 | No | Low-profile captions |
| `shorts` | 9:16 | No | YouTube Shorts |
| `shorts-karaoke` | 9:16 | Yes | YouTube Shorts with word highlighting |
| `reels` | 9:16 | No | Instagram Reels |
| `reels-karaoke` | 9:16 | Yes | Instagram Reels with word highlighting |
| `tiktok` | 9:16 | No | TikTok |
| `tiktok-karaoke` | 9:16 | Yes | TikTok with word highlighting |

## Model sizes

| Model | Parameters | English | Multilingual | Speed | VRAM |
|-------|-----------|---------|-------------|-------|------|
| `tiny` | 39M | Good | Okay | Fastest | ~1 GB |
| `base` | 74M | Good | Good | Fast | ~1 GB |
| `small` | 244M | Great | Good | Moderate | ~2 GB |
| `medium` | 769M | Great | Great | Slow | ~5 GB |
| `large-v3` | 1550M | Best | Best | Slowest | ~10 GB |

Default is `base` — a good balance of speed and accuracy. Use `tiny` for quick drafts, `large-v3` for final production.

## Language support

CaptionKit supports 90+ languages through Whisper, including but not limited to:

**Latin script:** English, Spanish, French, German, Portuguese, Italian, Dutch, Polish, Turkish, Vietnamese, Indonesian, Malay, Swahili, and many more

**Arabic script:** Arabic, Urdu, Persian, Pashto

**CJK:** Chinese (Simplified & Traditional), Japanese, Korean

**Devanagari:** Hindi, Marathi, Sanskrit, Nepali

**Other scripts:** Thai, Greek, Russian, Ukrainian, Georgian, Armenian, Hebrew, Bengali, Tamil, Telugu, Kannada, Malayalam, Burmese, Khmer, Lao

Language is auto-detected by default. Use `--language <code>` to specify (e.g., `--language ar` for Arabic, `--language zh` for Chinese).

### RTL and CJK rendering

When burning captions, CaptionKit uses font fallback to find appropriate fonts for the detected script. For best results with RTL or CJK content, install [Noto fonts](https://fonts.google.com/noto):

```bash
# Ubuntu/Debian
sudo apt install fonts-noto fonts-noto-cjk fonts-noto-color-emoji

# macOS (via Homebrew)
brew install font-noto-sans font-noto-sans-cjk
```

## Output formats

| Format | Extension | Word timestamps | Use case |
|--------|-----------|----------------|----------|
| SRT | `.srt` | Segment-level | Most video players and editors |
| WebVTT | `.vtt` | Segment-level | Web video, HTML5 `<track>` |
| ASS | `.ass` | Word-level (karaoke) | Advanced styling, burning |
| JSON | `.json` | Word-level | Programmatic access, custom tools |

## Development

```bash
git clone https://github.com/abubakar60675/captionkit.git
cd captionkit
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest -v

# Lint
ruff check src/ tests/
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contribution guide.

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for release history.

## Roadmap

See [ROADMAP.md](ROADMAP.md) for planned features and `good first issue` ideas.

## License

[MIT](LICENSE) — free for personal and commercial use.
