Metadata-Version: 2.4
Name: vtoa
Version: 0.1.0
Summary: Convert any video to ASCII art playable in your terminal
Author-email: Tanmay Sachan <tnmysachan@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/yourusername/vtoa
Project-URL: Repository, https://github.com/yourusername/vtoa
Keywords: video,ascii,terminal,cli,art
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Topic :: Multimedia :: Video
Classifier: Topic :: Artistic Software
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python>=4.5.0
Requires-Dist: numpy>=1.19.0
Requires-Dist: yt-dlp>=2023.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# vtoa

**Video to ASCII** — Convert any video to ASCII art playable in your terminal.
[Fully vibecoded btw]

```
@@@@@@@@@@%%%%%%%%%%%%%@@@@@@@@@
@@@@@@##*+=-:..   ..::-=+*##@@@@
@@@@%#*+=-:.           .:-=+*#%@
@@@%#*+-:.               .:-+*#%
@@%#*+-:                   :-+*#
@%#*+-.       .::::::.       -+*
%#*+-.      .:-======-:.     .-+
#*+-       .:-+*####*+=-:.     -
*+-       .:-+*#%%%%#*+=-:.    .
+-.      .:-+*#%@@@@%#*+=-:.   .
-.      .:-+*#%@@@@@@%#*+-:.    
       .:-+*#%@@@@@@@@%#*+-:.   
```

## Installation

```bash
pip install -e .
```

Or install dependencies directly:

```bash
pip install opencv-python numpy
```

## Quick Start

### Command Line

```bash
# Play a video with default settings
vtoa video.mp4

# Specify output width
vtoa video.mp4 --width 120

# Use block characters for denser output
vtoa video.mp4 --preset blocks

# Invert for light terminal backgrounds
vtoa video.mp4 --invert

# Loop continuously
vtoa video.mp4 --loop

# Custom character set
vtoa video.mp4 --chars "@#*+=-. "
```

### Python API

```python
from vtoa import play_video, AsciiPlayer, AsciiConverter
import cv2

# Simple one-liner
play_video("video.mp4")

# With options
play_video(
    "video.mp4",
    width=100,
    invert=True,
    loop=True
)

# Using the player class
player = AsciiPlayer("video.mp4", width=80)
print(f"Duration: {player.duration:.1f}s")
print(f"Frames: {player.frame_count}")
player.play()

# Process frames manually
player = AsciiPlayer("video.mp4")
for frame in player.frames():
    print(frame.content)
    print(f"Timestamp: {frame.timestamp:.2f}s")
    break  # Just show first frame

# Convert a single image/frame
from vtoa import frame_to_ascii
image = cv2.imread("image.jpg")
ascii_art = frame_to_ascii(image, width=60)
print(ascii_art)
```

## Character Presets

| Preset | Characters | Best For |
|--------|------------|----------|
| `detailed` | `@%#*+=-:. ` | General use, good detail |
| `simple` | `@#=-. ` | Faster rendering |
| `blocks` | `█▓▒░ ` | Dense output, block style |

## CLI Options

```
usage: vtoa [-h] [-V] [-w WIDTH] [-H HEIGHT] [-p {detailed,simple,blocks}]
            [-c CHARS] [-i] [-l] [-s] video

positional arguments:
  video                 Path to the video file

options:
  -h, --help            Show this help message and exit
  -V, --version         Show version number and exit
  -w, --width WIDTH     Output width in characters
  -H, --height HEIGHT   Output height in characters
  -p, --preset PRESET   Character preset (detailed/simple/blocks)
  -c, --chars CHARS     Custom character set (dark to light)
  -i, --invert          Invert brightness mapping
  -l, --loop            Loop the video
  -s, --no-status       Hide the status bar
```

## How It Works

1. **Read** — OpenCV reads video frames
2. **Grayscale** — Convert each frame to grayscale
3. **Resize** — Scale to fit terminal dimensions (adjusting for character aspect ratio)
4. **Map** — Map pixel brightness values to ASCII characters
5. **Display** — Render frames with proper timing to maintain video speed

## Requirements

- Python 3.8+
- OpenCV (`opencv-python`)
- NumPy

## License

MIT

