arm
  • Home
  • Work
  • About
  • Writing
  • Resume
  • Contact
Open to work
← Back to writing
EngineeringVol. 02 · Issue 04 · 7 min read
The HLS pipeline I built and what I would change.
Mar 2026 · Parmjeet Mishra

My client Amarjeet is a professional video editor. He needed a portfolio that could stream cinematic 4K footage smoothly, handle multiple videos simultaneously, and look as premium as his work.

This is what I built: FFmpeg → BullMQ → Cloudflare R2 → HLS adaptive streaming. And here is what I would change.

The pipeline

  • Upload: Client uploads a source video via a signed URL directly to Cloudflare R2 (bypasses the server entirely for large files)
  • Queue: Upload completion triggers a BullMQ job in the Hono backend
  • Transcode: A worker processes the job with FFmpeg — outputs multiple quality tiers (360p, 720p, 1080p) as HLS segments + a master playlist
  • Store: Segments go back to R2 under a structured path
  • Stream: The player reads the master playlist and adapts quality to the viewer's connection
"Building the pipeline took a week. Making it reliable took three more."

The three things I would change

1. Move transcoding to a dedicated worker process. I ran FFmpeg inside the main Hono process — fine for low traffic, but it blocks the event loop during heavy encodes. Next time: separate worker service, separate machine.

2. Add job progress streaming. The upload UI shows a spinner until transcoding is done. That is fine but a progress bar streamed via SSE would be far better UX for long encodes.

3. Use Cloudflare Stream instead. Cloudflare Stream handles transcoding, storage, and CDN delivery in one service. I built the pipeline from scratch to learn — but for a production client project with a deadline, I would use Stream and focus on the UI instead.

Written by Parm

Full-Stack React Developer building SaaS and usuable apps.

Next piece
From science teacher to developer →
Open to work

Have something in mind? Let's make it.

iamparmjeetmishra@gmail.com→
GithubMailLinkedInX/Twitter
arm© 2026 — Made with ♡ by Parm
HomeWorkAboutWritingResumeContact