<?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 Sanjita Prajapati on Medium]]></title>
        <description><![CDATA[Stories by Sanjita Prajapati on Medium]]></description>
        <link>https://medium.com/@psanjita18?source=rss-1883016b9a88------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eMRVz-U7veMyMRyYcGat8A.jpeg</url>
            <title>Stories by Sanjita Prajapati on Medium</title>
            <link>https://medium.com/@psanjita18?source=rss-1883016b9a88------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 18:41:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@psanjita18/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[Part 2 — Adding a Custom Domain to Your AWS Amplify App]]></title>
            <link>https://medium.com/@psanjita18/part-2-adding-a-custom-domain-to-your-aws-amplify-app-41e5b4f60a0c?source=rss-1883016b9a88------2</link>
            <guid isPermaLink="false">https://medium.com/p/41e5b4f60a0c</guid>
            <dc:creator><![CDATA[Sanjita Prajapati]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 20:30:46 GMT</pubDate>
            <atom:updated>2025-12-26T20:30:46.816Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 2 — Adding a Custom Domain to Your AWS Amplify App</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q93jcQAyty_uXSeDzUrFbw.png" /><figcaption>Source: <a href="https://www.hostinger.com/au/tutorials/why-do-i-need-a-domain-name/">https://www.hostinger.com/au/tutorials/why-do-i-need-a-domain-name/</a></figcaption></figure><p>In <strong>Part 1</strong> of this series, we focused on the first and most crucial step in any frontend project: transitioning a React application from local development to a live, publicly accessible website. Using a real scenario from my research work, we saw how a fully functional React dashboard on localhost becomes meaningful only when it can be shared through a link. We introduced <strong>AWS Amplify</strong> as a beginner-friendly hosting solution, connected a React application to GitHub, and deployed it with an automated build and deployment pipeline. By the end of Part 1, the application was live on the internet using Amplify’s default URL.</p><p>If you missed the previous blog, you can check it out here</p><p><a href="https://medium.com/@psanjita18/part-1-hosting-your-first-react-app-using-aws-amplify-beginner-friendly-guide-6dae499c611c">Part 1 — Hosting Your First React App using AWS Amplify (Beginner-Friendly Guide)</a></p><p>While that default URL works perfectly, it often looks long and autogenerated, which is not ideal when sharing your work with advisors, collaborators, recruiters, or users. This is where <strong>custom domains</strong> come in. A clean and readable URL immediately makes your application feel more professional, trustworthy, and production-ready.</p><p>This part will guide you through the process of attaching a custom domain to an existing AWS Amplify application, explain what happens behind the scenes, and configure DNS and SSL without delving into unnecessary complexity.</p><h3>Why a Custom Domain Matters</h3><p>When you deploy an app using AWS Amplify, you get a URL that looks something like:</p><pre>https://main.xxxxxx.amplifyapp.com</pre><p>Functionally, this URL is fine.<br>But visually and professionally, it doesn’t say much about <em>you</em> or <em>your project</em>.</p><p>A custom domain allows you to replace that autogenerated link with something clean and meaningful, such as:</p><p><a href="https://reactoriq.yourdomain.com/"><em>“https://yourproject.yourdomain.com</em></a><em>”</em></p><p>This small change makes a big difference. It immediately makes your application feel more polished, credible, and production-ready, especially when you’re sharing it in academic, professional, or public settings.</p><h3>What Happens Behind the Scenes</h3><p>Traditionally, setting up a custom domain on AWS involves several steps: configuring DNS records, requesting SSL certificates, attaching them to CloudFront distributions, and managing renewals. For beginners, this process can feel overwhelming.</p><p>AWS Amplify simplifies almost all of this.</p><p>Amplify:</p><ul><li>Automatically provisions SSL certificates using AWS Certificate Manager</li><li>Handles HTTPS configuration</li><li>Integrates directly with Route 53 (if your domain is on AWS)</li><li>Guides you through DNS setup if your domain is hosted elsewhere</li></ul><p>You don’t need to manually manage certificates or worry about renewals, Amplify takes care of it.</p><h3>Step 1: Get a Domain Name</h3><p>Before configuring anything in Amplify, you need a domain.</p><p>You can purchase a domain from:</p><ul><li>AWS Route 53</li><li>Google Domains</li><li>Namecheap</li><li>GoDaddy</li><li>or any other domain provider</li></ul><p>If your domain is already managed in AWS Route 53, the setup will be smoother. However, Amplify works just as well with domains hosted outside AWS.</p><h3>Step 2: Open Domain Management in AWS Amplify</h3><p>Once your domain is ready:</p><ol><li>Log in to the AWS Amplify Console</li><li>Select your deployed application</li><li>Open the Domain management tab</li><li>Click Add domain</li></ol><p>Amplify will now walk you through the domain setup process step by step.</p><h3>Step 3: Configure Domain and Subdomain Mapping</h3><p>You’ll be asked to enter your domain name (for example, yourdomain.com) and choose how it should map to your Amplify app.</p><p>You can map:</p><ul><li>the root domain (yourdomain.com)</li><li>or a subdomain (app.yourdomain.com, dashboard.yourdomain.com, etc.)</li></ul><p>You’ll also map the domain to a specific branch, typically the main branch.</p><p>For example:</p><pre>yourproject.yourdomain.com → main</pre><p>This tells Amplify which version of your app should be served to users when they visit the domain.</p><h3>Step 4: DNS Configuration</h3><h4>Case 1: Domain Managed in Route 53</h4><p>If your domain is hosted in Route 53, this is the easiest case.</p><p>Amplify will:</p><ul><li>Automatically create the required DNS records</li><li>Validate domain ownership</li><li>Request and attach SSL certificates</li></ul><p>You simply review the configuration and confirm.</p><h4>Case 2: Domain Managed Outside AWS</h4><p>If your domain is hosted with another provider, Amplify will show DNS records such as:</p><ul><li>CNAME records</li><li>A or ALIAS records</li></ul><p>You’ll need to copy these values and paste them into your domain provider’s DNS settings.</p><p>Once the records propagate, Amplify will automatically verify ownership and continue the setup.</p><h3>Step 5: SSL and HTTPS (Fully Automated)</h3><p>One of the best features of AWS Amplify is that you don’t have to manually manage SSL certificates.</p><p>Amplify automatically:</p><ul><li>Requests certificates from AWS Certificate Manager</li><li>Validates them</li><li>Enables HTTPS for your domain</li></ul><p>After a short wait, your application becomes available securely at:</p><pre>https://yourproject.yourdomain.com</pre><p>No additional configuration is required.</p><h3>What Happens When You Push New Code?</h3><p>Nothing changes in your development workflow.</p><p>Every time you push new code to GitHub:</p><pre>git add .<br>git commit -m &quot;New feature&quot;<br>git push</pre><p>Amplify:</p><ul><li>Detects the update</li><li>Rebuilds the application</li><li>Redeploys it</li><li>Updates the custom domain automatically</li></ul><p>Your custom URL always points to the latest version of your app.</p><h3>Common Questions</h3><p><strong>Do I need to manually configure CloudFront or S3?</strong><br> No. Amplify abstracts all of that.</p><p><strong>Do I need to renew SSL certificates?</strong><br> No. Amplify handles renewals automatically.</p><p><strong>Can I attach multiple domains or subdomains to a single account?</strong><br> Yes. Amplify supports multiple domain mappings.</p><h3>Conclusion</h3><p>Adding a custom domain was the moment my application stopped feeling like a demo and began to feel like <em>something real</em>. The functionality was already there in Part 1, but Part 2 gave the project an identity, a clean URL, HTTPS by default, and a level of professionalism that matters when sharing your work with advisors, collaborators, or users.</p><p>What stood out to me most was how AWS Amplify handled all the complexity quietly in the background. DNS records, SSL certificates, and HTTPS configuration are traditionally areas where many beginners get stuck. With Amplify, these steps become guided and manageable, allowing you to focus on your application rather than infrastructure details.</p><p>If you’ve followed <strong>Part 1 and Part 2</strong>, you now have:</p><ul><li>a deployed React application</li><li>an automated CI/CD workflow through GitHub</li><li>a clean, professional custom domain</li><li>secure HTTPS is enabled by default</li></ul><p>This is no longer just a local project, it’s a real, shareable web application.</p><p>In <strong>Part 3</strong>, we’ll complete the picture by connecting this Amplify-hosted frontend to a <strong>backend running on EC2</strong>, creating a full frontend-backend cloud architecture.</p><p>Thank you so much for reading.<br>I truly appreciate you being here. Stay tuned for Part 3</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41e5b4f60a0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1 — Hosting Your First React App using AWS Amplify (Beginner-Friendly Guide)]]></title>
            <link>https://medium.com/@psanjita18/part-1-hosting-your-first-react-app-using-aws-amplify-beginner-friendly-guide-6dae499c611c?source=rss-1883016b9a88------2</link>
            <guid isPermaLink="false">https://medium.com/p/6dae499c611c</guid>
            <category><![CDATA[web-hosting]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-amplify]]></category>
            <dc:creator><![CDATA[Sanjita Prajapati]]></dc:creator>
            <pubDate>Mon, 08 Dec 2025 22:07:23 GMT</pubDate>
            <atom:updated>2025-12-08T22:07:23.968Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 1 — Hosting Your First React App using AWS Amplify (Beginner-Friendly Guide)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4E-vV9WRmmvq0UuYDoizJA.jpeg" /><figcaption>Source: <a href="https://www.kansoftware.com/what-is-cloud-based-system-engineering-a-360-overview/">https://www.kansoftware.com/what-is-cloud-based-system-engineering-a-360-overview/</a></figcaption></figure><p>As the world rapidly moves toward cloud-based applications, one of the most important skills for any developer is learning how to transition a project from <strong>local development</strong> to a <strong>live, shareable website</strong>. A React app running on your laptop is useful only to you, but once you publish it online, it becomes something others can see, interact with, and evaluate.</p><p>When I was building my first React dashboard for my research work, everything looked perfect on localhost:3000. The graphs updated in real-time, the UI was clean, and the API calls were working. I proudly showed it during a meeting, and then my advisor casually asked:</p><p><strong>“This is great… can you share the link with the team?”</strong></p><p>That one question completely changed how I thought about development. <br> I realised that building the app was only <strong>half the journey</strong>. <br> The other half was learning how to <strong>deploy</strong> it.</p><p>And like most beginners, I had no idea where to start.</p><p>This is exactly the problem <strong>AWS Amplify</strong> solves: a simple and reliable way to take your frontend code and publish it on the internet.</p><h3>Introduction</h3><p>Before diving into Amplify, let’s understand the broader context.</p><p>AWS (Amazon Web Services) is a cloud platform that offers more than 200 services for computing, storage, networking, databases, AI/ML, and application hosting. It powers a huge portion of the modern internet.</p><p>According to AWS:</p><blockquote><strong><em>“Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform.”</em></strong></blockquote><p>Within AWS, there is a service specifically designed for frontend hosting, CI/CD, backend integration, and modern app development:</p><blockquote><strong><em>“AWS Amplify is a set of tools and services that help frontend developers build, ship, and host full-stack applications on AWS.”</em></strong></blockquote><p>In simple words:</p><ul><li>You write your React code</li><li>Push it to GitHub</li><li>Amplify pulls it, builds it, and hosts it automatically</li></ul><p>No servers, no manual uploads and most importantly, no complex configurations.</p><p>Just connect once, and Amplify takes care of the rest.</p><h3>Why do we need Amplify?</h3><p>There are many ways to deploy a web app, including S3 + CloudFront, EC2 + NGINX, Firebase, Netlify, Vercel, and others. But Amplify solves one major beginner problem:</p><p><strong>Deployment should not be harder than development.</strong></p><p>Traditionally, hosting on AWS required:</p><ul><li>Creating an S3 bucket</li><li>Setting public access permissions</li><li>Uploading build files</li><li>Configuring CloudFront</li><li>Adding SSL certificates</li><li>Managing DNS records</li><li>Repeating everything each time you update your code</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWT3bn7gCUP7rINDtp18ig.jpeg" /><figcaption>Tradition deployment approach using AWS</figcaption></figure><p>Amplify simplifies all of this into <strong>three steps</strong>:</p><ol><li>Connect your GitHub repo</li><li>Deploy with one click</li><li>Push code → Amplify redeploys automatically</li></ol><p>This is why Amplify is ideal for students, researchers, and developers who want a clean workflow without deep DevOps knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Fi6j-ILqM4rCV7w-nEC1w.jpeg" /><figcaption>Deployment with AWS Amplify</figcaption></figure><h3>Step 1 — Push Your React App to GitHub</h3><p>Amplify needs a Git repository as the “source” for deployment. <br> If your React project is ready, open your terminal:</p><pre>cd your-react-project <br>git init <br>git add . <br>git commit -m &quot;Initial commit&quot;</pre><p>Create a GitHub repository and push your code:</p><pre>git remote add origin https://github.com/&lt;username&gt;/&lt;repo&gt;.git <br>git branch -M main <br>git push -u origin main</pre><p>Your project is now hosted on GitHub — the first step toward deployment.</p><h3>Step 2 — Deploy Through AWS Amplify</h3><p>Once your code is on GitHub:</p><ol><li>Open <strong>AWS Amplify Console</strong></li><li>Click <strong>“New App” → “Host web app”</strong></li><li>Select <strong>GitHub</strong></li><li>Authorize access</li><li>Choose your repository and branch</li></ol><p>Amplify will auto-detect your framework and show default build settings like:</p><pre>npm install <br>npm run build <br>npm run export</pre><p>Click <strong>Deploy</strong>.</p><p>Amplify will:</p><ul><li>Download your code</li><li>Install dependencies</li><li>Build your React app</li><li>Host it globally</li><li>Provide a URL like:</li></ul><p><a href="https://main.randomhash.amplifyapp.com/">https://main.randomhash.amplifyapp.com</a></p><p>Your dashboard is officially online.</p><h3>Step 3 — Updating Your App</h3><p>This part is effortless.</p><p>If you add a new page, fix a bug, or change the UI, simply push to GitHub:</p><pre>git add . <br>git commit -m &quot;UI update&quot; <br>git push</pre><p>Amplify will automatically:</p><ul><li>Detect the commit</li><li>Rebuild your project</li><li>Redeploy the new version</li><li>Update the live link</li></ul><p>You never have to upload anything manually.</p><h3>Conclusion</h3><p>When I built my first React dashboard, deployment felt like a huge mystery. AWS Amplify changed that. It transformed something overwhelming into something smooth and even enjoyable. With one connection to GitHub, my project transitioned from <em>being a local project on my laptop</em> to a fully deployed, publicly accessible website.</p><p><strong><em>“Amplify gives beginners a powerful way to publish real applications without learning complex cloud systems.”</em></strong></p><p>If you’re a student, researcher, or developer trying to get your first app online, I hope this guide made the process clearer and a little less intimidating. You’re already building great things; now it’s time to share them with the world.</p><p>Thank you so much for reading.<br>I appreciate you being here.<br>Stay tuned for <strong>Part 2</strong>, where we set up your <strong>custom domain</strong> and make your project look truly professional.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dae499c611c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GStreamer Pipeline and Elements with Usage (in C++) — Part 3]]></title>
            <link>https://medium.com/@psanjita18/gstreamer-pipeline-and-elements-with-usage-in-c-part-3-e0deb5dfe307?source=rss-1883016b9a88------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0deb5dfe307</guid>
            <category><![CDATA[gstreamer]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[video-processing]]></category>
            <dc:creator><![CDATA[Sanjita Prajapati]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 04:12:27 GMT</pubDate>
            <atom:updated>2025-01-06T04:12:27.764Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>GStreamer Pipeline and Elements with Usage (in C++) — Part 3</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbnFN0N3pxai2ZOIE9DsKg.jpeg" /></figure><p>In my previous blog, I covered the basics of GStreamer pipelines, including Source and Sink elements. This post is the third part of the series, where we will dive deeper into Filter-like elements (encoders, decoders, multiplexers, demultiplexers) and introduce additional components such as Queue, Tee, and Buffer.</p><p>If you missed the previous blogs, you can check it out here</p><ul><li><a href="https://medium.com/@psanjita18/introduction-to-gstreamer-in-c-part-1-39f122bbba28">Introduction to GStreamer (in C++) # Part 1</a></li><li><a href="https://medium.com/@psanjita18/gstreamer-pipeline-and-elements-in-c-part-2-43c76753b6a4">Gstreamer Pipeline and Elements (in C++) # Part 2</a></li></ul><h3>Filters and Filter-like Elements</h3><p>Filters and filter-like elements possess both source and sink pads. They take input data from the sink pad, process it, and produce output through the source pad. Filters are essential in media pipelines for tasks like encoding, decoding, and format conversion.</p><p><strong><em>Categories of Filters</em></strong></p><p>Filters perform specific operations on data and can be categorized as:</p><ul><li><strong>Converters</strong>: Convert data from one format to another.</li><li><strong>Muxers</strong>: Merge multiple input streams into a single output.</li><li><strong>Demuxers</strong>: Split a single input stream into multiple outputs.</li><li><strong>Codecs</strong>: Handle encoding and decoding of media data.</li></ul><p>Filters may have multiple source and sink pads. For example, converting a video from .avi to .mp4 requires both encoding and decoding steps.</p><p>Since GStreamer offers a vast array of filters, we’ll discuss some key types in this blog.</p><p><strong><em>Codecs</em></strong></p><p>Codecs are filters designed for encoding or decoding media streams. They can handle video, audio, or waveform data and typically feature one source pad and one sink pad.</p><ol><li><strong><em>Encoding</em></strong></li></ol><p>Encoding transforms media data into specific formats for better transmission or storage. Common encoders include:</p><ul><li><strong>x264enc</strong>: Encodes video in H.264 format.</li><li><strong>x265enc</strong>: Encodes video in H.265 format.</li><li><strong>jpegenc</strong>: Encodes images into JPEG format.</li></ul><p><strong><em>2. Decoding</em></strong></p><p>Decoding reverses the encoding process, converting data back to its original form. Popular decoders are:</p><ul><li><strong>decodebin</strong>: A flexible decoder supporting formats like MP4, AVI, H.264, and H.265.</li><li><strong>uridecodebin</strong>: Ideal for URI-based sources.</li><li><strong>vorbisdec</strong>: Decodes audio in the Vorbis format.</li><li><strong>theoradec</strong>: Decodes video in OGG format.</li></ul><p><strong><em>Converters</em></strong></p><p>Converters modify data formats. For example, a video converter can alter resolution, pixel format, or color space.</p><p><strong><em>Multiplexers (Muxers)</em></strong></p><p>Multiplexers combine different streams into one. A typical use case is merging audio and video into a single multimedia file. While this may seem like a standard setup, behind the scenes, these are two separate streams being merged into a single feed. Multiplexers are also employed in computer vision for batch processing multiple video streams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VzsdHh3zlmDAJAGIlGwDQ.jpeg" /><figcaption>Pipeline for Multiplexer</figcaption></figure><p>Examples:</p><ul><li><strong>mp4mux</strong>: Combines video and audio into an MP4 file.</li><li><strong>avimux</strong>: Creates AVI containers by merging streams.</li></ul><p><strong><em>Demultiplexers (Demuxers)</em></strong></p><p>Demultiplexers, or “demuxers,” split a single input stream into separate sub-streams, such as audio and video. They have one input pad and multiple output pads, earning them the nickname “one-to-many” filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ygZ43doZn65GpnRG7z9gDw.jpeg" /><figcaption>Pipeline for Demultiplexer</figcaption></figure><p>Examples:</p><ul><li><strong>qtdemux</strong>: Demultiplexes QuickTime (MP4) files.</li><li><strong>oggdemux</strong>: Demultiplexes OGG streams.</li></ul><h3><strong>Bins</strong></h3><p>Bins are containers that group linked elements, enabling them to act as a single logical unit. Using bins simplifies complex pipelines by encapsulating functionality into manageable components. Organizing pipelines into bins is a best practice for readability and maintainability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNqIStuWBBiaZHR1ml4PfA.jpeg" /><figcaption>Example of Bins in GST</figcaption></figure><h3><strong>Pads and Capabilities</strong></h3><p>Pads are the connection points between elements. A source pad outputs data, while a sink pad receives it, making pads fundamental for constructing pipelines.</p><p><strong>Types of Pads</strong></p><ol><li><strong>Static Pads</strong>: Always present on an element.</li><li><strong>Dynamic Pads</strong>: Created or removed at runtime based on the media stream.</li><li><strong>Request Pads</strong>: Explicitly created upon request, useful for multiplexers and tee elements.</li></ol><p><strong><em>Dynamic Pads</em></strong></p><p>Some elements might not have all of their pads when the element is created. This can happen in cases such as demultiplexers. For example, if the input data contains both audio and video, the demuxer will create two source pads. If the input contains audio, video, and subtitles, it will create three source pads accordingly. The demuxer may also delete pads when the corresponding stream ends.</p><p><strong><em>Request Pads</em></strong></p><p>An element can also have request pads, which are not created automatically but only on demand. These pads are particularly useful for multiplexers, aggregators, and tee elements. Aggregators are elements that merge several input streams into one output stream.</p><p><strong>Capabilities (Caps)</strong></p><p>Pads advertise the type of media they can handle through capabilities, which specify properties such as media type, codec, resolution, and framerate. Capabilities ensure compatibility between connected elements.</p><p><strong><em>Ghost Pads</em></strong></p><p>Ghost pads are virtual pads used on bins to link internal elements with the external pipeline. They allow seamless data flow in and out of a bin.</p><h3><strong>Event States</strong></h3><p>GStreamer defines various states for elements, controlling their behavior during playback:</p><ul><li><strong>GST_STATE_NULL</strong>: This is the default state. No resources are allocated in this state, so transitioning to it will free all resources. The element must be in this state when its refcount reaches 0 and it is freed.</li><li><strong>GST_STATE_READY</strong>: In the ready state, an element has allocated all of its global resources — that is, resources that can be kept across streams. The stream is not opened in this state, so the stream position is automatically zero. If a stream was previously opened, it should be closed in this state, and the position, properties, and other parameters should be reset.</li><li><strong>GST_STATE_PAUSED</strong>: In this state, an element has opened the stream but is not actively processing it. An element is allowed to modify the stream’s position, read and process data, and prepare for playback as soon as the state changes to PAUSED, but it is not allowed to play the data, which would make the clock run. In summary, PAUSED is the same as PLAYING but without a running clock.</li></ul><p>Elements transitioning to the PAUSED state should prepare themselves for moving over to the PLAYING state as soon as possible. For instance, video or audio outputs would wait for data to arrive and queue it so they can play it immediately after the state change. Additionally, video sinks can already render the first frame (since this does not affect the clock yet). Autopluggers could use this state transition to plug together a pipeline. Most other elements, such as codecs or filters, do not need to explicitly do anything in this state.</p><ul><li><strong>GST_STATE_PLAYING</strong>: In the PLAYING state, an element behaves the same as in the PAUSED state, except that the clock now runs, enabling active playback.</li></ul><h3><strong>Extra Elements</strong></h3><p>Gst provides some other useful elements as well. Like queue, tee, and buffer element. Let discuss about it in detail.</p><p><strong><em>Queue</em></strong></p><p>A <strong>queue</strong> element buffers data and allows different parts of a pipeline to operate asynchronously. Queues are essential for handling streams with varying processing speeds.</p><p>Data is queued until one of the limits specified and/or properties has been reached. Any attempt to push more buffers into the queue will block the pushing thread until more space becomes available. A queue can appear almost anywhere in a GStreamer pipeline. Like most elements, it has an input (sink) and output (src). It has two uses:</p><ul><li><strong>As a thread boundary</strong>: The elements after a queue will run in a different thread to those before it.</li><li><strong>As a buffer</strong>: When different parts of the pipeline may move at different speeds.</li></ul><p><strong><em>TEE</em></strong></p><p>A <strong>tee</strong> element splits a data stream, enabling it to be sent to multiple downstream elements simultaneously. This is particularly useful for scenarios like displaying and recording a video simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LBmkBh9hv7ZsV5h3fNqEUQ.jpeg" /><figcaption>Basic pipeline using Tee element for display and storage of media stream</figcaption></figure><p><strong><em>Buffer</em></strong></p><p>A <strong>buffer</strong> serves as temporary storage for data as it moves through the pipeline. Typically, a source element creates a new buffer and sends it through a pad to the next element in the sequence. In the context of building a media pipeline with GStreamer, we don’t need to manually manage buffers — the elements in the pipeline handle that for us.</p><p>Each buffer consists of several components:</p><ul><li><strong>Memory pointers:</strong> These point to memory objects, which represent specific regions in memory.</li><li><strong>A timestamp:</strong> This marks the exact time for the buffer.</li><li><strong>Reference count (refcount):</strong> This indicates how many elements are currently using the buffer. When no element holds a reference to it, the buffer is destroyed.</li><li><strong>Buffer flags:</strong> Various flags may describe properties or states of the buffer.</li></ul><p>In a typical scenario, a buffer is created, memory is allocated, data is placed inside, and it’s passed along to the next element. The receiving element processes the data — such as by decoding it — and then “unreferences” the buffer, meaning it no longer holds onto it. When the refcount drops to zero (i.e., no other element is using the buffer), the buffer is freed, and its memory is released. This is how most video and audio decoders operate.</p><p><strong><em>Clock and Bus</em></strong></p><ul><li><strong>Clock</strong>: Synchronizes elements for proper timing, ensuring that audio and video play in sync.</li><li><strong>Bus</strong>: Facilitates message passing between elements, aiding in debugging and event handling. A message bus can be attached to the pipeline to monitor events such as errors, warnings, and state changes.</li></ul><h3><strong>In Conclusion</strong></h3><p>We explored advanced elements of GStreamer pipelines, including filters (such as encoders, decoders, muxers, and demuxers), as well as additional components like Queue, Tee, and Buffer. These elements are essential for processing, synchronizing, and managing data streams within a pipeline. Filters handle tasks like encoding, decoding, and format conversion, while queues and tees provide buffering and branching functionality. Buffers facilitate smooth data flow, and the clock and bus synchronize and communicate between elements.</p><p>With this deeper understanding of GStreamer’s core components, you’re now equipped to create more complex and efficient media pipelines. In the next part of the series, we’ll dive into GStreamer installation, terminal-based pipeline examples, and detailed code flow for pipeline creation. Stay tuned and feel free to share any comments or questions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0deb5dfe307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gstreamer Pipeline and Elements (in C++) # Part 2]]></title>
            <link>https://medium.com/@psanjita18/gstreamer-pipeline-and-elements-in-c-part-2-43c76753b6a4?source=rss-1883016b9a88------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c76753b6a4</guid>
            <category><![CDATA[gstreamer]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[video-processing]]></category>
            <dc:creator><![CDATA[Sanjita Prajapati]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 15:16:41 GMT</pubDate>
            <atom:updated>2023-07-13T15:16:41.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*qqSLD52u_BwwVy7hJpnp9A.jpeg" /></figure><p>In my previous blog post, I provided a concise overview of various aspects related to Gstreamer, such as pipelines, installation procedures and more. If you haven’t had a chance to read it yet, I encourage you to refer to the link below for further details.</p><p><a href="https://medium.com/@psanjita18/introduction-to-gstreamer-in-c-part-1-39f122bbba28">https://medium.com/@psanjita18/introduction-to-gstreamer-in-c-part-1-39f122bbba28</a></p><p>This is the second blog of this series. In this blog, let us talk in detail about Gstreamer pipelines, Elements, Source element, Sink element and their usage.</p><h3><strong>GST Pipeline or Graph</strong></h3><p>Pipeline is set of instructions use to perform a particular task. Gstreamer is a pipeline-based framework, it takes the input, process it according to the requirement and give us back the output.</p><p>All the blocks of the Gst Pipelines are known as Gst Elements. It is also known as plugins, which is an abstracted class written in C or C++, tends to perform the required task. Gstreamer framework provides four distinct categories of elements.</p><ol><li>Source Elements</li><li>Sink Elements</li><li>Filter like Elements</li><li>Some Extra Elements</li></ol><p>Let us discuss about this in detail.</p><h3><strong>Source Element</strong></h3><p>It is the starting element of any GST pipeline. Source elements helps us to upload the data in the pipeline and perform the further processing. A source can be of two types, either live or recorded. Gstreamer provides plugins which can work on both type of sources.</p><p>In live sources, streaming is happening in real time, hence we loss the data when we temporarily stop reading. Whereas in recorded sources, there is no loss of data, as it is already been stored in a particular location.</p><p>Source element can be changed as per the requirements and availability of resources. There are many source elements, but I will only cover commonly used ones. Some of those are,</p><ol><li><strong>Filesrc </strong>— This plugin reads the data from local file system. It has one property, location, which is used to provide the file path in local directory. Location parameter takes the character array as input (gchararray).</li></ol><p>Usage:</p><pre>gst-launch-1.0 filesrc location = ‘./sample_video’ ! decodebin ! autovideosink</pre><p>2. <strong>Videotestsrc </strong>— This plugin is used to generate test or sample video data in variety of formats. It has many different properties, the major property is Pattern, we can use it to generate different pattern video data. There are 25 different patterns available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*q3UJjtxNRTAbLecR6K67Lg.png" /><figcaption>Source: <a href="https://gstreamer.freedesktop.org/documentation/videotestsrc/index.html?gi-language=c">https://gstreamer.freedesktop.org/documentation/videotestsrc/index.html?gi-language=c</a></figcaption></figure><p>There are some other properties also, please refer to the link below.</p><p><a href="https://gstreamer.freedesktop.org/documentation/videotestsrc/index.html?gi-language=c">https://gstreamer.freedesktop.org/documentation/videotestsrc/index.html?gi-language=c</a></p><p>Usage:</p><pre>gst-launch-1.0 videotestsrc pattern=ball ! autovideosink</pre><p>you can also use index number in place of keyword in pattern property.</p><p>3. <strong>Audiotestsrc </strong>—Like videotestsrc, this plugin is used to generate basic audio signals. It has different waveforms. And we can also select the frequency and volume.</p><p>Usage:</p><pre>gst-launch-1.0 audiotestsrc ! audioconvert ! autoaudiosink</pre><p>4. <strong>Udpsrc </strong>—It is a network source, which reads the UDP packets from the network. UDP is User Datagram Protocol, which is a transport layer protocol and is part of internet protocol suite. Unlike other protocols, in UDP there is no need to set up connection prior to data transfer.</p><p>Usage:</p><pre>gst-launch-1.0 -v udpsrc ! fakesink dump=1 </pre><p>If you want to receive the UDP packets in a specific port, use port property</p><pre>gst-launch-1.0 -v udpsrc port=0 ! fakesink</pre><p>There are some other properties, like address, buffer-size, Uri, socket etc. Please refer to the link below</p><p><a href="https://gstreamer.freedesktop.org/documentation/udp/udpsrc.html?gi-language=c">https://gstreamer.freedesktop.org/documentation/udp/udpsrc.html?gi-language=c</a></p><p>5. <strong>Rtspsrc </strong>— It makes the connection with RTSP servers and reads the data from there. RTSP is a real Time Streaming Protocol, it is an application-level communication protocol, used to transfer real time data to the receiving end.</p><p>Usage:</p><pre>gst-launch-1.0 rtspsrc location=rtsp://server/url ! fakesink </pre><p>6. <strong>V4l2src </strong>—This plugin works only on Linux operating system. It is used for v4l2 devices, like webcam or cameras. This plugin should be used when camera is directly connected to the system using USB port. An alternative for windows is ksvideosrc, this works in the similar way.</p><p>Usage:</p><pre>gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert ! autovideosink</pre><p>Device property is used for device location. You can use the command below to check the exact location of your cameras.</p><pre>v4l2-ctl --list-devices</pre><h3><strong>Sink Element</strong></h3><p>Sink elements are termination point of a Gstreamer pipeline. These elements consume the data by storing or streaming the data. It accepts all types of data and does not produce anything out of it. Like Source elements, Gstreamer provides us many types of Sink Element too and can be choose according to the requirements.</p><p>Some commonly used Sink Elements are,</p><ol><li><strong>Filesink </strong>— This plugin is used to write the data in the local file system. There is one important property, I.e., location, in this we must mention an absolute path with name of the file to be stored.</li></ol><p>Usage:</p><pre>gst-launch-1.0 filesrc location = sample2.ogg ! oggdemux ! theoradec ! x264enc !   filesink location = sample3.h264 </pre><p>Before writing the video in the local file system, we should use appropriate decoders, as per the file extension. We will discuss about this in my next blog.</p><p>2. <strong>Autovideosink </strong>— This plugin is used to display the stream on screen. This sink element automatically detects the right sink to use, that is why we do not need to worry about the decoders.</p><p>Usage:</p><pre>gst-launch-1.0 videotestsrc pattern=1 ! autovideosink</pre><p>3. <strong>Fakesink </strong>— This plugin is a dummy sink, which absorbs all the data and does nothing with it. It does not store or stream the data. This plugin is used in those pipelines where we want to stop the pipeline without saving or streaming the data.</p><p>It also has some properties like, sync (it synchronises the different streams), dump (dumps the content on terminal), etc.</p><p>Usage:</p><pre>gst-launch-1.0 videotestsrc pattern=1 ! fakesink</pre><p>4. <strong>Udpsink </strong>—It is a network sink, which sends UDP packets to the network. It should be used in case of UDP protocol streaming, I.e., online streaming. There are only two properties, host (The host or IP to send packets to) and port (to send packets to).</p><p>Usage:</p><pre>gst-launch-1.0 -v videotestsrc ! udpsink </pre><h3>In Conclusion</h3><p>In this blog, I tried to mention in detail about Gstreamer pipeline and commonly used Source and Sink Elements. My next blog will be continuation of this one, where I will explain about Filter like elements (encoder, decoder, multiplexer, demultiplexer etc), and some extra elements (Queue, Tee, Buffer etc).</p><p>If you enjoyed this blog post, share it with a friend!</p><p>If you have any further questions, I would be delighted to answer them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c76753b6a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to GStreamer (in C++) # Part 1]]></title>
            <link>https://medium.com/@psanjita18/introduction-to-gstreamer-in-c-part-1-39f122bbba28?source=rss-1883016b9a88------2</link>
            <guid isPermaLink="false">https://medium.com/p/39f122bbba28</guid>
            <category><![CDATA[gstreamer]]></category>
            <category><![CDATA[video-processing]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Sanjita Prajapati]]></dc:creator>
            <pubDate>Mon, 08 May 2023 10:51:51 GMT</pubDate>
            <atom:updated>2023-05-08T10:51:51.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*nG9p4uSzS22-ZzEZYeiRJQ.jpeg" /></figure><p>As we are rapidly moving towards Artificial Intelligence based technology, camera-based systems are helping us to render more information from the surroundings. Cameras are also a sensor which can give information in digital image / video format, which can be further used in Computer Vision based applications.</p><p>Before start working on Computer Vision, we should know some basic concepts of video processing. It will be helpful for creating our own inferencing pipelines.</p><p>Whenever we are working on applications which are near to hardware, always prefer C or C++ as your coding language. I will talk about this in my upcoming blogs. Our focus in this blog is GStreamer, which is a framework, written over C++, used for video editing, video rendering, etc.</p><p>When I started working on Computer Vision, firstly I gained a deeper understanding of GStreamer framework. It is a building block for any Computer Vision based application. In this series of blog, I will be sharing my knowledge on GStreamer framework with the help of multiple applications.</p><h3><strong>Introduction</strong></h3><p>If we go according to the formal definition then, GStreamer is a framework, which helps in constructing graphs of media handling components. In other words, GStreamer plays a vital role in video processing, video editing, video rendering and eventually it is a building block for many Computer Vision based applications. It helps us to create media pipelines for the required applications. Gstreamer is faster as compared to other video processing libraries, as it is written in C++.</p><p>Media pipeline is nothing but a chain of media elements, where the stream of data flows from starting point to an end point, with one or many filters in between. In other words, the media pipeline represents a “machine” that can perform a sequence of operations over a media stream (image/video data).</p><h3><strong>GST Pipeline or Graph</strong></h3><p>GStreamer pipeline is a set of data processing elements connected in series, where the output of one element is the input of next element. The Gstreamer pipeline can also be considered as linked list of data processing elements.</p><p>We can also consider it as a closed system, I.e., every closed system must have input element (to feed the data to the pipeline), output element (to store the output of a closed system in required format) and some filters (to perform the desired processing).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*MKye2ZokLZ822Y1yQOxHdA.png" /><figcaption>Fig 1: Basic Structure of Gst pipeline</figcaption></figure><p>The basic structure of any GST pipeline is shown in the figure. The dashed boxes are represented as Gst Elements. Like the closed system, Gst pipeline should have an input element, output element and minimum one filter like element (We can have many filters as per our requirement).</p><p>The source element, it is the initial element of every Gst Pipeline or an input node. These are the elements which can be used to generate data (using http or locally stored files) for the use of pipelines. It feeds the data into the pipeline.</p><p>The sink element, it is the termination point of Gst pipeline. These elements can store or display the processed data. It accepts the data but do not produce anything out of it.</p><p>The filter are the elements, which use to process data according to requirement. Filter like element can be converter (which converts data from one format to another), muxer (many inputs to one output), demuxer (one input to many different outputs) and Codecs (encodes or decodes the given data).</p><h3><strong>Gstreamer Installation and Setup</strong></h3><p><strong>In Linux (Ubuntu):</strong></p><p>Run the following command to install gstreamer framework in your Linux system:</p><pre>sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio </pre><p>Using this command, you can get access to the command line interface of Gstreamer framework. But to write code in C++ on IDE (integrated development environment), we need to follow some other steps.</p><p><strong>— Building an application using Gst</strong></p><p>Development environment requires gcc or g++ compiler depending upon the language you are choosing, I.e., For C++ we have g++ compiler and for C we have gcc compiler</p><p>In order to compile the code which requires Gst core library, use this command after your gcc or g++ command</p><p>“<strong><em>pkg-config — cflags — libs gstreamer-1.0</em></strong>”</p><p>The command will look like,</p><pre>gcc hello_world.c -o hello_world ‘pkg-config --cflags --libs gstreamer-1.0’ </pre><p><strong>— Building a tutorial</strong></p><p>Gst provides some tutorials, you can clone using the command below</p><pre>git clone https://gitlab.freedesktop.org/gstreamer/gstreamer <br><br>gcc basic-tutorial-1.c -o basic-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0` </pre><p>Change the basic-tutorial-1.c according to the tutorial you are interested in. And run the following command</p><pre>./basic-tutorial-1</pre><p><strong>In Windows:</strong></p><ol><li>Download GSTREAMER library from the given link</li></ol><p><a href="https://gstreamer.freedesktop.org/download/">Download GStreamer</a></p><p>2. Set path of libs in system environment variables</p><p>Environment Variables → System variables → Variable :Path → Edit → New → Paste</p><p><strong>“C:\gstreamer\1.0\msvc_x86_64\bin</strong>” &gt; OK</p><p>3. Include the paths given below in Visual Studio property pages</p><p>a. <strong>In VC++ Directories</strong></p><ul><li><strong>Include Directories</strong></li></ul><p>1. path\gstreamer\1.0\x86_64\include\glib-2.0</p><p>2. path\gstreamer\1.0\x86_64\include\gstreamer-1.0</p><p>3. path\gstreamer\1.0\x86_64\lib\glib-2.0\include</p><p>4. path\gstreamer\1.0\x86_64\lib\gstreamer-1.0\include</p><ul><li><strong>Library Directories</strong></li></ul><p>1. path\gstreamer\1.0\x86_64\lib</p><p>b.<strong> Linker</strong></p><ul><li>Input -&gt; Additional Dependencies</li></ul><p>1. path\gstreamer\1.0\x86_64\lib\*.lib</p><p>Refer to the link below for tutorials,</p><p><a href="https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-docs"><strong>https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-doc</strong>s</a></p><p>Or you can clone the gstreamer GitHub repository.</p><p><strong>git clone </strong><a href="https://gitlab.freedesktop.org/gstreamer/gstreamer"><strong>https://gitlab.freedesktop.org/gstreamer/gstreame</strong>r</a></p><h3><strong>Command line Tool of Gstreamer</strong></h3><p>Gstreamer provides a feature, using which we can create media pipeline on terminal itself, I.e., <strong>gst-launch-1.0</strong>. Gst-launch-1.0 is a command line tool which is used for prototyping media pipeline. Ideally, we should create the pipeline using this before turning it into a code.</p><p>We can connect elements (link elements) by using exclamation mark (!). For example,</p><pre>gst-launch-1.0 filescr location= file.mp3 ! decodebin ! autoaudiosink </pre><p>Filesrc (source) — it can read data from file and pass that on in the media pipeline</p><p>Decodebin (filter) — This filter decodes the input video. It decodes the video automatically in any input and output format. If you are not sure about the decoding format, then use this filter.</p><p>Autoaudiosink (sink) — It is a sink plugin, which helps to display the video locally.</p><h3><strong>In Conclusion</strong></h3><p>Gstreamer is a great tool for media-based applications, including Computer Vision. Today, it has been used to develop encoders using cameras from RTSP, and many more cases.</p><p>I hope you had a wonderful time reading this piece. And if you have any more questions, I would be delighted to answer them.</p><p>Also, I am starting a series of blogs on Gstreamer, and I will try to explain all the aspects of Gstreamer in much easier way. If you have any opinions or suggestions for improving this blog, I would like to hear.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39f122bbba28" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>