logo

I replaced my Viewtron DVR's 2008-era web UI with a single Go binary

Posted by civitage |3 hours ago |1 comments

civitage 3 hours ago

My Viewtron DVR's web interface requires ActiveX/NPAPI plugins that no modern browser supports. The fallback is a sluggish WASM viewer with no speed control, and exporting clips requires a Windows-only desktop app. I built a replacement.

  It's a single Go binary with an embedded React SPA. Live streaming uses go2rtc (RTSP→MSE, no transcoding, sub-second latency). For playback, I reverse-engineered the DVR's proprietary
  binary WebSocket protocol — you get instant 1x–32x speed switching, skip controls, and frame capture. Clip export assembles frames client-side into AVI, then ffmpeg remuxes to MP4 on
  the server (stream copy, no re-encoding).

  Tech: Go stdlib net/http, SQLite (pure Go), go2rtc sidecar, React 19 + TypeScript + Zustand, WASM decoder + WebGL renderer for playback. ONVIF auto-discovery for camera setup.

  Built for Viewtron DVRs but the architecture (go2rtc for live, WS proxy for playback) could work with other DVRs that expose similar protocols. No cloud — runs entirely on your LAN.