Commit graph

13 commits

Author SHA1 Message Date
oneshot2001
7fa761212e
fix: top-3 review findings (decoder ordering, public-by-default, per-session state)
Frontend (app.js):
- Serialize the stateful adaptive-codec decoder through a promise chain.
  decode() awaits a real async DecompressionStream, so the previous
  concurrent .then() let a small DELTA resolve before its keyframe and
  patch a stale/null prev -> corrupt frames. Adds .catch + stale-decoder
  guard so a re-INIT drops in-flight frames from the previous segment.
- Flush frameBuffer on INIT so playlist transitions don't stall the reset
  master clock on the previous video's tail frames (or render them under
  the new renderer on a mode change).
- Request /audio?v=<idx> using the new INIT queue-index field so audio is
  correct when multiple clients are connected.

Server (stream_server.py):
- Bind 127.0.0.1 by default (--host to opt into LAN); same-origin Origin
  check before streaming (CSWSH defense that still allows LAN same-origin).
- Scope /static to an app.js/style.css/codec.js whitelist (was serving the
  whole repo: source, playlist, any local .env/notes).
- Per-session audio: INIT carries the queue index; /audio?v= reads it
  (bounds-checked) instead of the shared global current_index.
- Validate/clamp playlist+CLI mode/vol/pixel/cols/rows; guard malformed
  playlist JSON. ffmpeg gets -nostdin + terminate/kill-with-timeout.
- Re-enable WS keepalive (reap dead clients); release VideoCapture on the
  isOpened()-false path.

Adds experiments/test_decode_order.js: dependency-free regression proving
serialized decode is bit-exact + in-order and that delta-before-keyframe
throws (no video fixtures needed).

Server fixes built by Codex from a Claude spec; Claude integrated + reviewed
(tightened the Origin check to same-origin so --host 0.0.0.0 LAN mode works).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 13:01:27 -06:00
SteadyW
e58a572316
Add quality and debug options to stream server help 2026-06-13 13:03:09 +03:00
YusufB5
ad7895b054 feat: activate adaptive codec in app.js and add debug flags 2026-06-13 12:08:29 +03:00
Nate
e3f282910d feat: adaptive raw/zlib/delta frame codec (opt-in, backward compatible)
The binary protocol re-sent the full grid every frame. This adds an opt-in
per-frame codec that picks the smallest of three encodings and tags it in a
1-byte header, without changing the rendered output:

  0 RAW    framebuffer as-is (legacy)
  1 ZLIB   zlib(framebuffer)
  2 DELTA  only the cells changed since the previous frame, patched on top

Clients opt in via /ws?codec=adaptive; omitting it yields the original protocol
byte-for-byte, so existing clients are unaffected. A keyframe is forced
periodically for resync. codec.js is shared by the browser and the Node test,
so the shipped decode path is the tested one.

Optional --quality {lossless,high,balanced,low} enables lossy temporal delta
(conditional replenishment): a colour cell is only re-sent once it drifts past a
tolerance from what the viewer already sees; the character plane stays exact.
Default lossless = bit-exact.

Measured wire savings (mode 5, 200x80): static screen 0.3% of legacy (~375x),
pixel mode 11.6%, high-motion 63% (never worse). Encoder tuned (zlib level 3,
smart candidate selection) to stay well under the frame budget.

Verified bit-exact two independent ways: Python->Node vectors and a live
adaptive-vs-legacy WebSocket diff. (A fuller mutation + Autobahn conformance
harness exists on request.)
2026-06-13 02:22:29 -04:00
YusufB5
de0b92030c feat: smart cols resolution 2026-06-11 14:25:36 +03:00
YusufB5
e758423338 feat: Core engine V2 (A/V Sync, Zero-Copy Pixel, FPS Decimation) & CLI shortcuts 2026-06-07 23:16:25 +03:00
YusufB5
8b31a7450a feat: Add auto-scaling rows, pixel mode flag, and command loop 2026-06-05 23:20:25 +03:00
YusufB5
2108a34bb7 fix: resolve video path for single video argument (videos/ subfolder lookup) 2026-06-04 17:06:32 +03:00
YusufB5
5fad7c5aa9 feat: server-side volume control feature added, playlist & folder video management 2026-06-04 16:14:23 +03:00
YusufB5
2043a7bb37 feat: add invisible selection layer, audio streaming, and updated manifesto for pure performance mode 2026-05-05 13:51:27 +03:00
YusufB5
e7002173c2 Improve error handling and translate messages to English 2026-05-03 21:36:14 +03:00
YusufB5
95a3029679 docs: Update README with strategic vision, translate comments to English, add custom MIT License 2026-05-03 13:49:22 +03:00
YusufB5
7cd84b657b Initial commit: ASCILINE Engine - Modular & Optimized 2026-05-02 14:36:22 +03:00