Convert any video to ASCII art playable in your terminal
Project description
vtoa
Video to ASCII — Convert any video to ASCII art playable in your terminal. [Fully vibecoded btw]
@@@@@@@@@@%%%%%%%%%%%%%@@@@@@@@@
@@@@@@##*+=-:.. ..::-=+*##@@@@
@@@@%#*+=-:. .:-=+*#%@
@@@%#*+-:. .:-+*#%
@@%#*+-: :-+*#
@%#*+-. .::::::. -+*
%#*+-. .:-======-:. .-+
#*+- .:-+*####*+=-:. -
*+- .:-+*#%%%%#*+=-:. .
+-. .:-+*#%@@@@%#*+=-:. .
-. .:-+*#%@@@@@@%#*+-:.
.:-+*#%@@@@@@@@%#*+-:.
Installation
pip install -e .
Or install dependencies directly:
pip install opencv-python numpy
Quick Start
Command Line
# 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
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
- Read — OpenCV reads video frames
- Grayscale — Convert each frame to grayscale
- Resize — Scale to fit terminal dimensions (adjusting for character aspect ratio)
- Map — Map pixel brightness values to ASCII characters
- Display — Render frames with proper timing to maintain video speed
Requirements
- Python 3.8+
- OpenCV (
opencv-python) - NumPy
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vtoa-0.1.0.tar.gz.
File metadata
- Download URL: vtoa-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51e904535436ea8b2c2cb61d54b3024741ff65b2d4c3564259b9fc1904a39334
|
|
| MD5 |
cedef543db7d72436fb618614eaab2b6
|
|
| BLAKE2b-256 |
146d8598d4300877f5df089b47e1e31d1bc4126c0da4296d1c7f35aa25186e66
|
Provenance
The following attestation bundles were made for vtoa-0.1.0.tar.gz:
Publisher:
publish.yml on tanmaysachan/vtoa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vtoa-0.1.0.tar.gz -
Subject digest:
51e904535436ea8b2c2cb61d54b3024741ff65b2d4c3564259b9fc1904a39334 - Sigstore transparency entry: 798183703
- Sigstore integration time:
-
Permalink:
tanmaysachan/vtoa@cbf1a4731a334fabd01be19ddd111c85be641477 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/tanmaysachan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbf1a4731a334fabd01be19ddd111c85be641477 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vtoa-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vtoa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bd7f9b9445a1e4faae0e94f99a43e0aa63a425d20094241f7e58245f7e445e8
|
|
| MD5 |
530944e53533cf2897bbb9b9fc2806d8
|
|
| BLAKE2b-256 |
b7d944859cf760e7d7c29a8e34367dfa6a1861d9e543e99fb8a03f928cf4ce57
|
Provenance
The following attestation bundles were made for vtoa-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on tanmaysachan/vtoa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vtoa-0.1.0-py3-none-any.whl -
Subject digest:
7bd7f9b9445a1e4faae0e94f99a43e0aa63a425d20094241f7e58245f7e445e8 - Sigstore transparency entry: 798183705
- Sigstore integration time:
-
Permalink:
tanmaysachan/vtoa@cbf1a4731a334fabd01be19ddd111c85be641477 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/tanmaysachan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbf1a4731a334fabd01be19ddd111c85be641477 -
Trigger Event:
release
-
Statement type: