utsuru is a WebRTC utility that you can use to "Go Live" on Discord using OBS, FFmpeg, or anything that supports WHIP. It also allows you to add more than one Discord call, meaning you can simultaneously broadcast the stream coming from OBS to multiple Discord calls.
This project started with my ambition to get more familiar with WebRTC.
From my observation, WebRTC is a protocol that is almost exclusively used for web app projects. At that time, I didn’t feel like making another broadcasting or video conferencing platform, so I put my ambition on hold.
Sometime later, I encountered a personal frustration while using Discord, particularly due to the lack of granular control over streams. I found it difficult to "Go Live" a specific application with system audio, or vice versa. I wished there was a way to use some kind of compositor to customize the layout of the video and audio I wanted to stream. That’s when OBS came to mind.
I discovered that I could use the "Windowed Projector" feature in OBS. With this, I could set Discord to "Go Live" a specific application and stream that OBS window. However, I felt that this solution wasn’t elegant.
I then decided to search for GitHub projects related to Discord and streaming, hoping to find something that would give me exactly what I was looking for. I came across the Discord-video-stream [1] project. While it didn’t provide the exact solution, it was close. With Discord-video-stream, I could stream local or buffered files.
However, before diving deeper into this project, I noticed a line in the project’s README that caught my attention:
For better stability it is recommended to use WebRTC protocol instead since Discord is forced to adhere to spec, which means that the non-signaling portion of the code is guaranteed to work.
This line reminded me of WebRTC and reignited my initial ambition.The Discord-video-stream project was implemented using Discord’s custom UDP protocol, accepting input in the form of a file, which it transcodes using FFmpeg before sending it to Discord. I figured that I could learn WebRTC by building a similar tool, but one that uses the standard WebRTC protocol, accepts input directly from OBS, and sends it to Discord without the need for transcoding.
I then went to see whether OBS supported streaming through the WebRTC protocol. It turns out that it does, and the terminology for it is called WHIP. I also found that I preferred the tool to be packaged as a single executable file, making distribution and deployment as simple as possible. Therefore, I decided to develop the tool in Rust, as it is the compiled language I am most comfortable writing with.
Thanks for checking out utsuru! I'd love to hear what you think.