mirror of
https://github.com/YusufB5/ASCILINE.git
synced 2026-06-17 22:35:13 +02:00
A high-performance, real-time ASCII video rendering engine. Streams binary-encoded frames via WebSockets for ultra-low latency, 60 FPS playback using HTML5 Canvas and requestAnimationFrame.
| .gitignore | ||
| app.js | ||
| ascii_video_player2.py | ||
| index.html | ||
| README.md | ||
| stream_server.py | ||
| style.css | ||
🌌 ASCILINE Engine
ASCILINE is a high-performance, real-time ASCII video rendering engine for the web. It streams video frames from a Python backend directly into a web browser at 60 FPS using binary WebSockets and HTML5 Canvas.
🚀 Key Features
- Real-Time Streaming: Low-latency video-to-ASCII conversion.
- High Performance: Uses HTML5 Canvas for rendering instead of heavy DOM elements, enabling 60 FPS playback.
- Binary Protocol: Frames are encoded into
Uint8Array(binary) for efficient bandwidth usage. - Multiple Color Modes: Supports everything from classic B&W to 16M color ultra-fidelity.
- Modern Aesthetic: Premium dark-mode UI with interactive ripple dissolve effects.
🛠️ Architecture
- Backend (Python/FastAPI): Decodes video using OpenCV, maps pixels to ASCII characters via NumPy, and streams binary data.
- Frontend (Vanilla JS): Receives binary frames via WebSockets, manages a jitter buffer, and renders to a Canvas grid.
- Communication: Optimized WebSocket protocol with a custom
INIThandshake for dynamic resolution/FPS adjustment.
📦 Installation
1. Clone the repository
git clone https://github.com/yourusername/ASCILINE.git
cd ASCILINE
2. Install dependencies
pip install fastapi uvicorn opencv-python numpy websockets
3. Run the engine
Place a video.mp4 in the root directory and start the server:
python stream_server.py
Open http://localhost:8000 in your browser.
🎨 Customization
You can easily customize the look and feel of the engine:
Styling
Edit style.css to change the accent colors and typography using CSS variables:
:root {
--accent-color: #00ff41; /* Classic Matrix Green */
--bg-color: #050505;
}
Rendering Modes
The engine supports different fidelity levels via the --mode flag:
1: Black & White (DOM mode)2: 512 Colors3: 32K Colors4: 262K Colors5: 16M Colors (Ultra)
python stream_server.py --mode 5 --cols 240 --rows 100
📜 License
MIT License. Feel free to use and abuse for your own ASCII adventures!
