
Interactive DJ Live Streaming: Hybrid WebRTC and RTMP
A 2020 lockdown startup: a DJ's live broadcast over RTMP, with a VJ mixing in guests' WebRTC video calls from home. Piloted live from an empty bar.
In short: in the 2020 lockdowns DJs streamed their sets, and fans watched them alone at home. To fix that, I built a startup proof of concept: guests turn their cameras on, and a VJ puts the best of them on air next to the DJ.
Video calls over WebRTC were instant but warped the music, broadcasts over RTMP sounded right but lagged, so the design that worked used both. More challenges and lessons below.
| Project | DJVID, interactive DJ live streaming for remote parties |
|---|---|
| Years | 2020, April to July |
| My role | Came up with the startup idea and led the R&D team |
| Team | Solution architect, lead software engineer for web and mobile, DevOps engineer, two frontend engineers, R&D engineer, product designer, streaming advisor, an organiser and a DJ |
| Stage | Piloted proof of concept |
| Tech | WebRTC, RTMP, HLS, OBS, Mux, Twilio Video, Red5 Pro, Jitsi, React, React Native, Firebase, nginx, YouTube Live, Vimeo |
| Outcome | Failed: the market lasted only as long as the lockdowns |
Why
In spring 2020 nightlife stopped. I missed going out, and my DJ friends missed playing. Back then I ran dvhb, a startup R&D studio that designed, built and launched startups for clients and for itself (more of them here), and DJVID was one of its own ideas. Every DJ moved online, and some live streams were spectacular, like David Guetta's set from a Miami rooftop.
But a DJ set is more than the music, whether it's in a club, a bar or at a pre-party. It's the people around you: dancing together, running into friends, talking, the energy of the room. On a stream you are completely alone. Friends of mine threw an online party with a great location, lights and a camera crew. It looked stunning, but all you could do was watch, so I never went to the next one. A chat window is not a crowd. The sound was poor too: Instagram Live, where many DJs played, caps audio at 128 kbit/s.

One night I was watching my mate DJ Aver play requests on Instagram, and wrote to him afterwards:
Misha shouted “everybody together!” A club would roar. Here nobody roars. We'll make everyone roar.
So the question was: what if the people partying at home became part of the stream?
The idea

Think of a DJ party crossed with Chatroulette: random people partying at home pop up on air next to the DJ. Viewers on a laptop or a TV see a party, not one person behind the decks. The VJ picks whoever is having the most fun, with good light, a good frame and a steady connection.

How many people fit on one screen
To make watching rich, I wanted the picture on air to keep changing through the set, so the app needed several interactive layouts. Each had to work on every screen and camera: a laptop, a phone in portrait, a phone in landscape.
That gave the app a set of problems to solve: a queue of people waiting to go on air, a layout that falls back to however many are streaming, and a 5-4-3-2-1 countdown before anyone goes live. If someone's phone went to sleep, the next in line took the slot, so the screen never turned black.
Most partygoers would join from their phones, so our designer worked through small screens, front and rear cameras, and how people hold a phone.
At first I asked everyone to hold the phone in landscape. That was a mistake: people hold a phone in portrait, especially while they dance with it. We redesigned the app around portrait, with the DJ's picture framed to fit both ways.
A weekend that took eleven weeks
The plan was a quick experiment over one weekend (vibe coding didn't exist yet). Every easy route failed in its own way:
- · April 5ZoomPoor sound, no VJ controlsI tried it with friends the first night. Zoom squeezes the sound, and the host of a video conference can't choose what viewers see.
- OBS and Mux40 s delayOBS mixed the stream and Mux, a video streaming service, sent it out. The music reached a phone at home 40 seconds late, and the dancing came back later still.
- Red5 ProTwo weeks, no resultOur own video server, picked over Wowza, couldn't show the DJ and a guest in one window on a phone.
- Twilio VideoMusic wobbledPicked over TokBox and Jitsi. Our own little Zoom worked in two weeks, then the beat started to drift.
- The hybridWorkedThe DJ broadcasts to YouTube or Vimeo and guests send video only through Twilio.
- · June 20The pilotOne eveningA live set from an empty bar, with a real crowd at home.
The solution was to stop asking one technology to do two jobs:
The DJ broadcasts from OBS to YouTube or Vimeo, like most DJs did in 2020, with full sound quality. Around that broadcast we built a separate video room where guests send only their video, no sound. On a weak connection WebRTC lowers a guest's video quality to keep up, but it never touches the music. The details are under the hood, at the end of the page.
Getting the DJ on air
The DJ's side was a challenge of its own: broadcasting had to be easy for a DJ, not an engineer, and carry the sound straight from the mixer. We tried two setups:
- Plan A: a phoneNo line-inThe DJ's mixer can feed an iPhone over a cable, but the Vimeo app only hears its own microphone.
- Plan B: a laptopWorkedSound from the DJ mixer through a sound card into OBS, an iPhone as the camera. In 2020 encoding Full HD was heavy for a laptop: a 2016 MacBook Pro dropped frames. The broadcast also needs about 7 Mbit/s of upload.
You can't test a party alone
The hardest part wasn't the code. A party can't be designed or tested by one person at a desk. The minimum test session:
The pilot
On Saturday, June 20, at 11 pm, DJ Aver streamed a one-hour set from an empty bar. He had invited a closed group of about 30 fans to join the live broadcast from home.

Analytics showed 24 online at the peak, and five guests got into the video room that streams their dancing back. The stream hung once and had to be restarted, and video from phones on mobile data was choppy. In our team chat that night:
The biggest surprise came at the door. The invitations went out in Instagram stories and messengers, and people opened the link right there, in the app's built-in browser, where the stream couldn't run at all. They decided the whole thing was broken:
- Safari59
- Chrome17.9
- Safari inside another app: nothing worked17.1
- Firefox4
- Android WebView2
Shares read off the site analytics chart. Firefox and Android WebView are approximate.
So at least 17% of visitors never saw a thing. Even in a proper browser, the sound didn't always start on its own, and two guests on the same evening had opposite experiences:
That's what a proof of concept was for: one evening showed problems no amount of design would have found.
What the guests said
After the set, we surveyed everyone who came and counted every comment:
- The app didn't work or glitched6
- Stream delay4
- No sound (it had to be switched on)4
- Loved it4
- Wants a chat3
- Poor quality of guests' video3
Plus one mention each: masks and effects, donations, a way to reach the DJ, seeing more people, a portrait layout, the camera's orientation, the rear camera, good sound and the party atmosphere.
Their messages:
Our own wish list: a view of everyone who was dancing, voting for who goes on air, so the crowd chooses and not only the VJ, and an app that plays the party on speakers or a TV.
And one partygoer put the whole evening in capitals:
TALK TO THE CROWD. NOBODY CARES ABOUT THE MUSIC.
What I learned
From dance floors to drilling rigs
The deep dive into video streaming paid off a couple of months later, when I started a real-time computer vision proof of concept on a working drilling rig, where CCTV streams had to be read on the spot. Knowing how a video stream gets from a camera to a screen, where delay comes from and what technology can and can't fix made the architecture decisions much faster. The same experience went into later work, such as a sub-second system that reads live screen streams.
Where it got to
After the pilot we packed the web app into a cross-platform mobile app, to test the technology for a commercial project. By early July client work had taken over and the clubs were reopening. I had hoped remote parties would keep a niche audience once the clubs reopened, but demand lasted only as long as the lockdowns, so I stopped.
Under the hood: delay, codecs and architecture
Why latency was the first wall
The first prototype mixed the DJ's video and sound in OBS with a browser window showing the stream of the guest the VJ had picked, and sent it through Mux, a hosted streaming service. The music reached a phone about 40 seconds late, because it used broadcast protocols:
- RTMP in, HLS out: the server cuts the stream into segments several seconds long, and every player buffers a few of them before it starts. Picture and sound stay smooth for every viewer, and the delay adds up to tens of seconds.
- WebRTC sends media over UDP and doesn't wait for late packets: it conceals or drops them and lowers the bitrate instead. Delay stays under a second, and quality is the first thing to give.
Guests dancing to the DJ and coming back on air needed the sub-second world, so WebRTC. That ruled out mixing in OBS: in 2020 it had no WebRTC output, and nothing it could send played in a browser with sub-second delay.

Red5 Pro, then Twilio
We started with our own WebRTC media server, Red5 Pro (we had also looked at Wowza). Within two days a phone streamed to a browser with less than a second of delay. Then progress stalled. The case that mattered was three phones at once: the first streams, the second plays the first and streams itself, the third plays both. Our first guest app was in React Native, and Red5's SDK for it kept failing on iOS with encoding errors, refused connections and black screens, while in the browser only Safari showed the video. The bottleneck was the mobile SDK, not the server. After two weeks a technical council decided to switch rather than keep tuning.
We looked at TokBox and at running Jitsi ourselves, and picked Twilio Video, a hosted service, after the CTO of an online tutoring platform showed us how far they had customised it. The VJ's control came down to subscriptions: everyone streams into one room, but each role receives only some of the tracks. The VJ receives every guest's video, and everyone else receives only the DJ and the guests on air. The delay stayed under a second.
Why the music wobbled
The first audio was thin for a simple reason: our app's settings capped it at 12 kbit/s. We raised it to 256 kbit/s, and the music still sped up and slowed down slightly. We ruled causes out one by one:
- The route: a Twilio region closer to us, Frankfurt instead of the US, made the lags rarer but didn't stop them. Peer-to-peer, without Twilio's media server, lagged too.
- Bandwidth and codecs: cutting the audio bitrate to 128 kbit/s, turning video off and forcing the VP8 or H.264 video codec didn't fix it.
- Our side: we ruled out the virtual audio cable and the DJ's mixer. Comparing a direct cable with Twilio showed something else: panning the balance moved the sound over the cable but not through Twilio, so the stream arrived in mono.
- Other apps: music looped through Zoom, Skype, Jitsi and Google Meet wobbled in all of them, FaceTime the least.
The lags tracked packet loss, not network jitter. When packets go missing, WebRTC's jitter buffer covers the gap and stretches or squeezes the audio to keep the delay low. Nobody notices it in a voice, but in music every beat drifts. Of WebRTC's codecs only Opus suits music at all, and these apps tune it for speech.

The hybrid

- The DJ streams over RTMP from OBS: no wobble, 256 kbit/s audio and any platform. First YouTube Live, then Vimeo, to get rid of YouTube's player controls on a small screen. As a player, Vimeo was the best of what we tried.
- Guests join a Twilio video room around that stream, video only, with audio turned off on every guest track. Their video can degrade without spoiling the music.
- Everyone sees the DJ with a similar delay, which mattered more than a short delay. On YouTube the players drifted apart by up to 30 seconds between devices, which made testing hard. On Vimeo the spread came down to 1 to 2 seconds. Mobile browsers don't autoplay video with sound, so guests had to tap to unmute.
- One room holds 50 participants: the DJ, the VJ, a restreamer and up to 47 guests who stream. The plan was for everyone else to watch a cheap restream, on the site, YouTube or Instagram, and join the room only to go on air.
What I'd do today
- Align, don't chase delay. Each guest hears the DJ with a different delay and their video comes back later still, so even with WebRTC a guest on air dances off the beat. The fix is a common timeline: the guest's app stamps every camera frame with the DJ stream position it was playing, and the server composes the broadcast a few seconds behind, placing each guest on the beat they danced to. Viewers never notice a few seconds of broadcast delay. It needs your own player with timestamps, not an embedded YouTube or Vimeo player.
- Tune WebRTC for music where you need it: stereo Opus at a high bitrate, voice processing off, a larger jitter buffer.
- Use what exists now: OBS can publish over WebRTC (WHIP) since version 30, and open-source media servers such as LiveKit compose a room into one stream and restream it over RTMP or HLS. In 2020 this was research. Today, with off-the-shelf media servers and AI coding agents, a working prototype takes days.
- Test like it's live. AI agents speed up the code, not the testing. Real-time video still needs several people on real phones, real mobile networks and in-app browsers, plus simulated clients to fill the room and emulated networks with packet loss and jitter. Plan that time from the start.
Working with live video or real-time computer vision?

R&D consultant, computer vision AI
If you need computer vision that reads camera or screen streams in real time, or a live video product tested before you build it, I can help you prove it with a quick proof of concept.