Initial commit: ASCILINE YouTube Streamer

ASCII-art YouTube streaming for the Tesla in-car browser.

- FastAPI server on a Mac mini, no Docker.
- yt-dlp resolver: ID/URL/search.
- ffmpeg with -re -fps_mode cfr for source-paced video; trivial drain
  consumer.  Separate ffmpeg for AAC/ADTS audio.
- Vendored ASCILINE renderer (MIT) for the binary wire protocol; pure
  fillText color path, on-demand selection flush.
- HMAC PIN-gated cookie; Secure flag scheme-aware so /audio works on
  plain http during local dev.
- LOW preset (120x50 24fps) verified clean on M4: FPS 24/24, JIT ~42ms.
This commit is contained in:
Erhan Keseli
2026-06-13 18:05:19 +02:00
commit 74f49c7712
21 changed files with 4127 additions and 0 deletions

33
config.py Normal file
View File

@@ -0,0 +1,33 @@
"""Quality presets and server defaults.
Preset change requires re-Play (server restarts ffmpeg with new scale).
"""
PRESETS = {
"low": {
"cols": 120,
"rows": 50,
"fps_cap": 24,
"mode": 2, # 512 colors
},
"med": {
"cols": 160,
"rows": 68,
"fps_cap": 30,
"mode": 3, # 32K colors
},
"high": {
"cols": 200,
"rows": 84,
"fps_cap": 30,
"mode": 3, # 32K colors
},
}
DEFAULT_PRESET = "low"
SERVER_DEFAULTS = {
"port": 8000,
"bind": "0.0.0.0",
"max_source_height": 720,
}