<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Łukasz Wala on Medium]]></title>
        <description><![CDATA[Stories by Łukasz Wala on Medium]]></description>
        <link>https://medium.com/@lukaszwala?source=rss-004caee04370------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Łukasz Wala on Medium</title>
            <link>https://medium.com/@lukaszwala?source=rss-004caee04370------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 31 May 2026 20:42:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukaszwala/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[The second release of Elixir WebRTC]]></title>
            <link>https://blog.swmansion.com/the-second-release-of-elixir-webrtc-3e6358089455?source=rss-004caee04370------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e6358089455</guid>
            <category><![CDATA[webrtc]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[streaming]]></category>
            <dc:creator><![CDATA[Łukasz Wala]]></dc:creator>
            <pubDate>Tue, 14 May 2024 15:47:23 GMT</pubDate>
            <atom:updated>2024-05-14T15:47:23.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoZlsheS-FyTcIWbTlG67Q.jpeg" /></figure><p>It’s been three months since we <a href="https://blog.swmansion.com/introducing-elixir-webrtc-a37ece4bfca1">posted</a> about the initial release of <a href="https://github.com/elixir-webrtc/ex_webrtc">Elixir WebRTC</a>. In that time, we’ve added a lot of features, made a bunch of improvements, and now we are about to release the second version of the library. Here, I’m going to tell you about what exactly we have done.</p><h3>WebRTC improvements and new features</h3><p>Here’s an overview of the new WebRTC-specific features that we have added to version 0.2:</p><ul><li>Support for different types of RTCP packets (these carry various information about the media stream, contrary to the RTP packets, which carry the media itself):<br>- <a href="https://bloggeek.me/webrtcglossary/transport-cc/">Transport Wide Congestion Control</a>: our PeerConnection can create these based on incoming RTP packets (what are the delays between packets, which packets have been lost?) and send them to the other peer, allowing adjustments to stream parameters (like encoder’s bitrate settings) to better match network conditions. Without this, for example, Chrome will cap the video at a lower quality.<br>- <a href="https://bloggeek.me/webrtcglossary/nack/">NACK</a>: negative acknowledgments, our PeerConnection will send these when it detects lost packets. Then the other side can proceed with the retransmissions.<br>- <a href="https://bloggeek.me/webrtcglossary/pli/">PLI</a>: simplifying a bit, allows our PeerConnection to request a new <a href="https://en.wikipedia.org/wiki/Video_compression_picture_types">keyframe</a> from the remote peer.</li><li><a href="https://bloggeek.me/webrtcglossary/rtx/">RTX</a> (retransmissions): our PeerConnection can not only request retransmissions but also handle remote NACKs and retransmit packets itself.</li><li>ICE features:<br>- support for <a href="https://bloggeek.me/webrtcglossary/mdns/">mDNS</a> candidates: these are used to conceal private IP addresses.<br>- TURN support: our PeerConnection can generate relay candidates and use a TURN server (previously, we could only handle remote relay candidates).<br>- tracking remote keepalives, so our PeerConnection can properly detect when the remote peer was disconnected.</li></ul><h3>Broadcaster</h3><p>We also created a <a href="https://bloggeek.me/whip-whep-webrtc-live-streaming/">WHIP/WHEP</a> broadcasting server based on Elixir WebRTC called <em>Broadcaster </em>(not very original, I know). It allows for streaming media live from a WHIP source (whether it’s an OBS or a web browser) to multiple WHEP clients, typically web browsers. The selling point of WHIP/WHEP broadcasting is the very low latencies — we can keep them much lower than, for example, using OBS for streaming to YouTube.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F946155859%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F946155859&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1852068896-cc1677db821c7128e470fbb57d07da806a8939f936c2bc18bd3ce2787cadb38b-d_1280&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1200" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c7417152def0baf304689899087da8b/href">https://medium.com/media/5c7417152def0baf304689899087da8b/href</a></iframe><p>Initially, Broadcaster was supposed to be just another example app (alongside <a href="https://github.com/elixir-webrtc/apps/tree/master/reco">Reco</a>, which we presented in the last blog post), but we used it to stream the latest <a href="https://www.youtube.com/watch?v=qZmYVdWfLuM">ECK Meetup</a>, and it was a success. We decided to go with the flow and also stream some other upcoming events. If you are organizing an event and would like to use Broadcaster to stream it, reach out to us!</p><h3>Benchmarks and performance</h3><p>The work on benchmarking has started — we are not 100% sure of the results yet, but here’s a little sneak peek into that.</p><p>We created a <a href="https://github.com/elixir-webrtc/bench/tree/master/webrtc_bench">simple benchmarking tool</a> that allows us to test the transmission between two PeerConnections using an arbitrary number of tracks and bitrate. In the presented scenarios, we used about 1.6 mbit/s per track (200 packets/s, 1000 bytes of payload each, which mimics higher-quality video).</p><p>My MacBook M1 Pro was able to handle more than 200 tracks sent from one peer to the other peer (one direction only) and an AMD EPYC 7502P 32-core machine was able to handle about 100 tracks, utilizing less than 5 cores (even more in cases when the number of tracks was split between the peers, e.g. 50 tracks in both directions, as generally, the sender was the bottleneck).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65uil8S3vkvMCuKyB2Rs-A.png" /><figcaption>Logs from the benchmarking tool</figcaption></figure><p>It’s worth mentioning that the level of parallelization of a single PeerConnection is quite low at the moment (it only uses 3 OTP processes, for ICE, DTLS/encryption, and everything else), so the clock speed of a processor is much more important than the number of cores, but that hopefully will change, when we get to work on splitting the load of particular transceivers to different processes. In general, the possibilities for optimization are huge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIKcX__3qKgyb-NYTEQBUg.png" /><figcaption>Process structure of PeerConnection</figcaption></figure><p>Remember that this is only a single PeerConnection, in a typical videoconferencing scenario you’d have a PeerConnection per participant. Even in big meetings (&gt;100 participants) a single user usually receives 20–30 tracks (or how many video tiles an app can fit in a single view) simultaneously, and at that point, the performance of a single PeerConnection probably won’t be the issue to care about. Because of that, this metric is not immediately useful, but you can create a rough estimation of how the Elixir WebRTC could perform when used in the videoconferencing scenario e.g. as an SFU.</p><h3>Plans for the future</h3><p>We still have a lot to do, these are the things that we are planning to tackle before the third release:</p><ul><li>Adding support for <a href="https://bloggeek.me/webrtcglossary/simulcast/">Simulcast</a>.</li><li>More performance benchmarking and profiling.</li><li>API improvements, especially in the area of codec configuration.</li><li>Experimental support for Elixir WebRTC in the J̶e̶l̶l̶y̶f̶i̶s̶h̶ FishJam Multimedia Server (another project that we are working on and soon will go through rebranding).</li><li>Further improvements to the Broadcaster app.</li></ul><p>If you’re interested in Elixir WebRTC and want to keep track of the new features and changes, take a look at the <a href="https://github.com/elixir-webrtc/ex_webrtc/issues/28">roadmap</a>. Also, check out the upcoming <a href="https://2024.commcon.xyz/">CommCon</a> in London — we’ll be there to speak about Elixir WebRTC.</p><p>Thanks for reading!</p><p><a href="https://github.com/elixir-webrtc/ex_webrtc">GitHub - elixir-webrtc/ex_webrtc: An Elixir implementation of the W3C WebRTC API</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e6358089455" width="1" height="1" alt=""><hr><p><a href="https://blog.swmansion.com/the-second-release-of-elixir-webrtc-3e6358089455">The second release of Elixir WebRTC</a> was originally published in <a href="https://blog.swmansion.com">Software Mansion</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Elixir WebRTC]]></title>
            <link>https://blog.swmansion.com/introducing-elixir-webrtc-a37ece4bfca1?source=rss-004caee04370------2</link>
            <guid isPermaLink="false">https://medium.com/p/a37ece4bfca1</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[webrtc]]></category>
            <dc:creator><![CDATA[Łukasz Wala]]></dc:creator>
            <pubDate>Wed, 14 Feb 2024 12:06:13 GMT</pubDate>
            <atom:updated>2024-02-14T12:06:13.243Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pnrN-ZnMSZeqg2ScnQWnrw.jpeg" /></figure><p>For the last few months, we’ve been working really hard on an Elixir implementation of the <a href="https://www.w3.org/TR/webrtc/">W3C WebRTC specification</a> and we are glad to officially announce its very first release ― the 0.1 version of <a href="https://github.com/elixir-webrtc/ex_webrtc">ex_webrtc</a>!</p><p>But why 🤔? Well, we’ve been using WebRTC in Elixir for a few years now, but it was mostly some C and Erlang libraries glued together using the <a href="https://github.com/membraneframework">Membrane Framework</a>, and it was <em>fine </em>for the most part, except for some issues:</p><ul><li>sometimes we needed to contribute to the underlying libraries, or even worse, maintain our own forks ― that was a struggle,</li><li>it was tough to introduce engineers from outside to our code, as it was completely different from the usual WebRTC API,</li><li>Membrane is amazing for what it’s designed for, but we realized that the WebRTC API doesn’t really map well to the <em>pipeline</em> model, which made some things unnecessarily difficult.</li></ul><p>With the previous experiences and these issues in mind, we decided to write an (almost) pure Elixir, W3C-compliant, open-source WebRTC implementation from the ground up, with the whole networking stack. Our goal is to create a solution similar to projects like <a href="https://github.com/pion">Pion</a> or <a href="https://github.com/webrtc-rs">WebRTC.rs</a>, but for the Elixir ecosystem. So far, we’re on the right track!</p><p>Before getting into the nitty-gritty of what’s in version 0.1, check out this quick tutorial on how to use the <a href="https://github.com/phoenixframework/phoenix">Phoenix Framework</a>, <a href="https://github.com/elixir-nx/nx">Elixir Nx</a>, and <a href="https://github.com/elixir-webrtc">Elixir WebRTC</a> to create a web app that performs image recognition based on the web-cam video feed from a browser!</p><p>The app will be publicly hosted for some time 👉<a href="http://bigcow.jellyfish.ovh/reco">here</a>👈.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fv6cMqZl8BDA&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dv6cMqZl8BDA&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=google" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2764677cbc9708dab7eec6ba86d2a575/href">https://medium.com/media/2764677cbc9708dab7eec6ba86d2a575/href</a></iframe><h3>What’s in the 0.1?</h3><p>The first release focuses on three aspects:</p><ul><li>API compliant with the standard,</li><li>ease of integration with the Elixir ecosystem,</li><li>learning resources.</li></ul><h4>API that you’re familiar with</h4><p><strong>ExWebRTC</strong> tries to be compliant with the well-known JavaScript API while still being idiomatic to Elixir. The goal here is to make it easy for people familiar with WebRTC to jump in, but not compromise on the amazing features that make Elixir so powerful and unique. The version 0.1 already brings you most of the functions available in the JavaScript API.</p><p>For example, this snippet in JS:</p><pre>const pc = new RTCPeerConnection();<br>const tr = pc.addTransceiver(&quot;audio&quot;);<br>const offer = await pc.createOffer();<br>await pc.setLocalDescription(offer);</pre><p>maps to the following Elixir code:</p><pre>{:ok, pc} = PeerConnection.start_link()<br>{:ok, tr} = PeerConnection.add_transceiver(pc, :audio)<br>{:ok, offer} = PeerConnection.create_offer(pc)<br>:ok = PeerConnection.set_local_description(pc, offer)</pre><p>See our <a href="https://hexdocs.pm/ex_webrtc/ExWebRTC.PeerConnection.html">API reference</a> and <a href="https://github.com/elixir-webrtc/ex_webrtc/tree/master/examples">examples</a> for more.</p><h4>Simple integration</h4><p>One of the goals of Elixir WebRTC is to be appealing to the Elixir folks and easy to integrate into existing Elixir projects! With that in mind, we wrote the <a href="https://github.com/elixir-webrtc/ex_webrtc_dashboard">ExWebRTC Dashboard</a> ― statistics visualization for the Phoenix Framework. Just add ExWebRTCDashboard as an additional page for the Phoenix’s LiveDashboard and you will be provided with something similar to Chrome’s chrome://webrtc-internals(but good looking 😎)!</p><pre># add this to your Phoenix app&#39;s router.ex<br><br>live_dashboard &quot;/dashboard&quot;,<br>  additional_pages: [exwebrtc: ExWebRTCDashboard]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*un6kTVn0PiYooAEKNayM6Q.gif" /><figcaption>ExWebRTC Dashboard</figcaption></figure><h4>Learn some WebRTC</h4><p>Understanding the W3C spec and all of its quirks is not a trivial task. We spent days reading the RFCs (my personal favorite has to be the <a href="https://datatracker.ietf.org/doc/html/rfc8829">RFC 8829</a>, a great read for a winter evening with a cup of hot chocolate ☕), reverse-engineering Chrome’s implementation, and making issues with (sometimes dumb) questions in the <a href="https://github.com/w3c/webrtc-pc">webrtc-pc</a> repo.</p><p>We wanted to gather all of that knowledge <em>somewhere</em>, and the first step in that direction is the <a href="https://hexdocs.pm/ex_webrtc/mastering_transceivers.html#content"><em>Mastering Transceivers</em></a> guide. It consists of a series of examples explaining some tips and tricks for WebRTC’s Transceivers. Each example contains both JS (you can quickly run it in the browser and experiment with it, all thanks to the JS Fiddle!) and Elixir snippet, which makes it easy to understand how the browser API maps to ours. We hope to add Livebooks for the Elixir code in the future!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*7SjvEjL_Jw_t6mUn.png" /><figcaption><strong>Mastering Transceivers</strong> guide</figcaption></figure><h3>What’s next?</h3><p>We are extremely excited about what we have accomplished so far, and even more excited about what lies ahead of us! Our plan for the 0.2 is to:</p><ul><li>add support for <em>Quality of Service </em>features, like <a href="https://bloggeek.me/webrtcglossary/transport-cc/">Transport-Wide Congestion Control</a> (WebRTC sources, like browsers, use it to estimate how much network bandwidth they can use, and thus, how good the quality of the media may be) or <a href="https://datatracker.ietf.org/doc/html/rfc4588">Retransmissions</a> (remember, WebRTC usually uses UDP, which is unreliable),</li><li>add support for some ICE features, like <a href="https://datatracker.ietf.org/meeting/103/materials/slides-103-rtcweb-mdns-ice-candidates-00">mDNS ICE candidates</a> (to prevent leakage of private IP addresses) or <a href="https://webrtc.org/getting-started/turn-server">TURN servers</a> (in some cases, P2P connection is not possible and TURN server needs to relay the network traffic),</li><li>make QoL and performance improvements, and fix bugs (which are surely there).</li></ul><p>We would love to hear your feedback and suggestions on what you need or what would be cool to add. Don’t hesitate to leave a comment on our <a href="https://github.com/elixir-webrtc/ex_webrtc/issues/28">Roadmap issue on GitHub!</a> 🎉</p><p>Big thanks to Sean DuBois for creating the awesome Pion project and <a href="https://medium.com/u/90b8f72897a9">Philipp Hancke</a> with the WebRTC community for answering our questions on <a href="https://github.com/w3c/webrtc-pc">webrtc-pc</a> and the <a href="https://groups.google.com/g/discuss-webrtc"><em>discuss-webrtc</em></a> group!</p><p>Happy streaming!</p><p><a href="https://github.com/elixir-webrtc/ex_webrtc">GitHub - elixir-webrtc/ex_webrtc: An Elixir implementation of the W3C WebRTC API</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a37ece4bfca1" width="1" height="1" alt=""><hr><p><a href="https://blog.swmansion.com/introducing-elixir-webrtc-a37ece4bfca1">Introducing Elixir WebRTC</a> was originally published in <a href="https://blog.swmansion.com">Software Mansion</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>