Skip to content
ZenScape logo
Streaming & ambient media

ZenScape

A continuous live stream of ambient music and visuals, assembled from on-demand files and served from Cloudflare's edge.

Virtual live HLS Cloudflare Workers & Durable Objects TanStack Start HDR transcoding Playback sync

Ambient music and visuals, streamed live

ZenScape streams ambient music paired with cinematic visuals to help people focus, relax, and switch off. Listeners tune in to a live, continuous stream—much like radio—with the picture and sound moving together.


The challenge

Running a 24/7 live stream of synchronized music and 4K visuals raises a few hard problems:

  1. A live stream without a live encoder. A traditional live stream needs an encoder running around the clock. ZenScape needed a live stream built from files it already had, assembled into a continuous broadcast as it plays.
  2. Keeping everything in sync. Music, visual loops, the in-app player, and Google Cast devices all have to agree on what is playing and exactly where in the timeline it is.
  3. State at the edge. Playback state and listener data have to live close to users around the world, without a central database becoming the bottleneck.

What we built

We designed and built ZenScape's media delivery and the app that sits on top of it:

  • An HLS live stitcher. A custom TypeScript and Rust engine that stitches audio and video segments from on-demand files into a continuous, sliding live window—keeping sequence numbers continuous and handling multiple bitrates for adaptive streaming.
  • Edge infrastructure on Cloudflare. Cloudflare Workers, Durable Objects, and D1 hold the timeline for each stream in one place and record playback data close to listeners.
  • A new client on TanStack Start. The app was rebuilt on TanStack Start, with custom hooks that keep the player locked to the live timeline and the music and visuals in step.
  • HDR transcoding. A Python transcoding pipeline produces Dolby Vision, HDR10+, and HDR10 bitrate ladders, packaged with Shaka Packager.
System Architecture — Virtual Live HLS Pipeline Cloudflare Edge + TanStack Start
01 · TRANSCODE HDR Media Pipeline Python + FFmpeg Shaka Packager Dolby Vision / HDR10+ 02 · EDGE STORAGE On-Demand Pool Cloudflare R2 Audio & 4K chunks Zero live encoder cost 03 · LIVE STITCHER Virtual HLS Engine Workers (Rust & TS) Durable Objects + D1 Sliding .m3u8 window 04 · PLAYBACK Synced Clients TanStack Start App Google Cast Shared live timeline

The result

  • No always-on encoder. The live stream is assembled from existing files, so there is no 24/7 encoding bill.
  • Playlists served from the edge. Playlist generation and token checks run on Cloudflare Workers, close to every listener.
  • Cast that stays in sync. Playback on Cast devices follows the same clock as the app, so switching screens doesn't break the flow.

More from our work

Zenith Map logo
Astrocartography

Zenith Map

Our own astrocartography app: planetary lines on a 3D globe, from an ephemeris engine we built to NASA JPL precision, served from Cloudflare's edge.

Read next
Son of a Tailor logo
Fashion tech

Son of a Tailor

Sizing models, custom e-commerce, and production integrations for a Copenhagen brand that makes every garment to order.

Read next