Peer-to-Peer Communications with WebRTC
developer.mozilla.org
developer.mozilla.org
For iOS
1. Safari has a high pass filter or something on the incoming audio. Send in some music on opus/48000 with the proper maxbitrate and listen. Now download chrome for iOS and listen. Chrome has MUCH more low end. Running the audio before and after into a spectrum analyzer chrome is much closer to the original sound.
2. If you make the video full screen then exit full screen if pauses.
3. I couldn’t get incoming RTP that is opus/48000/2 to be played in stereo. But as number 1 playing it in chrome does play in stereo.
Android isn’t much better.
1.The fragmentation is such a HUGE pain. The manufacturer browsers on the phones seem to be very hit or miss. How many browsers come by default on android phones now days?
2. The latest Samsung phones cameras can’t do resolution 640x360 for whatever reason. Previous generations could and other android phones can as well.
Even desktop isn’t all there.
1. If you want to webrtc screen share there is no way to automatically select a screen or tab, not even CLI flags. So you can’t automate testing it. And you can’t even click the dialog in the chrome remote debugger.
2. FireFox has nothing like chromes chrome://webrtc-internals
A few other things
1. Simulcasting is ghetto
2. I wish server CPUs would support h264/vp8/vp9 hardware encoding and decoding on the CPUs
3. Want to collect metrics with getStats? Well there is no easy way to record all of them and the one SaaS is super super expensive
Manufacturer browsers used to be a big deal, but for the last couple years it's been mostly Chrome or something nearly identical on most devices. Not having that specific resolution available is one thing, but it's nothing like having no support, or inexplicably degrading audio quality.
4. I wish RTCRtpTransceiver would allow reusing encoded MediaStreams instead of re-encoding. For video, dropped frames are acceptable without needing to renegotiate bandwidth.
And that’s a good one
A technique that's used to get around this is to use special frame reference pattern so some frames depend on a frame two or four frames before, allowing the intermediate frame to be dropped. This comes at a significant cost to the encoding efficiency though. tT use it with a pre-encoded video, it would require you to specifically encode it for this purpose, making the usefulness of such a feature in a client questionable.
Nothing stops you from building a server that does this though, for instance if you want to build a scalable streaming service based on WebRTC.
You missed the entire point of the comment.
The CEO is one of the authors of the getStats RFC as well https://www.w3.org/TR/webrtc-stats/
Why is this? What advantages are there to doing it on a CPU rather than in a GPU?
Do you use kubernetes to scale jitsi/mediasoup/whatever servers up and down ?
what kind of loadbalancers do you use, etc . I come from the kubernetes side and have never read anything about scaling of these things...so am super curious.
You should look into SVC. Nowadays there aren’t too many reasons why you’d need to decode/reencode if all you want is to change resolution, quality or drop frames graciously.
I've recorded a tab automatically before with Chrome [0]. Basically I have --auto-select-desktop-capture-source set to pick a tab then named my tab something it could find, you can probably get close with entire screen too.
> Simulcasting is ghetto
Agreed, but in my recent server side project I just realized if I ignore the ssrcs and use the rids from the rtp packets, my sfu did what I want. I found while working with Chrome, upping the log visibility really helped me understand why, based on estimated bitrate sent by the server, my highest simulcast stream wasn't being sent (since then I adhere to remb needs).
0 - https://github.com/cretz/chrome-screen-rec-poc/blob/master/a...
Which are all....websites smashed into "native" code + privacy invading trackers, anyway?
Then... I attended a "Zoom Nightclub" and saw over 200 attendees streaming video to one another. All encryption, routed through China, etc. issues aside; I was very very impressed.
Of course there could also be a surveillance motive.
I forgot to write though: I am not convinced this is that big a problem in the real world, and there are other mitigations. One would be a "poor man's Tor," onion routing over just 1-2 hops. Since you are propagating and aggregating P2P anyway, its not going to be that expensive. Doesn't make DOS impossible but makes it tough enough to deter amateurs.
Also latency in P2P multicast starts to become a real problem.
Getting encoded video bytes from a buffer onto the screen while using hardware video decoding and without a multi-second lag I haven't been able to do in either safari or chrome - any tips?
Granted, not tested on Safari
Even basic canvas animations on the main thread like the dinosaur game (chrome offline page) are pretty janky, and they aren't doing much per frame at all.
EDIT: For anyone curious, we swap out the track from the RTCRtpSender so we’re not transmitting any data when we’re muted (muting the track locally means you’re still sending frames of silence every 20ms which eats up cpu and bandwidth). And every 15 seconds we send a 60ms blast of silence, and verify on the receiver every minute.
And I have proposed additions to the WebRTC API to allow control of when ICE checks are sent and how long a particular ICE candidate pair should stay alive (you could set it to "forever"):
It may take some time for webRTC (or Apple) to get there, to webRTC become a solid option for p2p video communications.
If anyone wants to quickly try webRTC, check this demo https://appr.tc/ out, you know, with multiple browsers/tabs.
ps: I used "simple-peer" library and it's quite good for beginners.
webRTC classroom app, open-sourced.
https://caniuse.com/#feat=stream
The Judiciary Committee asked Apple about this last summer, see question 6:
https://docs.house.gov/meetings/JU/JU05/20190716/109793/HHRG...
I think it's close to landing though, need to revisit.
* Open Source classic game streaming - https://github.com/giongto35/cloud-game
* Controlling industrial construction equipment - https://twitter.com/shirokunet/status/1268011883816054784
* Run a web browser remotely, great for low spec computers - https://github.com/nurdism/neko
* Use NAT Traversal to access hosts. No more bastion hosts/3rd party services - https://github.com/mxseba/rtc-ssh
* Use Tor via WebRTC DataChannels - https://snowflake.torproject.org/
* Fly a drone via WASD in the browser - https://github.com/oliverpool/tello-webrtc-fpv
* Share files P2P in a cross-platform way. I HATE paying to transfer files, seems so basic - https://github.com/saljam/webwormhole
* Access a friends terminal from your browser via P2P - https://github.com/maxmcd/webtty
If you are interested for more check out https://github.com/pion/webrtc, https://twitter.com/_pion and https://pion.ly/slack
I've shelved that aspect at the moment but your link will help me with code samples I can re-use when I revisit the sharing aspect of the project.
See https://github.com/peer-calls/peer-calls for more information.
You can host it yourself or use peercalls.com
Happy to answer any questions in this thread.
But the API we get from the browser is basically just `navigator.mediaDevices.getDisplayMedia()`, so what we do to screenshare is actually not much code at all. If we do something bad for Vivaldi/Brave though, we'll be quick to fix it, but this is likely their bugs, not ours :) Vivaldi screensharing on Linux broke half a year or so ago, but we're in the same town and know them, so they quickly fixed whatever bug it must have been after we pinged them.
But the most likely thing here is just that they might not have updated to newest Chromium with all these fixes. Or maybe not done the necessary platform-integrations or UI for it. Having worked on Opera previously I know anything involving chrome (UI) will often take a lot longer to do because you actually have to write a lot of custom code for it (in contrast to pure web-platform features and improvements, which basically will be free).
Wouldn't have been clearer to have createOffer + processAnswer (for a negotiation started locally), and processOffer + createAnswer (to respond to remote offers), and set the local/remote descriptions implicitly as part of these methods?
You can change lots of undocumented stuff in the SDP! This list isn't exhaustive, but I have seen production apps do these.
* Change ice ufrag/upwd
* Enable simulcast
* Change code preferences
* Change codec specific behavior (Opus ptime)
My guess is that it works this way so browser vendors don't have to actually standardize behavior. They don't need to go through the W3C every time they want add something new. ORTC was released to try and fix this though. `SDP Munging` is a terrible idea and has caused me so many headaches :/
1 was based on simple Ajax to server and a server backed message store.
About a dozen used WebRTC or other advanced techniques.
I wonder how many people who could quite easily cope with the expected traffic using brain-dead simple techniques end up going the complex route because they assume that's how you do chat?
For text only I still see a couple advantages
* E2E Security. With WebRTC I don't have to worry about snooping. Why should I upload my messages to a server?
* Scaling/Bandwidth/Ops Burden. Massively reduced if all my clients are directly connected to each other
* Ajax (TCP) can't do as much. DataChannels give me lossy/out-of-order messaging. Not useful for chat, but really great if building anything gaming/real-time
I built a simple messenger using WebRTC. You can check at http://sambhashana.com/.
Please use it and share your feedback
Except for room members online information nothing goes to the server. Every message goes peer to peer and nothing is stored so the moment user closes or refreshes browser everything gone.
How hard is it to add real-time voice communication to a web page using this?
Can it be done without using third party libraries and frameworks?
https://webrtc.github.io/samples/src/content/peerconnection/...
code: https://github.com/webrtc/samples/tree/gh-pages/src/content/...