← go back 'blog'
My Only Chance to Stream This Right
The Disgraceful Platform
Once upon a time (a few days ago, actually), a friend of mine wanted to show me a video game he's been interested in lately, so we started a voice call on Discord since that platform supposedly has great real-time streaming aimed at this stuff specifically.
The only problem was... it looked like this:

It couldn't handle the audio stream together with video for some reason. Without it, everything was relatively fine, but sound is a very integral part of the experience. We didn't want to compromise on this factor, so we needed to find a solution.
Initially, we settled on using SRT via Wireguard with OBS on the streaming end and mpv on the receiving end. This worked well enough for our use case with reasonable latency as well as minor random connection / packet ordering issues (it is UDP-based after all). It did not allow for multi-client streaming (broadcasting), however; that would require a separate multiplexer program. We discussed creating such an app and, more importantly, decreasing latency as much as we could, but ultimately thought it was not worth the effort.
Salvation
The next day, when I powered on my PC after returning home, I saw a message saying (paraphrased):
I figured it out. Now we can broadcast video via HTTP, even to a browser, with minimal latency.
I was positively surprised, and asked how this was achieved. We talked, I got an explanation and we went back to the game, this time without SRT and Wireguard.
A tl;dr of what I saw would be that it was the best live stream I'd ever viewed. Not a single error in mpv, not one dropped frame, just a beautiful video feed of near native quality. Low latency too. (frame generation users would be jealous /s) I reckon it was very similar to Discord's voice latency, making everything 'click.' This was already delightfully promising, but there were some things I wanted to try with the broadcaster code, particularly simplifying it, so I started work on a 'fork.' (rhyme not intended)
Iteration
I did not improve upon the app a lot really, I merely rewrote it to more synchronous and multithreaded Rust
to make it a bit simpler and tested it with a few people at once to see if it would work.
I also got rid of browser support, since anything lesser than mpv wouldn't be useful for this anyway.
It was great, actually! Just make sure to avoid rapidly moving foliage set a higher QP / CRF value with a
bitrate limit to avoid queue overflow problems and glitches.
There is a reason why pretty much all platforms put restrictions on it...
Something like this already unlocks tons of possibilities, especially since it's OBS. If you'd like to try it yourself, here is my version of the broadcaster app. I'll try to improve the code and add some features (like passphrase protection) in the coming days.
See you around.
2025-03-07