August 3rd, 2024

Go Donut: Convert Live Streaming to WebRTC

Donut connects SRT and WebRTC for real-time media streaming in browsers. Users can set up streaming via a web interface, requiring ffmpeg and offering Docker-Compose support for easy installation.

Read original articleLink Icon
Go Donut: Convert Live Streaming to WebRTC

donut is a tool that connects SRT (Secure Reliable Transport) and WebRTC, enabling real-time media streaming directly in browsers without requiring extensive setup. Users can initiate streaming by entering the necessary protocol, host, port, ID, and options in a web interface. Once the "Connect" button is clicked, a WebRTC connection is established, allowing asynchronous media streaming to the browser.

To get started, users need to have ffmpeg version 5.x.x installed. They must set the CGO library path to their ffmpeg installation and then install and run donut using Go commands. Alternatively, donut can be run using Docker-Compose with a simple command.

The web interface can be accessed at http://localhost:8080/demo, where users can input their streaming details. Additional resources are available, including a Mac Development Guide for specific instructions and a FAQ section for troubleshooting common issues. This setup provides a straightforward way to stream media from SRT and RTMP sources to WebRTC-enabled browsers, making it accessible for users looking to implement real-time media solutions.

Related

Sharedrop: Easy P2P file transfer powered by WebRTC – inspired by Apple AirDrop

Sharedrop: Easy P2P file transfer powered by WebRTC – inspired by Apple AirDrop

ShareDrop is a GitHub web app like Apple AirDrop, facilitating secure file transfers via WebRTC and Firebase. It allows local and cross-network transfers, supports various browsers, and offers donation options. Setup and deployment guidance are provided.

Ditto: Build Your Community on Nostr

Ditto: Build Your Community on Nostr

Alex Gleason releases Ditto, a Nostr community server combining Mastodon features with enhancements for Nostr users. It offers moderation tools, spam filters, NIP-05 self-service, lightning network transactions, and more. Built with Deno and TypeScript.

rrweb – record and replay debugger for the web

rrweb – record and replay debugger for the web

rrweb.io is an open-source web session replay library enabling remote replay of website interactions. It supports user analysis, bug reproduction, demos, and collaboration. Users can sponsor and receive recognition. Trusted by companies with interactive demos available.

Install Docmost – open-source Notion Clone

Install Docmost – open-source Notion Clone

Docmost is an open-source Notion alternative for team collaboration. A tutorial by Till Carlos explains self-hosting Docmost using Docker and Traefik for SSL. It covers setup, limitations, security, and production considerations.

StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

StreamPot simplifies media transformation tasks like video trimming and audio extraction, offering a client library for integration. Users can self-host or use a hosted version, with installation guides available.

Link Icon 9 comments
By @iod - 6 months
Another library that I would recommend people look into for live streaming to WebRTC, as an alternative to Pion used in this project, is Janus WebRTC Server. I use it for ingesting RTP streams I generate from usb webcams and then playing it with very low latency in the browser. It even has a feature where you can stream multiple streams simultaneously. It also has a simple http api for adding, updating, and removing streams on demand.

Here is the library's streaming demo:

https://janus.conf.meetecho.com/demos/streaming.html

By @majorchord - 6 months
My issue with this (and WebRTC in general) is that most residential users (at least in the US, probably many other countries) are behind some type of symmetrical NAT or CGNAT, often without the ability to forward ports or have working NAT traversal, which makes WebRTC unusable without a TURN server as it relies on communicating between peers via DTLS over UDP.

The problem with needing a TURN server is that you practically need to host it yourself, because there are no fast and reliable public ones, probably due to abuse. WebTorrent also has the same problem since it also uses WebRTC, and as such, 99% of applications that use either technology simply do not work at all for me or anyone else I've asked to try these services.

By @Hypnosis6173 - 6 months
I searched a solution to this 2 year ago, great to see such an easy to use implementation now.
By @rgovostes - 6 months
RTSPtoWeb (https://github.com/deepch/RTSPtoWeb) is a similar application for re-encapsulating video packets from RTSP to WebRTC, also written in Go.
By @ongy - 6 months
What's the purpose of this?

Mostly a tech-demo, or primarily to plug a p2p layer onto existing servers?

By @nixosbestos - 6 months
Wait is there a CLI mode? What if I want a simple rtmp/srt -> webrtc bridge on a "headless" device?
By @Sean-Der - 6 months
This is a great project. I really want to add a little JS lib so it could be all done client side

<donut server=‘’ src=‘rtmp://….’ />

src could be any protocol you want.

By @tamimio - 6 months
Does it work with USB cameras? It would be great if it can just interface with /dev/video0 for example.
By @alexdoesh - 6 months
Do we have any reverse bridge available, that you can use for in-browser or edge conversion from WebRTC to RTMP/HSL?