News for hackers. Stuff that matters.
Re:WebRTC for the Curious (2020) by brrrrrm on Friday January 05, 2024 @01:17AM (#38876288)
I haven't found a library that makes me feel comfortable with using WebRTC for random little projects. Setting up TURN/STUN is annoying and I've actually never successfully setup a server/client model (it seems like it'd be useful to have the fast UDP-like stuff, despite WebRTC mostly being about client/client communication)
Re:WebRTC for the Curious (2020) by Uehreka on Friday January 05, 2024 @04:08AM (#38877142)
> despite WebRTC mostly being about client/client communication

This is actually kind of a misconception, though it’s an understandable one given that WebRTC is almost always pitched as a peer-to-peer protocol.

In practice, most people using WebRTC for video are sending their video to a server, not directly to another client. It’s pretty safe to assume that most people who use your app are going to need TURN, and at that point, you’re not really doing peer-to-peer at all, so you might as well just have your browser-based app talk to a server that’s pretending to be another browser.

These servers (called Selective Forwarding Units or SFUs) can operate like a TURN server in the case of a one-on-one call, but they can also multiplex everyone’s feeds in the case of a larger conference (peer-to-peer 5 person calls would require each participant to send 4 copies of their video) and often have extra features like the ability to record calls, transcode streams or convert to other protocols.

The one I’ve used a lot is called Janus[0], it’s open source and has good docs, I recommend people check it out if they’re interested in getting deeper into WebRTC or other video streaming tech.

[0] https://janus.conf.meetecho.com

Re:WebRTC for the Curious (2020) by joduplessis on Friday January 05, 2024 @05:01AM (#38877410)
Janus really is one of those projects you can't believe is OSS. Great work.
Re:WebRTC for the Curious (2020) by ess3 on Friday January 05, 2024 @05:18AM (#38877507)
I don’t remember where I read this (think it was some published paper) but I was building some audio streaming thing on top of WebRTC and there was an estimate that 60% of people would be able to do p2p.
Re:WebRTC for the Curious (2020) by dbrgn on Friday January 05, 2024 @05:41AM (#38877679)
I set up a simple website to stream two webcams in my chicken coop using Janus / WebRTC: https://github.com/dbrgn/chicken-coop/tree/main/rpi-image See README for a quick overview.

Another interesting SFU library is MediaSoup: https://mediasoup.org/

Re:WebRTC for the Curious (2020) by beardedetim on Friday January 05, 2024 @08:04AM (#38878644)
I can definitely second janus. At previous job, we used that for video calls/streaming mixed with FFMPEG for some transformations along the way. Really reliable stuff.
Re:WebRTC for the Curious (2020) by roshanj on Friday January 05, 2024 @09:57AM (#38879705)
Another open-source SFU I've had great experience with is Livekit[0]. Great docs, modern, easy to deploy (it's a golang binary), and supports a number of egress options too if you want to record the media during a stream to an external system. With their cloud product they've also built a really cool 'mesh-based' SFU-CDN that allows peers to connect to an SFU closest to them and have their media broadcast to other SFUs internal to their network, which allows for easy scaling during broadcast-style use-cases.

[0] https://livekit.io/

Re:WebRTC for the Curious (2020) by patcon on Friday January 05, 2024 @02:11AM (#38876568)
Haven't used it yet, but if this library built on Cloudflare Workers can do for webrtc what PartyKit.io does for websockets (again via Cloudflare Workers), then I expect it'll be a pleasure to use :)

https://github.com/gfodor/p2pcf

Re:WebRTC for the Curious (2020) by matthewmacleod on Friday January 05, 2024 @04:05AM (#38877125)
Pion (https://github.com/pion/webrtc) works well and offers a good set of features.
Re:WebRTC for the Curious (2020) by tebbers on Friday January 05, 2024 @01:34AM (#38876388)
I think cloudflare has TURN servers now? Might make it easier.
Re:WebRTC for the Curious (2020) by nemothekid on Friday January 05, 2024 @05:29AM (#38877579)
They made an announcement 2-3 years ago, but I've never seen anything released by them on that front.
Re:WebRTC for the Curious (2020) by dincer on Friday January 05, 2024 @09:05AM (#38879147)
it exists & it’s very good.

send a note to renan@.

Re:WebRTC for the Curious (2020) by Sean-Der on Friday January 05, 2024 @07:31AM (#38878432)
What libraries have you used? There are a lot these days, maybe you haven't tried one yet that matches the way you think/code :)

* https://github.com/aiortc/aiortc (Python)

* GStreamer’s webrtcbin (C)

* https://github.com/shinyoshiaki/werift-webrtc (Typescript)

* https://github.com/pion/webrtc (Golang)

* https://github.com/webrtc-rs/webrtc (Rust)

* https://github.com/algesten/str0m (Rust)

* https://github.com/awslabs/amazon-kinesis-video-streams-webr... (C/Embedded)

* hhttps://github.com/sepfy/libpeer (C/Embedded)

* https://webrtc.googlesource.com/src/ (C++)

* https://github.com/sipsorcery-org/sipsorcery (C#)

* https://github.com/paullouisageneau/libdatachannel (C++)

* https://github.com/elixir-webrtc (Elixir)

See https://github.com/sipsorcery/webrtc-echoes for examples of some running against each other.

Re:WebRTC for the Curious (2020) by brrrrrm on Friday January 05, 2024 @08:36AM (#38878878)
Whoa thanks!
Re:WebRTC for the Curious (2020) by SamPatt on Friday January 05, 2024 @08:01AM (#38878624)
I use PeerJS for a p2p browser based app that lets friends share a live AI session together.

HaveWords.ai

Re:WebRTC for the Curious (2020) by kabes on Friday January 05, 2024 @01:58PM (#38883090)
I can recommend mediasoup: https://mediasoup.org/