DEV Community

Pascal Clément
Pascal Clément

Posted on

How I built a 24/7 YouTube livestreaming SaaS with Spring Boot, FFmpeg & Imagen

How I built a 24/7 YouTube livestreaming SaaS with Spring Boot, FFmpeg & Imagen

Running a 24/7 YouTube stream sounds simple until you actually try it. OBS crashes. The machine sleeps. The stream drops.

I built IteraMachina to solve this — a SaaS platform where you compose scenes, build playlists, and stream to YouTube Live forever, fully managed in the cloud.

The Architecture

  • Angular SSR frontend — Scenes, Compositions, Runner in a 3-column layout
  • Spring Boot 3.x backend — SceneService, CompositionService, RenderService, StreamService
  • Imagen AI — generates visuals per scene from a text prompt
  • FFmpeg — assembles video from scenes + audio, streams via RTMP to rtmp://a.rtmp.youtube.com/live2
  • PostgreSQL — scenes, compositions, streams
  • Stripe — Basic / Pro subscription plans
  • Docker on Linode

The Workflow

  1. Create scenes (image prompt + audio track)
  2. Arrange scenes into a composition
  3. Add compositions to a playlist (drag & drop reorder)
  4. Hit Run — the stream starts and loops indefinitely

The trickiest part: @async + @Transactional

The render pipeline is async — FFmpeg can take minutes. The trap: Spring's @Async and @Transactional can't live on the same method or the transaction context doesn't propagate correctly.

Solution: split into three distinct methods — loadScenes() (@Transactional readOnly), setStatus() (@Transactional), renderAsync() (@async only). Took longer to debug than I'd like to admit.

What's next

Plan limits enforcement (Basic: 1 project, 3 scenes), Stripe customer portal, and community scene sharing.

Live at 👉 iteramachina.com — built under the Umbrincraft umbrella.

What would you add to a streaming SaaS like this? Curious what use cases others see.

Top comments (0)