<?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 Daljeet Singh on Medium]]></title>
        <description><![CDATA[Stories by Daljeet Singh on Medium]]></description>
        <link>https://medium.com/@daljeetsingh?source=rss-76abbaeba8ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MuazZ0oR01Sn7hJDjGW8yg.jpeg</url>
            <title>Stories by Daljeet Singh on Medium</title>
            <link>https://medium.com/@daljeetsingh?source=rss-76abbaeba8ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:40:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daljeetsingh/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[Unlock the Full Potential of WebRTC: Essential Features for High-Quality Applications]]></title>
            <link>https://medium.com/@daljeetsingh/prime-features-can-be-used-while-building-an-high-quality-application-using-webrtc-2cf504a87a48?source=rss-76abbaeba8ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cf504a87a48</guid>
            <category><![CDATA[webrtc]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[simulcast]]></category>
            <category><![CDATA[rtc]]></category>
            <category><![CDATA[video-app-development]]></category>
            <dc:creator><![CDATA[Daljeet Singh]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 08:24:41 GMT</pubDate>
            <atom:updated>2024-11-05T09:12:49.176Z</atom:updated>
            <content:encoded><![CDATA[<p>This article helps you understand the important features offered by WebRTC CPaaS (Communications Platform as a Service) vendors. If you are building large scale audio/video calling applications using any CPASS vendor like <a href="https://www.agora.io/en/">Agora</a>, <a href="https://www.twilio.com/en-us">Twilio</a> or <a href="https://livekit.io/">LiveKit</a> so on, these features can definitely take your application to the next level.</p><p>If you are a beginner to WebRTC you can read about it <a href="https://medium.com/@daljeetsingh/beginners-guide-to-understand-webrtc-2e876dc174f8">here</a>. Use of these features are must to build a high quality application.</p><p><strong>Here is the list of features:</strong></p><ol><li>Simulcast</li><li>Adaptive Bitrate</li><li>Optimization on platforms</li><li>Stats</li><li>AI features</li></ol><p>Let’s understand the above terms one by one.</p><h3>Simulcast</h3><p>Creating a world-class calling experience user wants the smooth interaction of audio/video call between different peers joined over the internet. Having said that, when peers join the room, each peer has different bandwidth to receive the coming media stream.</p><p>Insufficient bandwidth clients can experience high packet loss on the receiving side, causing choppy picture quality or black/blank frames. To give a smooth experience for the end-users, especially those who have the insufficient bandwidth to receive the high quality stream, Simulcast does the magic. Most of the CPASS vendors which are built on <a href="https://bloggeek.me/webrtcglossary/sfu/">SFU(Selective Forwarding Units)</a> model have the Simulcast feature available.</p><p>Now lets understand <strong>How it works?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*GdGVKGQJo5DA9Y9K2F9oXg.jpeg" /></figure><p>Every client publishes the different resolution media stream to the SFU and then based on the implementation, SFU decides which stream to forward to the other client. Commonly, media streams are divided into three modes HD, LD and MD. For example</p><ul><li>high: 1280 x 720 @ 2.5mbps</li><li>medium: 640 x 360 @ 400kbps</li><li>low: 320 x 180 @ 125kbps</li></ul><p>By this technique we can provide a far better experience to the users with different resources. If a client is struggling with the slow bandwidth, can request for the lower resolution streams to have a better experience.<br>Each WebRTC SDK provider has a different way of Simulcast implementation, But the end goal is similar. You can explore this feature and check the docs given by the RTC SDK provider you are using.</p><h3>Adaptive Bitrate</h3><p><strong>Adaptive Bitrate Streaming (ABR)</strong> ensures the best video quality and viewer experience possible, regardless of bandwidth, device, or software. It is a technique that dynamically adjusts the compression level and video quality of a stream to match the available bandwidth.</p><p>With this feature, clients can allocate bandwidth between multiple streams based on their requirements. Most CPaaS providers automatically adjust the video quality to ensure optimal performance without compromising reliability.</p><p>When the network is constrained, the bitrate and resolution are reduced to maintain the call connection, ensuring enough throughput for audio. When bandwidth is available, the bitrate and resolution are increased to deliver higher-quality video.</p><h3>Optimization on platforms</h3><p>Video calling applications build on all platforms like Web, iOS and Android. Mobile applications are highly recommended when creating a live video solution. There are many optimizations that can be made on mobile devices and platform levels. Let’s explore a few examples.</p><p>For instance, if a mobile application user is on a screen where the client is both publishing and subscribing to video, and the user then brings the application to the background, there’s no benefit in receiving remote video at that point. As a result, the client would be wasting bandwidth. To avoid this, we can stop the remote video tracks when the app is in the background and re-enable them once the user returns to the app. This simple change can save a lot of bandwidth and other resources.</p><p>The <strong>active speaker</strong> feature is also very useful and is available in all major SDKs. When implementing this feature, you can optimize the published video by adjusting the bitrate and resolution if the current user is not the active speaker.</p><p>Another client-side optimization depends on the design and layout of the live session. Based on the video layout, clients can determine the best bitrate for the video stream. For example, if the publisher is not displayed in a large view, you can lower the resolution of the publisher’s video. On the other hand, if the publisher is shown in a larger view, you can send a high-resolution stream. This optimization helps ensure the best experience for users, adjusting to the layout and user changes in real time.</p><h3>Stats</h3><p>Debugging RTC (Real-Time Communication) application issues can be complex because we are dealing with real-time media. Therefore, having perfect logging and a robust analytics dashboard is essential. End users may encounter different issues, and identifying the root cause is crucial for maintaining the quality of your product.</p><p>To help debug these issues, RTC providers offer Stats APIs and analytics dashboards.</p><p>The Stats API provides comprehensive data about the connected session and each media stream within that session. These metrics are invaluable for diagnosing issues that users experience, such as video not being received, audio issues on one end, screen sharing not working, and more. The API offers real-time data about the current session, which can significantly aid in troubleshooting. You can check the stats API given by <a href="https://www.100ms.live/docs/android/v2/how-to-guides/measure-network-quality-and-performance/webrtc-stats">100ms</a> and more details about WebRTC stats read <a href="https://webrtchacks.com/power-up-getstats-for-client-monitoring/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43rOA5nlDY1jveGmfgrvkA.png" /><figcaption>Chrome webrtc-internals stats</figcaption></figure><p>There are other tools available to debug RTC issues. If the session is running on Chrome browser you can check complete stats on chrome webrtc-internals(chrome://webrtc-internals).</p><h3>AI Features</h3><p>AI is all around in today’s world, influencing nearly every aspect of technology. CPaaS (Communications Platform as a Service) vendors are no exception, integrating AI technology with WebRTC. Many SDK providers now offer capabilities that enable live conversations powered by Large Language Models (LLMs) such as ChatGPT.</p><p>AI features can be seamlessly integrated into various use cases when building applications. For example, they can be applied to areas like customer support, pre-sales, growth marketing, self-service product assistance, and more. Let’s explore a few vendors and their APIs that make these advancements possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*QgHmnwrFUgVgRA5Y7w-K1g.jpeg" /><figcaption>WebRTC and AI</figcaption></figure><p><a href="https://docs.livekit.io/agents/openai/overview/">LiveKit Agents</a> is an end-to-end framework that enables developers to build intelligent, multimodal voice assistants (AI agents) capable of engaging users through voice, video, and data channels.</p><p>Similarly, Integrating Agora’s real-time audio communication capabilities with OpenAI’s language models enables dynamic, conversational AI experiences, you can check <a href="https://docs.agora.io/en/open-ai-integration/get-started/quickstart?platform=python">here.</a></p><p><a href="https://www.twilio.com/en-us/blog/introducing-twilio-ai-assistants">Twilio AI Assistants</a> is an opinionated framework to build and host Assistants for customer-facing use cases. At the core of Twilio AI Assistants resides a distinctive customer-aware approach facilitated by Customer Memory.</p><p>Soon I will cover a few topics in detail.</p><p>Useful Links:</p><p>Simulcast and Adaptive Bitrate: <a href="https://www.wowza.com/blog/webrtc-simulcast-what-it-is-and-how-it-works">https://www.wowza.com/blog/webrtc-simulcast-what-it-is-and-how-it-works</a></p><p>WebRTC Stats: <a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport">https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cf504a87a48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s Guide to Understand WebRTC]]></title>
            <link>https://medium.com/@daljeetsingh/beginners-guide-to-understand-webrtc-2e876dc174f8?source=rss-76abbaeba8ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e876dc174f8</guid>
            <category><![CDATA[webrtc]]></category>
            <category><![CDATA[p2p]]></category>
            <category><![CDATA[rtc-peer-connection]]></category>
            <category><![CDATA[webrtc-technology]]></category>
            <category><![CDATA[signaling]]></category>
            <dc:creator><![CDATA[Daljeet Singh]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 17:42:34 GMT</pubDate>
            <atom:updated>2024-10-25T03:53:32.760Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is about a brief understanding of WebRTC. Sequential steps and protocols used by this technology.</p><p><strong>What is WebRTC?<br>Why do we use WebRTC?<br>How to use WebRTC?</strong></p><p>Let’s start with, <strong>What is WebRTC?</strong></p><p>WebRTC stands for Web real time communication. It is used to enable bi-directional communication between peers over the internet. WebRTC implementation is open source, developed and maintained by google <a href="https://webrtc.org/">webrtc.org</a>. It supports video, voice, and generic data to be sent between peers, allowing developers to build powerful voice- and video-communication solutions.</p><p>The technology is available on all modern browsers vendors including Safari, Google Chrome, Firefox, Opera, and others as well as on native clients for all major platforms(iOS/ Android). The WebRTC project is <a href="https://webrtc.googlesource.com/src/">open-source</a> and supported by Apple, Google, Microsoft and Mozilla, amongst others.</p><p><strong>Why we use WebRTC?</strong></p><p>There are many different use-cases for WebRTC, from basic web/mobile apps that use the camera or microphone, to more advanced video-calling applications. Also enable features like File sharing, Screen sharing, Live streaming, Online Gaming, Remote collaboration and others.</p><p><strong>How to use WebRTC?</strong></p><p>It consists of a set of rules and protocols while joining the audio/video call between peers. The WebRTC protocol is a collection of other technologies like signaling, connection, security and communication. While connecting to other peers, the steps should be sequential. Let’s talk about this one by one briefly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*RPzM7dwki84avwbvgnIy6g.jpeg" /></figure><p><strong>How peers find each other in WebRTC?</strong></p><p>When a WebRTC Agent starts, it has no idea who it is going to communicate with or what they are going to communicate about. Here comes Signaling which solves the above problem. Signaling messages are just text. The WebRTC agents don’t care how they are transported. They are commonly shared via Websockets, but that is not a requirement.</p><p>Signaling helps to complete further steps like <a href="https://webrtcforthecurious.com/docs/02-signaling/#what-is-the-session-description-protocol-sdp"><strong>SDP(Session Description protocol)</strong></a> negotiations. Via this protocol, the two WebRTC Agents will share all the state required to establish a connection. The protocol itself is simple to read and understand. SDP contains audio/video information, codec information etc.</p><blockquote><strong>SDP Sample:</strong><br> v=0<br>o=- 123456 123458 IN IP4 10.0.1.2<br>s=My sample flow<br>i=4 channels: c1, c2, c3, c4<br>t=0 0<br>a=recvonly<br>m=audio 5004 RTP/AVP 98<br>c=IN IP4 239.69.11.44/32<br>a=rtpmap:98 L24/48000/4<br>a=ptime:1<br>a=ts-refclk:ptp=IEEE1588–2008:00–11–22-FF-FE-33–44–55:0<br>a=mediaclk:direct=0</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*RVO7iFv-n8cAfJqeP27BHg.png" /><figcaption>SDP negotiation between two clients using Signaling channel</figcaption></figure><p>When a user starts a WebRTC call to another user, a special description is created called an offer. This description includes all the information about the caller’s proposed configuration for the call. The recipient then responds with an answer, which is a description of their end of the call.</p><p><strong>Connection</strong></p><p>Once SDP negotiation is done, WebRTC agent has enough information to initiate connection between peers. And, To make this connection happen, WebRTC uses another established technology called <a href="https://temasys.io/guides/developers/webrtc-ice-sorcery/"><strong>ICE (Interactive Connectivity Establishment)</strong></a><strong>. </strong>ICE is a protocol that tries to find the best way to communicate between two ICE Agents. Each ICE Agent publishes the ways it is reachable, these are known as candidates.</p><p>Other protocols used are <strong>STUN</strong> and <strong>TURN</strong>.</p><p><a href="https://webrtcforthecurious.com/docs/03-connecting/#stun"><strong>STUN (Session Traversal Utilities for NAT)</strong></a> is a protocol that was created just for working with NATs. This is another technology that pre-dates WebRTC (and ICE!). STUN is useful because it allows the programmatic creation of NAT Mappings. Before STUN, we were able to create a NAT mapping, but we had no idea what the IP and port of it was! STUN not only gives you the ability to create a mapping, but also gives you the details so that you can share them with others, so they can send traffic back to you via the mapping you just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*FKKjO9mrTN8Xb5HyDr9wGw.jpeg" /></figure><p><a href="https://webrtcforthecurious.com/docs/03-connecting/#turn"><strong>TURN (Traversal Using Relays around NAT)</strong></a> is the solution when direct connectivity isn’t possible. It could be because you have two NAT Types that are incompatible, or maybe can’t speak the same protocol! TURN can also be used for privacy purposes. By running all your communication through TURN you obscure the client’s actual address.</p><p><strong>Security layer with DTLS and SRTP</strong></p><p>When the two agents have successfully established an ICE connection, WebRTC moves on to the next step; establishing an encrypted transport for sharing audio, video, and data between them. This is done through two more protocols that also pre-date WebRTC; <a href="https://webrtcforthecurious.com/docs/04-securing/#dtls"><strong>DTLS (Datagram Transport Layer Security)</strong></a> and <a href="https://webrtcforthecurious.com/docs/04-securing/#srtp"><strong>SRTP (Secure Real-Time Transport Protocol).</strong></a></p><p><strong>Communication</strong></p><p>After completing the above steps successfully, WebRTC agents connected and secure, peers can start communication. To send and receive media, WebRTC will use two pre-existing protocols: <strong>RTP (Real-time Transport Protocol)</strong> and <strong>SCTP (Stream Control Transmission Protocol).</strong> We use RTP to exchange media encrypted with SRTP, and we use SCTP to send and receive DataChannel messages encrypted with DTLS.</p><p>The above we have explained briefly how WebRTC agent internally works and follow the sequential steps to enable the bi-directional audio/video call between peers.</p><p>If you want learn more about WebRTC, here are some good resources to check out:</p><p>1. <a href="https://webrtc.org/"><strong>https://webrtc.org/</strong></a><strong><br>2. </strong><a href="https://webrtcforthecurious.com/"><strong>https://webrtcforthecurious.com/</strong></a><strong><br>3. </strong><a href="https://web.dev/articles/webrtc-basics"><strong>https://web.dev/articles/webrtc-basics</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e876dc174f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>