ASCII Camera captures a live camera feed in a worker thread, converts each frame to ASCII art, and streams it to the main thread for rendering — all over postal’s MessagePort transport. Toggle between monochrome and 24-bit ANSI color modes with a keystroke.
The worker captures camera frames via ffmpeg and publishes them as camera.frame messages.
The main thread subscribes and renders. The transport handles the heavy lifting — frames
flow as regular postal envelopes across the thread boundary.
Bidirectional control
The main thread publishes camera.control messages to change FPS, toggle color mode, or
signal quit. The worker subscribes and reacts mid-stream. Same transport, both directions —
postal transports are full-duplex by default.
Wiretap FPS counter
A wiretap on the main thread counts camera.frame envelopes per second to compute an
independent FPS measurement for the HUD — without subscribing to the topic or modifying the
publisher. Observability without coupling.
Backpressure by design
If the worker produces frames faster than the main thread can render, it drops the frame
rather than queuing. Latest-wins is the right semantics for live video — and postal’s
fire-and-forget publish makes this trivial.