News for hackers. Stuff that matters.
Re:WebRTC Samples by Sean-Der on Monday September 14, 2020 @04:01PM (#24474457)
The term 'WebRTC' is overloaded, it can mean the protocol or the API. These samples only cover in the browser. This repo is also kind of dead https://github.com/webrtc/samples/issues/1350

If you are interested in WebRTC out of the browser there are lots of implementations and servers! I am also working on a book 'WebRTC for the Curious'[0] that tries to explain the protocol and the history behind it.

[0] https://webrtcforthecurious.com/

Re:WebRTC Samples by lxgr on Monday September 14, 2020 @05:22PM (#24475313)
Isn't the protocol more or less "just" SDP, DTLS-SRTP and ICE, or in other words a normal SIP stack without the SIP part?

Or is the WebRTC subset/combination of these standards sufficiently different better described as its own protocol?

Re:WebRTC Samples by Sean-Der on Monday September 14, 2020 @05:30PM (#24475388)
Yea pretty much! The only other thing is SCTP.

One nice thing is that the protocol is less flexible. The clients are expected to support NACK, Congestion Control and some other stuff.

I haven't done SIP stuff in 10 years. I just remember you had lots of variety between who you interacted with. Maybe this has gotten better!

Re:WebRTC Samples by 1vuio0pswjnm7 on Tuesday September 15, 2020 @12:09AM (#24477797)
Re:WebRTC Samples by Fredej on Tuesday September 15, 2020 @05:03AM (#24479236)
Thanks for providing this valuable resource.

Out of curiosity: It seems like the communication protocol that's used is RTP and RTCP. And it seems that these work quite well for video and audio streaming. However what if I want to do real time streaming of a custom binary protocol? Like, say, accelerometer data from a robot or similar.

Would the best bet be to attempt to make the protocol RTP and RTCP conformant or would it be possible to make a custom fork of WebRTC which supports custom protocols at the communication layer?

Re:WebRTC Samples by detaro on Tuesday September 15, 2020 @05:08AM (#24479265)
WebRTC has "DataChannels" which you can use for arbitrary data.
Re:WebRTC Samples by gxqoz on Monday September 14, 2020 @04:56PM (#24475063)
This blog post from 2018 from Discord indicated that the browser implementation of WebRTC wasn't as good: https://blog.discordapp.com/how-discord-handles-two-and-half...

Is this still the case? Would you still hypothetically see better audio performance of something like Discord in a standalone app?

Re:WebRTC Samples by Sean-Der on Monday September 14, 2020 @05:14PM (#24475230)
One big issues was poor crypto performance. I managed to convince Google to turn AES-GCM on with SRTP! https://bugs.chromium.org/p/chromium/issues/detail?id=713701...

I am sure there are other issues as well. The WebRTC implementation in Chromium is controlled by Google (they have all the commit bits). If they don't agree with your change it isn't going to land. It's a tough position to be in for other businesses and Open Source projects even.

Re:WebRTC Samples by de_watcher on Tuesday September 15, 2020 @03:24AM (#24478708)
Still pretty bad. Firefox can't freely select audio devices per stream. Chrome has some kind of unbeatable adaptation that makes latency fluctuate.
Re:WebRTC Samples by mooss on Tuesday September 15, 2020 @06:06AM (#24479569)
Do you have more details on the Firefox problem? I have a WebRTC project that is currently in standby (priorities changed) and one issue that I have not been able to troubleshoot was an inability to send audio from Firefox while it somehow worked on Chrome.
Re:WebRTC Samples by de_watcher on Tuesday September 15, 2020 @08:09AM (#24480276)
It works fine in Firefox (send and receive) as long as you don't need to play on multiple output devices. Currently you can enable a feature flag, use enumerateDevices() and play audio files on specific devices, but you can't hook up WebRTC streams to the devices.

enumerateDevices() should enumerate audio output devices (feature behind pref): https://bugzilla.mozilla.org/show_bug.cgi?id=1152401

Enable by default setSinkId pref: https://bugzilla.mozilla.org/show_bug.cgi?id=1498512

Alex Chronopoulos: "We keep it off because it does not work for everything. It works when we playback a file but not for webaudio or WebRTC. We want to add those too and we keep it off till then."

Re:WebRTC Samples by mooss on Tuesday September 15, 2020 @09:06AM (#24480750)
Thanks for your answer, I only have two devices connected so my problem must be caused by an unrelated mistake. I'll find out eventually :).
Re:WebRTC Samples by suyash on Monday September 14, 2020 @04:48PM (#24474968)
Share GitHub repo with latest code, love to play around
Re:WebRTC Samples by Sean-Der on Monday September 14, 2020 @05:09PM (#24475189)
The project I work on is https://github.com/pion/webrtc. https://github.com/pion/awesome-pion is a list of interesting projects that use it, my favorite thing to share :)

For other WebRTC implementations check out.

* https://github.com/aiortc/aiortc

* https://github.com/shinyoshiaki/werift-webrtc

* https://github.com/rawrtc/rawrtc

* https://gstreamer.freedesktop.org/documentation/webrtc/index...

There is also https://github.com/node-webrtc/node-webrtc this takes Google's WebRTC implementation (used in Chromium) and throws a node.js API on top of it!