<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Fabre Lambeau &#8211; Bitmovin</title>
	<atom:link href="https://bitmovin.com/author/fabre-lambeau/feed" rel="self" type="application/rss+xml" />
	<link>https://bitmovin.com</link>
	<description>Bitmovin provides adaptive streaming infrastructure for video publishers and integrators. Fastest cloud encoding and HTML5 Player. Play Video Anywhere.</description>
	<lastBuildDate>Wed, 10 May 2023 15:56:38 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://bitmovin.com/wp-content/uploads/2023/11/bitmovin_favicon.svg</url>
	<title>Fabre Lambeau &#8211; Bitmovin</title>
	<link>https://bitmovin.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Cloud-based Per-Title Encoding Workflows (with AWS) – Part 3: Adding the Player and Video Analytics</title>
		<link>https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3</link>
		
		<dc:creator><![CDATA[Fabre Lambeau]]></dc:creator>
		<pubDate>Wed, 24 Mar 2021 17:30:32 +0000</pubDate>
				<category><![CDATA[Developers]]></category>
		<category><![CDATA[video analytics]]></category>
		<category><![CDATA[video player]]></category>
		<guid isPermaLink="false">https://bitmovin.com/?p=162050</guid>

					<description><![CDATA[<p>Cloud-Based Workflows with AWS: Plugging in the Video Player and Video Analytics In the first two parts of this series on using Bitmovin’s Per-Title Encoding on AWS, we’ve focused on the architecture of the application and setting up encoding using Bitmovin Cloud Connect. But now that we have our encoded videos saved to Amazon S3, what’s...</p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3">Cloud-based Per-Title Encoding Workflows (with AWS) – Part 3: Adding the Player and Video Analytics</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Cloud-Based Workflows with AWS: Plugging in the Video Player and Video Analytics</h1>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-large wp-image-162179" src="https://bitmovin.com/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding_p3-1-1024x537.png" alt="- Bitmovin" width="1024" height="537"><br />
<span style="font-weight: 400;">In the first two parts of this series on using Bitmovin’s <a href="https://bitmovin.com/encoding-service/per-title-encoding/">Per-Title Encoding</a> on AWS, we’ve focused on </span><span style="font-weight: 400;"><a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1/">the architecture of the application</a></span><span style="font-weight: 400;"> and <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p2/">setting up encoding</a> using <a href="https://bitmovin.com/introducing-cloud-connect-encoding-aws-gcp-azure/">Bitmovin Cloud Connect</a>. But now that we have our encoded videos saved to Amazon S3, what’s next? </span><span style="font-weight: 400;">In this part, I’ll complete the circle by introducing Bitmovin’s <a href="https://bitmovin.com/video-player">Video Player</a> and <a href="https://bitmovin.com/video-analytics">Video Analytics</a> products. I’ll explain how these two tools work together, and how to use them to gather data on user interaction with your content and measure quality of service. Finally, I’ll walk you through the setup that we used in our 2020 Bitmovin + AWS Hackathon to demonstrate the cost savings and performance of per-title encoding.</span></p>
<h2><span style="font-weight: 400;">Why Do Video Analytics Matter?</span></h2>
<p><span style="font-weight: 400;">Understanding how your content performs is important for a few reasons. First, detailed analytics can help you improve your quality of service as in the case of <a href="https://bitmovin.com/video-analytics-collectors/">Telekom Slovenjie</a>:</span></p>
<blockquote><p><span style="font-weight: 400;">“As a customer might call in, an agent could check the types of streams the user watched, which errors they were having and on which device, and would distinguish if the error is detected on a hardline or on the actual network. With the simple analytics collector and API implementation, Telekom Slovenjiie was able to reduce their support tickets by roughly 30 percent.”</span></p></blockquote>
<p><span style="font-weight: 400;">Not all video analytics providers offer as much granularity as Bitmovin. One of the big advantages of using a dedicated service for your video analytics is that <a href="https://bitmovin.com/video-error-cost-mitigation-granular-data/">you don’t have to know exactly what metrics you want to track in advance</a>. At Bitmovin, we record over <a href="https://bitmovin.com/docs/analytics/articles/dashboard-overview-of-analytics-metrics">forty metrics</a>.</span><br />
<span style="font-weight: 400;">The Bitmovin dashboard is the easiest way to have a first look at your data. It breaks it down into 3 areas:</span><b></b></p>
<ul>
<li aria-level="1"><b>Audience </b><span style="font-weight: 400;">shows you how people are engaging with your content. Metrics like number of plays, unique users, ISP, location, and view time are all available here.</span></li>
</ul>
<ul>
<li aria-level="1"><b>Quality of Service </b><span style="font-weight: 400;">tells you more about the user experience of your videos, which includes data like start time, bandwidth used, bitrate, etc.</span></li>
<li aria-level="1"><b>Advertising </b><span style="font-weight: 400;">is a must-have if you rely on advertising to fund your content, with metrics such as click-through rates, successful ad plays, and relative ad spot performance.</span></li>
</ul>
<h2><span style="font-weight: 400;">The Bitmovin Video Player</span></h2>
<p><span style="font-weight: 400;">Getting this much data from users who are streaming your videos requires to be deeply embedded in the playback sessions and therefore in the players themselves. That’s where the <a href="https://bitmovin.com/video-player">Bitmovin Video Player</a> comes in.</span><br />
<span style="font-weight: 400;">Not only does the Bitmovin Video Player provide the widest device support for playing your videos with efficient adaptive algorithms, including with multiple codecs, and allows you to dynamically insert ads into those streams, all through a rich universal yet configurable UI, but it also contains an event-based engine that will push that rich data to the Bitmovin Analytics solution to give you that fine-grained, accurate insight into how users are watching your videos.</span></p>
<figure id="attachment_162051" aria-describedby="caption-attachment-162051" style="width: 1024px" class="wp-caption aligncenter"><img decoding="async" class="size-large wp-image-162051" src="https://bitmovin.com/wp-content/uploads/2021/03/Bitmovin-Player-in-Action_Screenshot-1024x589.png" alt="Bitmovin Player in Action_Screenshot" width="1024" height="589" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Player-in-Action_Screenshot-300x173.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Player-in-Action_Screenshot.png?size=384x221&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Player-in-Action_Screenshot-768x442.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Player-in-Action_Screenshot-1024x589.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Player-in-Action_Screenshot.png?lossy=2&amp;strip=1&amp;webp=1 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-162051" class="wp-caption-text">Bitmovin Video Player in Action</figcaption></figure>
<h2><span style="font-weight: 400;">Proof through Video Analytics</span></h2>
<p><span style="font-weight: 400;">In the first and second parts of this blog series, in which we described the architecture and implementation of our application, we touched only briefly on the differences between a workflow that generates a static ladder and one that generated a ladder optimized with the Per-Title algorithm. That’s because those differences are small, and didn’t have a material impact on the implementation.</span><br />
<span style="font-weight: 400;">However, it is time to bring this back to the front. We are setting out to prove that Per-Title gives you significant savings when used in your production workflow, without impacting the playback experience. We can only do this through actual comparisons between different outputs encoded from the same assets.</span><br />
<span style="font-weight: 400;">There are usually two main ways in which Per-Title encoding delivers operational savings: reduced storage costs and reduced bandwidth costs.</span><br />
<span style="font-weight: 400;">The difference in storage costs is easy to calculate directly from the output of the encoding. Simply look at the difference in the total file size generated for the two encodings. The ratio between those will give you a simple and generally reliable answer. You can look at the files themselves on your Output bucket, or query the Bitmovin platform to retrieve the <a href="https://bitmovin.com/docs/encoding/api-reference/sections/statistics#/Encoding/GetEncodingStatisticsEncodingsByEncodingId">encoding’s statistics</a></span><span style="font-weight: 400;">. Since Per-Title will behave differently with different assets, it is best to take the average across a few representative assets into consideration for this calculation. </span><br />
<span style="font-weight: 400;">For bandwidth savings, it gets a bit more complicated. You could obviously look at the difference in bitrate between renditions in your 2 ladders, but there are a few complicating factors: the ladders will have a different number of renditions and different bitrates between them. And in reality, nobody streams all the renditions of your ladder at the same time. What renditions are actually played very much depends on your audience, what bandwidth they have available, what device they are playing on, etc.  You can try and model this playback usage, but at the end of the day, there is no better data than real data. Enter the Bitmovin Analytics…</span></p>
<figure id="attachment_162069" aria-describedby="caption-attachment-162069" style="width: 512px" class="wp-caption aligncenter"><img decoding="async" class="wp-image-162069 size-full" src="https://bitmovin.com/wp-content/uploads/2021/03/Bitrate-Expentiture-for-Encoding_Bitmovins-Video-Analytics_Screenshot.jpg" alt="Bitrate Expentiture for Encoding_Bitmovin's Video Analytics_Screenshot" width="512" height="268" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitrate-Expentiture-for-Encoding_Bitmovins-Video-Analytics_Screenshot-300x157.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitrate-Expentiture-for-Encoding_Bitmovins-Video-Analytics_Screenshot.jpg?size=384x201&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitrate-Expentiture-for-Encoding_Bitmovins-Video-Analytics_Screenshot.jpg?lossy=2&amp;strip=1&amp;webp=1 512w" sizes="(max-width: 512px) 100vw, 512px" /><figcaption id="caption-attachment-162069" class="wp-caption-text">Running a streaming simulation in the demo page based on a parallel playback session of the same asset with the 2 ladders shows a 49% saving in streaming costs for Per-Title. But how do we scale this to multiple assets, users, and playback sessions?</figcaption></figure>
<p><span style="font-weight: 400;">What metrics should we use for this?  We are obviously looking at the quality of service here, and the data we are after is captured by two main metrics: </span></p>
<ul>
<li aria-level="1"><b>Data Downloaded</b><span style="font-weight: 400;"> which shows the amount of video data downloaded during playback sessions by users.</span></li>
<li aria-level="1"><b>Video Bitrate </b><span style="font-weight: 400;">shows the average played bitrate across all plays on the platform. We expect to see this one is reduced by the use of Per-Title</span></li>
</ul>
<p><span style="font-weight: 400;">Whilst we are at it, there are probably a few other metrics that we may want to consider keeping an eye on when evaluating how Per-Title ladders behave:</span></p>
<ul>
<li aria-level="1"><b>Video Startup Time</b><span style="font-weight: 400;">: a Per-Title ladder should not cause the startup time to increase</span></li>
</ul>
<ul>
<li aria-level="1"><b>Rebuffering</b><span style="font-weight: 400;">: A Per-Title ladder will usually contain fewer renditions than a static one. This should not be to the detriment of the playback session</span></li>
</ul>
<ul>
<li aria-level="1"><b>Scale Factor, </b><span style="font-weight: 400;">which is a numeric indicator of the relationship between the playback window size and the resolution your stream was delivered at. Most of the time Per-Title will allow users to stream higher resolutions at similar or lower bitrates compared to a fixed ladder, and therefore users will more often and more quickly get to watch the video that matches their player’s native resolution and stay at that level throughout the streaming session. We should therefore see this number get closer to 1 for the content encoded with Per-Title.</span></li>
</ul>
<p><span style="font-weight: 400;">The best way to perform this comparison is to use an A/B test scenario. A/B tests are usually used to test the performance of different CDNs, or test the stickiness of different marketing videos. Here we will pitch static ladders against Per-Title ladders. </span><br />
<span style="font-weight: 400;">Luckily, Bitmovin Analytics is perfectly suited to do <a href="https://bitmovin.com/docs/analytics/tutorials/how-to-do-a-b-testing-with-bitmovin-analytics">A/B testing through experiments</a></span></p>
<h2><span style="font-weight: 400;">Implementation</span></h2>
<p><span style="font-weight: 400;">But before we get there, let’s complete our discussion of the implementation that will give us that information. In the previous two parts of this series, you saw how to use AWS Lambda to save video metadata and playback URLs to DynamoDB. In this section, I’ll walk you through the steps you need to add the Bitmovin Video Player and Video Analytics solutions to your application.</span></p>
<figure id="attachment_162070" aria-describedby="caption-attachment-162070" style="width: 512px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-162070 size-full" src="https://bitmovin.com/wp-content/uploads/2021/03/Adding-Bitmovin-Video-Player-and-Analytics-to-Cloud-Based-Encoding-Workflows-1.png" alt="Video Player and Video Analytics_Encoding Workflow" width="512" height="241" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Adding-Bitmovin-Video-Player-and-Analytics-to-Cloud-Based-Encoding-Workflows-1-300x141.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Adding-Bitmovin-Video-Player-and-Analytics-to-Cloud-Based-Encoding-Workflows-1.png?size=384x181&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Adding-Bitmovin-Video-Player-and-Analytics-to-Cloud-Based-Encoding-Workflows-1.png?lossy=2&amp;strip=1&amp;webp=1 512w" sizes="(max-width: 512px) 100vw, 512px" /><figcaption id="caption-attachment-162070" class="wp-caption-text">Adding Video Player and Video Analytics into an Encoding Workflow with AWS</figcaption></figure>
<h3><span style="font-weight: 400;">Embedding and Configuring the Bitmovin Web Player</span></h3>
<p><span style="font-weight: 400;">We’ll create a very simple HTML page and embed the Bitmovin Web player into it.</span><br />
<span style="font-weight: 400;">First you will need to retrieve your Bitmovin Video Player license <a href="https://bitmovin.com/dashboard/player/licenses">via the dashboard</a>, and configure it to be allowed on your domain. </span><br />
<span style="font-weight: 400;">To embed the video player, simply add the Bitmovin Player JavaScript library to the `&lt;head&gt;` section of your HTML file:</span></p>
<figure id="attachment_162076" aria-describedby="caption-attachment-162076" style="width: 1010px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-162076 size-full" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-5-2.png" alt="Embedding the Video Player JS Library_Code Snippet" width="1010" height="258" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-2-300x77.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-2.png?size=384x98&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-2-768x196.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-2.png?lossy=2&amp;strip=1&amp;webp=1 1010w" sizes="(max-width: 1010px) 100vw, 1010px" /><figcaption id="caption-attachment-162076" class="wp-caption-text">Embedding the Bitmovin Video Player</figcaption></figure>
<p><span style="font-weight: 400;">Next, add a `&lt;div&gt;` that will contain the instance of your player, and use the following JavaScript snippet to instantiate the player with your license key:</span></p>
<figure id="attachment_162075" aria-describedby="caption-attachment-162075" style="width: 732px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-162075 size-full" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-4-1-1.png" alt="Adding the Video Player Instance into a cloud-based workflow_code snippet" width="732" height="366" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1-1-300x150.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1-1.png?size=384x192&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1-1.png?lossy=2&amp;strip=1&amp;webp=1 732w" sizes="(max-width: 732px) 100vw, 732px" /><figcaption id="caption-attachment-162075" class="wp-caption-text">Adding the Bitmovin Player instance to your page</figcaption></figure>
<p><span style="font-weight: 400;">This adds an instance of the Bitmovin Player to your page. Now you need to populate it with some video data.</span></p>
<h3><span style="font-weight: 400;">Passing Video Data Into the Video Player</span></h3>
<p><span style="font-weight: 400;">If you’re emulating the AWS-based architecture in the previous section, you need to retrieve the video metadata saved to DynamoDB first. DynamoDB <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.JavaScript.html" rel="nofollow noopener" target="_blank">has a JavaScript API</a>, so depending on how you want to query it, your code for retrieving records could look something like this:</span></p>
<figure id="attachment_162074" aria-describedby="caption-attachment-162074" style="width: 673px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-162074 size-full" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-3-1-1.png" alt="Retrieving Video Metadata Records_Code Snippet" width="673" height="528" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-3-1-1-300x235.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-3-1-1.png?size=384x301&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-3-1-1.png?lossy=2&amp;strip=1&amp;webp=1 673w" sizes="(max-width: 673px) 100vw, 673px" /><figcaption id="caption-attachment-162074" class="wp-caption-text">Retrieving Video Metadata Records</figcaption></figure>
<p><span style="font-weight: 400;">In our Demo application we were loading 2 players side by side, allowing the user to select an asset from a dropdown. We were retrieving all data for our small list of assets through a `dynamodb.scan()` operation. For a more realistic application, you will probably want to query data for a single asset instead through a `dynamodb.query()` call, and then use a random (or controlled) way of selecting playback information for the Per-Title or static ladder.</span><br />
<span style="font-weight: 400;">Note also that you’ll probably want to find a less insecure way of enabling access to your DynamoDB. The AWS documentation has <a href="https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-browser.html" rel="nofollow noopener" target="_blank">good recommendations on this subject</a></span><br />
<span style="font-weight: 400;">Once the relevant video data has been extracted, the `configure_player_with_data` function creates a <a href="https://bitmovin.com/docs/player/api-reference/web/web-sdk-api-reference-v8#/player/web/8/docs/interfaces/core_config.sourceconfig.html">properly formatted `source` payload</a> with the URLs to the DASH and HLS manifests, and passes it to the `player.load()` method:</span></p>
<figure id="attachment_162077" aria-describedby="caption-attachment-162077" style="width: 530px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-162077" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-6-1-1.png" alt="Passing Video Player Configs to the Player Load Method_Code Snippet" width="530" height="384" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-6-1-1-300x217.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-6-1-1.png?size=384x278&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-6-1-1.png?lossy=2&amp;strip=1&amp;webp=1 530w" sizes="(max-width: 530px) 100vw, 530px" /><figcaption id="caption-attachment-162077" class="wp-caption-text">Passing Video Player Configs to the `player.load()` Method</figcaption></figure>
<h3><span style="font-weight: 400;">Integrating Analytics and Tagging Your Experiment</span></h3>
<p><span style="font-weight: 400;">While the video player above works fine, we still need to <a href="https://bitmovin.com/docs/analytics/tutorials/integrating-bitmovin-analytics-with-bitmovin-player">connect it to our Bitmovin Analytics account</a> to get the data flowing. This can all simply be done by modifying the `playerConfig` variable from earlier.</span></p>
<figure id="attachment_162176" aria-describedby="caption-attachment-162176" style="width: 715px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-162176" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-7.png" alt="Video Player Configuration with Video Analytics Key_Code Snippet" width="715" height="366" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-7-300x154.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-7.png?size=384x197&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-7.png?lossy=2&amp;strip=1&amp;webp=1 715w" sizes="(max-width: 715px) 100vw, 715px" /><figcaption id="caption-attachment-162176" class="wp-caption-text">Connecting Bitmovin&#8217;s Video Player and Video Analytics</figcaption></figure>
<p><span style="font-weight: 400;">We then set some of the asset metadata in the `source`, allowing us to later easily identify videos in the Dashboard or analytics data. This is also where we configure our A/B experiment by simply defining an `experimentName`, and setting its value to “static” or “per-title” based on the type of ladder selected.</span></p>
<figure id="attachment_162177" aria-describedby="caption-attachment-162177" style="width: 470px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-162177" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-8.png" alt="Asset Metadata for Encoding Types_Code Snippet" width="470" height="420" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-8-300x268.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-8.png?size=384x343&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-8.png?lossy=2&amp;strip=1&amp;webp=1 470w" sizes="(max-width: 470px) 100vw, 470px" /><figcaption id="caption-attachment-162177" class="wp-caption-text">Asset Metadata for Encoding Types</figcaption></figure>
<p><span style="font-weight: 400;">We can now let our users lose on our video player page and collect some data. Some will get a per-title ladder, others a static ladder. Let the data flow!</span></p>
<h2><span style="font-weight: 400;">Looking at the data</span></h2>
<p><span style="font-weight: 400;">After running a few experiments, we can look at the results in the Bitmovin dashboard, by going to <em>Analytics &gt; Quality of Service &gt; Comparison &gt; Experiments</em>.</span><br />
<span style="font-weight: 400;">This multi-column view allows you to compare key metrics side by side for your named experiments. In our simple scenario, we only have 2 columns. Other metrics that are not displayed in this view can still be accessed in their respective dashboard view and can be broken down by experiment. </span></p>
<figure id="attachment_162175" aria-describedby="caption-attachment-162175" style="width: 512px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-162175" src="https://bitmovin.com/wp-content/uploads/2021/03/Video-Bitrate-Ladder_Graph.jpg" alt="Video Bitrate Ladder_Graph" width="512" height="192" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Video-Bitrate-Ladder_Graph-300x113.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Video-Bitrate-Ladder_Graph.jpg?size=384x144&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Video-Bitrate-Ladder_Graph.jpg?lossy=2&amp;strip=1&amp;webp=1 512w" sizes="(max-width: 512px) 100vw, 512px" /><figcaption id="caption-attachment-162175" class="wp-caption-text">Bitmovin&#8217;s Bitrate Ladder</figcaption></figure>
<p><span style="font-weight: 400;">Although we only got a very limited sample of data from this hackathon, we could already see some important trends:</span></p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Video startup time seems actually lower with the per-title ladder. This may not be significant but is certainly good news.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Buffering is also slightly reduced with our per-title ladder.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">The average bitrate across playback sessions is very significantly lower with per-title, with a reduction of 65% in bandwidth. _Note that the colors for that metric are incorrectly set at the time of writing. A lower value is evidently better, assuming that the level of visual quality delivered is at least similar_ </span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Data downloaded is naturally significantly lower too.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Scale factor was not significantly different, however, but that can be attributed to the fact that our playback sessions were probably all in favorable conditions that saw all players able to quickly jump to the top rendition, which has the same resolution in both ladders. </span></li>
</ul>
<p><span style="font-weight: 400;">Another interesting comparison between the two ladders, assuming both ladders had had a good number of views, would have been to use the video bitrate heatmap to compare how the two ladders performed in terms of bitrate usage over the duration of the videos and showed much more efficient use of the reduced number of renditions.</span><br />
<span style="font-weight: 400;">There was unfortunately not enough time during our 2020 hackathon to conduct a more realistic experiment. If we had, the data would have been more accurate, and likely would have shown a slightly reduced bitrate saving, but without putting into question the clear advantages of using Per-Title. </span></p>
<h2><span style="font-weight: 400;">Conclusion</span></h2>
<p><span style="font-weight: 400;">In <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1/">part one</a>, you saw an example of a high-level AWS architecture you can use to perform Bitmovin’s Per-Title Encodings in your own AWS infrastructure. In <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p2/">part two</a>, you learned how to implement and deploy the main parts of the workflow with AWS Lambda code and DynamoDB. Finally, in this part, you saw how to add the Bitmovin Player and Analytics to run experiments comparing Per-Title and Standard encoding ladders.</span><br />
<span style="font-weight: 400;">Analytics are an important part of the video streaming pipeline. Whether you use Cloud Connect or Bitmovin’s managed API, you’ve seen in this post how all three of Bitmovin’s products work together to improve the video delivery and streaming experience.</span><br />
<span style="font-weight: 400;">Now that you have a complete picture of what’s possible using Bitmovin, let us know how we can help. Reach out to <a href="https://go.bitmovin.com/expert-consultation">Bitmovin’s team</a> so we can help you get started with an efficient, scalable video streaming pipeline today.</span></p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3">Cloud-based Per-Title Encoding Workflows (with AWS) – Part 3: Adding the Player and Video Analytics</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Cloud-based Per-Title Encoding Workflows (with AWS) &#8211; Part 2: Implementing the Encoding Workflow</title>
		<link>https://bitmovin.com/cloud-based-per-title-encoding-aws-p2</link>
		
		<dc:creator><![CDATA[Fabre Lambeau]]></dc:creator>
		<pubDate>Tue, 02 Mar 2021 14:30:27 +0000</pubDate>
				<category><![CDATA[Developers]]></category>
		<category><![CDATA[per-title encoding]]></category>
		<category><![CDATA[video encoding]]></category>
		<category><![CDATA[video workflow]]></category>
		<guid isPermaLink="false">https://bitmovin.com/?p=159075</guid>

					<description><![CDATA[<p>Implementing Cloud-Based Per-Title Encoding in the Real World Bitmovin’s gives developers access to industry-leading codecs and advanced encoding algorithms such as Per-Title. As you saw in the first part of this series, Per-Title Encoding allows you to save money on storage and streaming costs while giving viewers the best perceivable quality for their streaming session. In...</p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p2">Cloud-based Per-Title Encoding Workflows (with AWS) &#8211; Part 2: Implementing the Encoding Workflow</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-159267" src="https://bitmovin.com/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding-P2-1024x537.png" alt="- Bitmovin" width="1024" height="537" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding-P2-300x157.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding-P2.png?size=384x201&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding-P2-768x402.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding-P2-1024x537.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/BLOG-POST_Cloud-Based-PT-Encoding-P2.png?lossy=2&amp;strip=1&amp;webp=1 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></h2>
<h2>Implementing Cloud-Based Per-Title Encoding in the Real World</h2>
<p><a href="https://bitmovin.com/encoding-service/"><span style="font-weight: 400;">Bitmovin’s</span></a><span style="font-weight: 400;"> gives developers access to industry-leading codecs and advanced encoding algorithms such as Per-Title. As you saw in the first part of this series,<a href="https://bitmovin.com/encoding-service/per-title-encoding/"> Per-Title Encoding</a> allows you to save money on storage and streaming costs while giving viewers the best perceivable quality for their streaming session.</span><br />
<span style="font-weight: 400;">In <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1/">part one</a></span><span style="font-weight: 400;"> of this three-part series, I outlined a demo application and discussed a practical high-level architecture to deploy Bitmovin’s encoding service into your own AWS account’s infrastructure using <a href="https://bitmovin.com/introducing-cloud-connect-encoding-aws-gcp-azure/">Cloud Connect</a></span><span style="font-weight: 400;">. </span><br />
<span style="font-weight: 400;">In the application we’re discussing in this blog, users are able to upload videos to an S3 bucket which triggers a Lambda function. The Lambda, in turn, calls the Bitmovin Encoding API to configure and start encoding. The Bitmovin platform then spins up instances in your AWS account to perform the encoding. On completion, playback information and metadata about the encoding is retrieved, stored, ready to be passed through to a front-end application that will let you watch the encoded asset.</span><br />
<span style="font-weight: 400;">In this second part, I&#8217;ll talk more about the implementation details for the encoding workflow. I’ll show you first how to enable and configure Cloud Connect, and then how to set up this AWS-based workflow to trigger Bitmovin encodings. If you want to skip ahead, check out part three of this series: <a href="https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3/">Cloud-Based Workflows with AWS: Plugging in the Video Player and Video Analytics</a></span></p>
<h2><span style="font-weight: 400;">Enabling Cloud Connect for AWS<img loading="lazy" decoding="async" class="aligncenter wp-image-159093 size-full" src="https://bitmovin.com/wp-content/uploads/2021/03/Encoding-Workflow-on-AWS_Visualized.jpg" alt="Per-Title Encoding Workflow on AWS_Flow chart" width="960" height="540" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Encoding-Workflow-on-AWS_Visualized-300x169.jpg?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Encoding-Workflow-on-AWS_Visualized.jpg?size=384x216&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Encoding-Workflow-on-AWS_Visualized-768x432.jpg?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Encoding-Workflow-on-AWS_Visualized.jpg?lossy=2&amp;strip=1&amp;webp=1 960w" sizes="(max-width: 960px) 100vw, 960px" /></span></h2>
<p><span style="font-weight: 400;">The Bitmovin Cloud Connect feature essentially allows you to perform encodings on virtual infrastructure inside your own AWS account, without any restrictions on the encoding features, codecs, and algorithms that Bitmovin offers.  </span><br />
<span style="font-weight: 400;">Let’s first look at how you need to configure things to use Cloud Connect. You will need an AWS account, and a Bitmovin account with Cloud Connect enabled (<a href="https://bitmovin.com/contact-bitmovin">contact us if you don’t</a></span><span style="font-weight: 400;">). The configuration process is documented <a href="https://bitmovin.com/docs/encoding/tutorials/using-bitmovin-cloud-connect-with-aws#aws-configuration">in detail here</a></span><span style="font-weight: 400;">, but I’ll walk you through the major steps below.</span></p>
<h3><span style="font-weight: 400;">Configuring AWS</span></h3>
<p><span style="font-weight: 400;">Bitmovin will be creating resources within your AWS account, so you’ll need to create <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html" rel="nofollow noopener" target="_blank">an IAM user for it</a></span><span style="font-weight: 400;">. This user needs to have access to EC2 with applicable permissions. For a prototype, using the `AmazonEC2FullAccess` is sufficient.</span><br />
<span style="font-weight: 400;">Next, you’ll need a Virtual Private Cloud (VPC) and Security Group in your AWS account. You likely already have a default VPC, but if you deleted it, <a href="https://aws.amazon.com/about-aws/whats-new/2017/07/create-a-new-default-vpc-using-aws-console-or-cli/" rel="nofollow noopener" target="_blank">recreate it</a></span><span style="font-weight: 400;"> before proceeding. The security group will make sure that the EC2 instances can communicate with the Bitmovin API and with each other. </span><br />
<span style="font-weight: 400;">Finally, you will likely need to request quota increases from AWS, depending on your expected workloads and concurrency requirements. That’s due to the nature of the Bitmovin encoding process, which splits the video asset into chunks and encodes them in parallel on multiple worker instances.</span></p>
<h3><span style="font-weight: 400;">Configuring Bitmovin</span></h3>
<p><span style="font-weight: 400;">Now that you have a new IAM user and your AWS account configured, you need to create an infrastructure resource on the Bitmovin platform. From the Bitmovin dashboard, go to <em>Encoding &gt; Infrastructure &gt; Add new Infrastructure</em>.</span></p>
<figure id="attachment_159094" aria-describedby="caption-attachment-159094" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-159094 size-large" src="https://bitmovin.com/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1-1024x555.png" alt="Creating a new AWS Per-Title Encoding Infrastructure_Bitmovin Dashboard_Screenshot" width="1024" height="555" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1-300x163.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1.png?size=384x208&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1-768x417.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1-1024x555.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1-1536x833.png?lossy=2&amp;strip=1&amp;webp=1 1536w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-a-new-AWS-Encoding-Infrastructure_Bitmovin-Dashboard_Screenshot-1-2048x1111.png?lossy=2&amp;strip=1&amp;webp=1 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-159094" class="wp-caption-text">Creating a new AWS Encoding Infrastructure in the Bitmovin Dashboard</figcaption></figure>
<p><span style="font-weight: 400;">Select <em>AWS</em> at the top and enter your credentials and a name for this infrastructure. Click <em>Create</em>. You now need to specify and configure what AWS region you want to work in. Click <em>Add new Region Settings</em>.</span></p>
<figure id="attachment_159095" aria-describedby="caption-attachment-159095" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159095" src="https://bitmovin.com/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot-1024x664.png" alt="Adding new AWS Region_Bitmovin Dashboard_Screenshot" width="1024" height="664" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot-300x194.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot.png?size=384x249&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot-768x498.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot-1024x664.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot-1536x995.png?lossy=2&amp;strip=1&amp;webp=1 1536w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Creating-new-AWS-Region_Bitmovin-Dashboard_Screenshot.png?lossy=2&amp;strip=1&amp;webp=1 2006w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-159095" class="wp-caption-text">Adding new AWS Region in the Bitmovin Dashboard</figcaption></figure>
<p><span style="font-weight: 400;">Enter your `security_group_id` and a low number of <em>Max parallel Encodings</em> to start with. You won’t need to set the other settings for simple use cases.</span><br />
<span style="font-weight: 400;">Finally, you need to request access to Bitmovin’s Amazon Machine Images (AMIs). These will be used to create EC2 instances on your AWS account, so let your Bitmovin technical contact know your AWS account number to get access to the AMIs.</span><br />
<span style="font-weight: 400;">This is all you need to do to enable Bitmovin Cloud Connect on your AWS account. Once you start using Cloud Connect, you’ll be able to take advantage of volume pricing discounts, security rules, and configuration options that aren’t available to customers using Bitmovin’s managed encoding service. </span><br />
<span style="font-weight: 400;">Make a note of the ID of the infrastructure. You will need to use it in your encoding configuration later on to instruct Bitmovin to route encodings to your AWS account.</span></p>
<h2><span style="font-weight: 400;">Bitmovin Encoding workflow on AWS</span></h2>
<p><span style="font-weight: 400;">We are now ready to look at the details of the implementation of the workflow. In <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1/">the first part of this series</a></span><span style="font-weight: 400;">, I discussed in some detail the architectural choices we made for this demo application. In the remainder of this post, we will focus on the components that interact directly with the Bitmovin encoding platform.</span><br />
<span style="font-weight: 400;">You can also find more details on using the Bitmovin Encoding API <a href="https://bitmovin.com/docs/encoding">in the documentation</a>. Otherwise, read on to see some code samples and more details for setting this up yourself.</span></p>
<h3><span style="font-weight: 400;">Encoding with the Bitmovin API and SDK</span></h3>
<p><span style="font-weight: 400;">I’ll focus first on the AWS Lambda code that calls the Bitmovin API when a new file arrives on S3.</span></p>
<figure id="attachment_159096" aria-describedby="caption-attachment-159096" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-159096 size-large" src="https://bitmovin.com/wp-content/uploads/2021/03/Bitmovin-Encoding-API-and-SDK_AWS-Lambda-Code_Flow-chart-1024x457.png" alt="Bitmovin Per-Title Encoding API and SDK_AWS Lambda Code_Flow chart" width="1024" height="457" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Encoding-API-and-SDK_AWS-Lambda-Code_Flow-chart-300x134.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Encoding-API-and-SDK_AWS-Lambda-Code_Flow-chart.png?size=384x171&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Encoding-API-and-SDK_AWS-Lambda-Code_Flow-chart-768x343.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Encoding-API-and-SDK_AWS-Lambda-Code_Flow-chart-1024x457.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Bitmovin-Encoding-API-and-SDK_AWS-Lambda-Code_Flow-chart.jpg?lossy=2&amp;strip=1&amp;webp=1 1316w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-159096" class="wp-caption-text">Lambda workflow for triggering an encoding</figcaption></figure>
<p><span style="font-weight: 400;">After you’ve set up <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html" rel="nofollow noopener" target="_blank">S3 event notifications</a></span><span style="font-weight: 400;"> to call a Lambda function, you need to write some code that will handle the notification. Lambda supports <a href="https://aws.amazon.com/lambda/faqs/https://aws.amazon.com/lambda/faqs/" rel="nofollow noopener" target="_blank">several common web programming languages</a></span><span style="font-weight: 400;"> and Bitmovin provides SDKs for <a href="https://bitmovin.com/docs/encoding/sdks">most of the same ones</a></span><span style="font-weight: 400;">, but I’ll use <a href="https://github.com/bitmovin/bitmovin-api-sdk-python" rel="nofollow noopener" target="_blank">the Python SDK</a></span><span style="font-weight: 400;"> for this example. You should be able to adapt these samples to your language of choice.</span><br />
<span style="font-weight: 400;">A Lambda function is configured to invoke a single method in the code. That method is passed an event that contains contextual information and in this case essential information about the S3 bucket and file that triggered the function. We need both to pass into the encoding configuration.</span></p>
<pre></pre>
<figure id="attachment_159097" aria-describedby="caption-attachment-159097" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-159097 size-large" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-3-1-1024x381.png" alt="Per Title Encoding Configuration_Lambda_Python Code Snippet" width="1024" height="381" /><figcaption id="caption-attachment-159097" class="wp-caption-text">Lambda handler function</figcaption></figure>
<p><span style="font-weight: 400;">You will previously have <a href="https://bitmovin.com/docs/encoding/tutorials/how-to-create-an-s3-encoding-input-or-output#create-an-s3-input-output">configured an S3 Input object</a> on the Bitmovin platform that allows the encoder to grab files from that bucket. For simple workflows with a single watch folder, you would not even need to retrieve the bucket name from the event data, but here we do it to keep the code generic and allow multiple watch folders in different buckets.</span><br />
<span style="font-weight: 400;">The `encode` function will initialise the Bitmovin API with your credentials, which are passed to the Lambda function via environment variables, then retrieves the S3 Input resource that corresponds to the one that triggered the event. It then creates our encoding object.</span></p>
<figure id="attachment_159098" aria-describedby="caption-attachment-159098" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159098" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-4-1-1024x724.png" alt="Triggering Encoding Object in AWS Lambda_Python Code Snippet" width="1024" height="724" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1-300x212.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1.png?size=384x272&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1-768x543.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1-1024x724.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-4-1.png?lossy=2&amp;strip=1&amp;webp=1 1408w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-159098" class="wp-caption-text">Creating an Encoding Object in Python</figcaption></figure>
<p><span style="font-weight: 400;">Compared to a “standard” encoding, there is really only one difference when using Cloud Connect: note how we pass the infrastructure ID and AWS region when creating the encoding object. That’s all! From here on, it is a standard Per-Title configuration, which will generate an ABR ladder optimised for that video asset.</span></p>
<figure id="attachment_159099" aria-describedby="caption-attachment-159099" style="width: 1090px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-159099" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-5.png" alt="Encoding Configuration for Per-Title on AWS_Python Code Snippet" width="1090" height="1032" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-300x284.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5.png?size=384x364&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-768x727.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5-1024x970.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/carbon-5.png?lossy=2&amp;strip=1&amp;webp=1 1090w" sizes="(max-width: 1090px) 100vw, 1090px" /><figcaption id="caption-attachment-159099" class="wp-caption-text">Encoding configuration for video</figcaption></figure>
<p><span style="font-weight: 400;">In my code I make use of helper functions that wrap the Bitmovin SDK, to improve the readability of the high-level functions and reusability. I’ve left a lot of detail out because the Bitmovin Python SDK is <a href="https://bitmovin.com/docs/encoding/getting-started/python">already well documented</a></span><span style="font-weight: 400;">. In particular, you can get full details on how to configure Per-Title from <a href="https://bitmovin.com/docs/encoding/tutorials/how-to-create-a-per-title-encoding">our tutorial</a></span><span style="font-weight: 400;">. </span><br />
<span style="font-weight: 400;">When it comes to audio, I want to make sure that the encoding only attempts to create an audio stream if it’s present in the source. This is easily accomplished with <a href="https://bitmovin.com/docs/encoding/tutorials/how-to-adapt-automatically-to-varying-source-files-with-stream-conditions">stream conditions</a>:</span></p>
<figure id="attachment_159103" aria-describedby="caption-attachment-159103" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159103" src="https://bitmovin.com/wp-content/uploads/2021/03/carbon-6-1-1024x723.png" alt="Encoding Configuration_Custom Audio_Stream Condition Input_Python Code Snippet" width="1024" height="723" /><figcaption id="caption-attachment-159103" class="wp-caption-text">Encoding configuration for audio</figcaption></figure>
<p><span style="font-weight: 400;">We want to be able to play our video through standard web players, and we therefore also need to create HLS and DASH manifests for them. Since our use case is quite simple, I will make use of Bitmovin’s Default Manifest functionality that will create a standard manifest with very little configuration needed. So the `encode` function continues&#8230;</span></p>
<figure id="attachment_159104" aria-describedby="caption-attachment-159104" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159104" src="https://bitmovin.com/wp-content/uploads/2021/03/Adding-Manifests-to-the-Encoding_Python-Code-Snippet-2-1024x848.png" alt="Adding Manifests to the Encoding_Python Code Snippet" width="1024" height="848" /><figcaption id="caption-attachment-159104" class="wp-caption-text">Encoding configuration for default manifests</figcaption></figure>
<p><span style="font-weight: 400;">With this done, we are now ready to start the encoding. The start call needs a request payload that instructs the encoder to use the Per-Title algorithm and gives it complete freedom to choose the number, bitrate, and resolution of the renditions to generate for that input asset. </span><br />
<span style="font-weight: 400;">We also let the encoder generate the manifests automatically when the encoding process has completed.</span></p>
<figure id="attachment_159105" aria-describedby="caption-attachment-159105" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159105" src="https://bitmovin.com/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet-1024x455.png" alt="Start Encoding Request_AWS Lambda_Python Code Snippet" width="1024" height="455" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet-300x133.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet.png?size=384x171&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet-768x341.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet-1024x455.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet-1536x682.png?lossy=2&amp;strip=1&amp;webp=1 1536w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/Start-Encoding-Request_AWS-Lambda_Python-Code-Snippet.png?lossy=2&amp;strip=1&amp;webp=1 1594w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-159105" class="wp-caption-text">Encoding configuration &#8211; start request</figcaption></figure>
<p><span style="font-weight: 400;">The code is complete, we are now ready to deploy it to our Lambda function. You will need to package it with the Bitmovin Python SDK as dependency. Check the <a href="https://docs.aws.amazon.com/lambda/latest/dg/python-package.html" rel="nofollow noopener" target="_blank">AWS documentation</a> on the various methods that you can use for this deployment. We also need to set the environment variables as appropriate.</span></p>
<figure id="attachment_159106" aria-describedby="caption-attachment-159106" style="width: 480px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-159106" src="https://bitmovin.com/wp-content/uploads/2021/03/Deploying-Encode-on-AWS-Lambda-Function_AWS-Dashboard_Screenshot-2.jpg" alt="Deploying Encode on AWS Lambda Function_AWS Dashboard_Screenshot" width="480" height="512" /><figcaption id="caption-attachment-159106" class="wp-caption-text">Lambda function deployed</figcaption></figure>
<p><span style="font-weight: 400;">At this point, your Lambda will be triggered every time a new video file is added to your S3 bucket. When encoding starts, Bitmovin will split the file, spin up <a href="https://aws.amazon.com/ec2/spot/" rel="nofollow noopener" target="_blank">Spot Instances</a> in your AWS account, and begin the encoding process. When the video is finished, it will be saved in the Output S3 bucket you configured. You’ll be able to monitor the encoding process in the Bitmovin dashboard.</span></p>
<figure id="attachment_159107" aria-describedby="caption-attachment-159107" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159107" src="https://bitmovin.com/wp-content/uploads/2021/03/Bitmovin-Encoding-Dashboard-2-1024x282.png" alt="Completed encode_Bitmovin Encoding Dashboard_screenshot" width="1024" height="282" /><figcaption id="caption-attachment-159107" class="wp-caption-text">Completed encoding in the Bitmovin Dashboard</figcaption></figure>
<h3><span style="font-weight: 400;">Reacting on Completion of the Encoding</span></h3>
<p><span style="font-weight: 400;">In our workflow, we want to gather some information when the encoding is complete to feed to the front-end application. At a minimum, we want to know whether the encoding succeeded, the name of the asset, and the URLs of the manifests. In essence, this performs the same function as an online video platform or content management system would in a more traditional setup.</span><br />
<span style="font-weight: 400;">All of this should be automatic, so we will use Lambda again to retrieve that information. To trigger it, the Bitmovin platform will notify a webhook endpoint when the encoding is finished. The Lambda function will retrieve that information and then store it to <a href="https://aws.amazon.com/dynamodb/" rel="nofollow noopener" target="_blank">DynamoDB</a></span><span style="font-weight: 400;">. </span></p>
<figure id="attachment_159108" aria-describedby="caption-attachment-159108" style="width: 600px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-159108" src="https://bitmovin.com/wp-content/uploads/2021/03/Retrieving-content-info-in-DynamoDB_Flow-Chart-2.png" alt="Retrieving content info in DynamoDB_Flow Chart" width="600" height="151" /><figcaption id="caption-attachment-159108" class="wp-caption-text">Lambda workflow for retrieving encoding information</figcaption></figure>
<p><span style="font-weight: 400;">The AWS console makes it easy to create an AWS Lambda function triggered with an HTTP call, through an <a href="https://aws.amazon.com/api-gateway/" rel="nofollow noopener" target="_blank">API Gateway</a></span><span style="font-weight: 400;"> endpoint. </span></p>
<figure id="attachment_159109" aria-describedby="caption-attachment-159109" style="width: 512px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-159109" src="https://bitmovin.com/wp-content/uploads/2021/03/Triggering-AWS-Lambda-Function_HTTP-Call_AWS-Dashboard-2.jpg" alt="Triggering AWS Lambda Function_HTTP Call_AWS Dashboard_Screenshot" width="512" height="508" /><figcaption id="caption-attachment-159109" class="wp-caption-text">Triggering AWS Lambda Function with an HTTP Call</figcaption></figure>
<p><span style="font-weight: 400;">On the Bitmovin side of things, the simpler way to configure a webhook is through the Dashboard. I will create a single “catch-all” webhook that gets triggered for all finished encodings in my Bitmovin account. If I wanted to do it on a per-encoding basis, I could just add a webhook in the encoding configuration instead, in my `encode` function.</span></p>
<figure id="attachment_159110" aria-describedby="caption-attachment-159110" style="width: 512px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-159110" src="https://bitmovin.com/wp-content/uploads/2021/03/Webhook-Configuration_Bitmovin-Dashboard_Screenshot-2.jpg" alt="Webhook Configuration_Bitmovin Dashboard_Screenshot" width="512" height="353" /><figcaption id="caption-attachment-159110" class="wp-caption-text">Configuring Webhooks in Bitmovin&#8217;s Dashboard</figcaption></figure>
<p><span style="font-weight: 400;">Amazon has documentation for <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SettingUp.DynamoWebService.html" rel="nofollow noopener" target="_blank">setting up DynamoDB</a></span><span style="font-weight: 400;">, so I won’t cover that here. Instead, I’ll show you how to save data coming in from the completed encoding job. I chose DynamoDB to store the data because it allows you to quickly store unstructured data like this. Great for prototyping during a hackathon!</span><br />
<span style="font-weight: 400;">This second Lambda function has its own code, with its own handler. This time the event data contains the payload from the Bitmovin notification, which contains the encoding ID.</span></p>
<figure id="attachment_159111" aria-describedby="caption-attachment-159111" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159111" src="https://bitmovin.com/wp-content/uploads/2021/03/Importing-Encoding-Data_Lambda-Function-2_Python-Code-Snippet-1-1024x588.png" alt="Importing Encoding Data_Lambda Function 2_Python Code Snippet" width="1024" height="588" /><figcaption id="caption-attachment-159111" class="wp-caption-text">Lambda handler function</figcaption></figure>
<p><span style="font-weight: 400;">The `summarize_encoding_info` uses the Bitmovin SDK to retrieve the asset name, path, manifest URLs, status, and other useful metadata into a JSON object. I won’t go through the details here, but you will find tips on how to do this in my <a href="https://bitmovin.com/docs/encoding/tutorials/retrieving-vod-encoding-information-with-the-bitmovin-api">tutorial on retrieving encoding information</a></span><span style="font-weight: 400;">.</span><br />
<span style="font-weight: 400;">This function also translates S3 URLs into CloudFront CDN URLs, which the player will use for streaming.</span><br />
<span style="font-weight: 400;">Having extracted that metadata, we save the `info` object to our DynamoDB table (using AWS’ excellent <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html" rel="nofollow noopener" target="_blank">boto3 Python library</a>):</span></p>
<figure id="attachment_159112" aria-describedby="caption-attachment-159112" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-159112" src="https://bitmovin.com/wp-content/uploads/2021/03/Saving-Meta-to-DynamoDB_Python-Code-Snippet-1-1024x706.png" alt="Saving Metadata to DynamoDB_Python Code Snippet" width="1024" height="706" /><figcaption id="caption-attachment-159112" class="wp-caption-text">Saving the Metadata to DynamoDB</figcaption></figure>
<p><span style="font-weight: 400;">From now on, the data will flow in automatically, and you can use the AWS DynamoDB interface to look up metadata about your encodings.</span></p>
<figure id="attachment_159113" aria-describedby="caption-attachment-159113" style="width: 512px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-159113" src="https://bitmovin.com/wp-content/uploads/2021/03/AWS-DynamoDB-Interface_AWS-Dashboard-Screenshot.jpg" alt="AWS DynamoDB Interface_AWS Dashboard Screenshot" width="512" height="388" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/AWS-DynamoDB-Interface_AWS-Dashboard-Screenshot-300x227.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/AWS-DynamoDB-Interface_AWS-Dashboard-Screenshot.jpg?size=384x291&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/03/AWS-DynamoDB-Interface_AWS-Dashboard-Screenshot.jpg?lossy=2&amp;strip=1&amp;webp=1 512w" sizes="(max-width: 512px) 100vw, 512px" /><figcaption id="caption-attachment-159113" class="wp-caption-text">Encoding metadata in the AWS DynamoDB</figcaption></figure>
<h3><span style="font-weight: 400;">Multiple encodings</span></h3>
<p><span style="font-weight: 400;">You may remember from <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1/">part one of our blog series</a></span><span style="font-weight: 400;"> that for the 2020 AWS + Bitmovin hackathon project, we wanted to compare Per-Title and static ladders for our content. The eagle-eyed among you will also have noticed from the previous screenshot that my DynamoDB table does indeed contain 2 sets of info data for the asset.</span><br />
<span style="font-weight: 400;">The code I presented in this post is indeed a simplification, which only creates a single Per-Title ladder, to make it more of a real-life use case. If you wanted to match what we did, the differences are actually quite small:</span></p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">The handler for the first Lambda function triggers 2 encodings in parallel. </span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">A single parameter on the &#8220;encode&#8221; function offers a switch to allow it to handle the small differences between a static and a Per-Title configuration</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Each encoding is independent and triggers a completion notification individually. The <em>summarize_encoding_info</em> function in the second Lambda determines whether Per-Title was used (which I do through the use of `labels` on the encoding) and updates the corresponding fields in the DynamoDB table </span></li>
</ul>
<h2><span style="font-weight: 400;">What’s Next?</span></h2>
<p><span style="font-weight: 400;">In this post, you saw how to configure Bitmovin’s Cloud Connect for Amazon Web Services and call Lambda functions each time a video is uploaded and encoded. Using the encoding complete webhook, you can save metadata about each video into DynamoDB.</span><br />
<span style="font-weight: 400;">Going back to the high-level architecture from <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1/">part one</a></span><span style="font-weight: 400;">, there’s just one more piece of the application to cover. In the <a href="https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3/">last part of this three-part series</a>, I’ll show you how to implement the Bitmovin Player and gather data about <em>how</em> users are interacting with your content using Bitmovin Analytics.</span><br />
<span style="font-weight: 400;">Finally, if you need help setting up a scalable video encoding pipeline on AWS, reach out to <a href="https://bitmovin.com/contact-bitmovin">Bitmovin’s team</a></span><span style="font-weight: 400;"> or <a href="https://bitmovin.com/docs/encoding">read more in the encoding API’s documentation</a></span><span style="font-weight: 400;">.</span></p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p2">Cloud-based Per-Title Encoding Workflows (with AWS) &#8211; Part 2: Implementing the Encoding Workflow</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Cloud-based Per-Title Encoding Workflows (with AWS) &#8211; Part 1: Establishing the Architecture</title>
		<link>https://bitmovin.com/cloud-based-per-title-encoding-aws-p1</link>
		
		<dc:creator><![CDATA[Fabre Lambeau]]></dc:creator>
		<pubDate>Mon, 08 Feb 2021 15:00:12 +0000</pubDate>
				<category><![CDATA[Developers]]></category>
		<category><![CDATA[per-title encoding]]></category>
		<category><![CDATA[video encoding]]></category>
		<category><![CDATA[video workflow]]></category>
		<guid isPermaLink="false">https://bitmovin.com/?p=155117</guid>

					<description><![CDATA[<p>If you work with video on the internet, you know how resource-intensive encoding can be. While moving from in-house to cloud-hosted servers can save you a lot of money, that doesn’t change the fact that processing large videos with modern codecs takes significant computing power.  “Video transcoding is one of the most computationally challenging things...</p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1">Cloud-based Per-Title Encoding Workflows (with AWS) &#8211; Part 1: Establishing the Architecture</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-155279" src="https://bitmovin.com/wp-content/uploads/2021/02/BLOG-POST_Cloud-Based-PT-Encoding-2-1024x537.png" alt="Cloud-based per-title encoding_Featured image" width="1024" height="537" /><br />
<span style="font-weight: 400;">If you work with video on the internet, you know how resource-intensive encoding can be. While moving from in-house to cloud-hosted servers <a href="https://blogs.gartner.com/marco-meinardi/2018/11/30/public-cloud-cheaper-than-running-your-data-center/" rel="nofollow noopener" target="_blank">can save you a lot of money</a></span><span style="font-weight: 400;">, that doesn’t change the fact that processing large videos with modern codecs takes significant computing power.</span></p>
<blockquote><p><span style="font-weight: 400;"> “Video transcoding is one of the most computationally challenging things you can do right now. As we’re moving toward more advanced codecs, those challenges become even bigger… [Bitmovin is] trying to deliver the best quality per bit so we can reach users on their mobile device or lower quality connections, while saving on their CDN spend.” – <a href="https://www.youtube.com/watch?v=lcLw-Le_tXQ" rel="nofollow noopener" target="_blank">Paul MacDougall, Principal Sales Engineer, Bitmovin</a></span></p></blockquote>
<p><span style="font-weight: 400;"><a href="https://bitmovin.com/encoding-service">Bitmovin’s video-encoding service</a> and its unique parallelized architecture gives your developers access to the best codecs and encoding algorithms in the industry, allowing them to efficiently transcode videos in the cloud without maintaining their own custom software or hardware. This is how you can set up your very own cloud-based encoding workflow using Bitmovin Encoding with AWS.</span></p>
<h2><span style="font-weight: 400;">Why Per-Title Encoding?</span></h2>
<p><span style="font-weight: 400;">One of the biggest advantages of using Bitmovin is <a href="https://bitmovin.com/encoding-service/per-title-encoding/">per-title encoding</a>. Unlike standard encoding ladders, Per-Title Encoding offers you the best perceivable quality at the lowest possible bitrate. This can lead to fewer encoded files to store and lower bandwidth usage when your video is streamed.</span><br />
<span style="font-weight: 400;">When you compare Per-Title and standard encoding, you’ll notice that the video quality is essentially the same, but the bitrate savings are significant.</span></p>
<figure id="attachment_155119" aria-describedby="caption-attachment-155119" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-large wp-image-155119" src="https://bitmovin.com/wp-content/uploads/2021/02/Per-title-encoding-vs-standard-encoding-bitrate-ladder_image-and-table-comparison-2-1024x611.jpg" alt="Per-title encoding vs standard encoding bitrate ladder_image and table comparison" width="1024" height="611" /><figcaption id="caption-attachment-155119" class="wp-caption-text">Legend: The two ladders compared, with the top rendition streamable for a bandwidth connection limited to 5 Mbps. The Per-Title top rendition has a higher quality (as measured by PSNR and VMAF) at a higher resolution, yet with a 50% reduction of bitrate compared to the highest rendition within the static ladder that can be streamed at that available bandwidth.</figcaption></figure>
<p><span style="font-weight: 400;">Serving video at a lower bitrate means you will stream less data, which in turn means lower hosting costs. As you can see from some of the data obtained during Bitmovin’s AWS Hackathon in 2020</span><span style="font-weight: 400;">, Per-Title Encoding can lead to a large cost saving compared with a standard ladder (up to 69% for some of the assets used in this particular application).</span></p>
<figure id="attachment_155121" aria-describedby="caption-attachment-155121" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-155121 size-large" src="https://bitmovin.com/wp-content/uploads/2021/02/Screenshot-2021-01-28-at-12.01.23-1024x537.png" alt="Comparing storage and streaming costs for standard and Per-Title encoding_Linear graph comparison" width="1024" height="537" srcset="https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/02/Screenshot-2021-01-28-at-12.01.23-300x157.png?lossy=2&amp;strip=1&amp;webp=1 300w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/02/Screenshot-2021-01-28-at-12.01.23.png?size=384x201&amp;lossy=2&amp;strip=1&amp;webp=1 384w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/02/Screenshot-2021-01-28-at-12.01.23-768x403.png?lossy=2&amp;strip=1&amp;webp=1 768w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/02/Screenshot-2021-01-28-at-12.01.23-1024x537.png?lossy=2&amp;strip=1&amp;webp=1 1024w, https://b3148424.smushcdn.com/3148424/wp-content/uploads/2021/02/Screenshot-2021-01-28-at-12.01.23.png?lossy=2&amp;strip=1&amp;webp=1 1467w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-155121" class="wp-caption-text">Legend: Running a streaming simulation with the highest rendition possible under the bandwidth restriction of 5 Mbps shows a 49% saving in streaming costs for per-title encoding. And as for storage, the whole per-title ladder comes with a 78% reduction.</figcaption></figure>
<p><span style="font-weight: 400;">Finally, Per-Title Encoding typically means fewer encoded files to store, which also reduces your hosting costs. While results will vary depending on the complexity of your video, Per-Title Encoding is almost always the right choice, as it optimizes the ladder for every asset individually.</span></p>
<h2><span style="font-weight: 400;">Bitmovin Cloud Connect on AWS</span></h2>
<p><span style="font-weight: 400;">With Bitmovin’s new <a href="https://bitmovin.com/introducing-cloud-connect-encoding-aws-gcp-azure/">Cloud Connect encoding option</a></span><span style="font-weight: 400;">, you can now deploy Bitmovin’s software to your own public cloud account, including Amazon Web Services.</span><br />
<span style="font-weight: 400;">Bitmovin’s Cloud Connect option can help you further reduce your costs, allowing you to take advantage of bulk pricing deals by letting you run Bitmovin’s encoding process on your own AWS infrastructure, including with the Per-Title algorithm. Cloud Connect also gives you more control over how your infrastructure is deployed and lets you apply your own security policies while getting complete access to Bitmovin’s robust software and auto-scaling for maximum performance.</span></p>
<h2>Per-Title Encoding in the Real World using Cloud-Based Workflows (with AWS)</h2>
<p><span style="font-weight: 400;">In this three-part series, you’ll see how to deploy a real-world application that uses Bitmovin’s Per-Title Encoding in a standard cloud-based AWS workflow and with Cloud Connect. This series is based on a workflow that we built in a 2-day winter 2020 hackathon between Bitmovin and AWS</span><span style="font-weight: 400;">.</span><br />
<span style="font-weight: 400;">This first part will give you an overview of the high-level architecture and AWS resources you need to run Bitmovin Per-Title Encoding. <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p2/">In the second part</a>, we’ll dive into the code so you can see some of the important details your engineers will need to run encoding on your AWS architecture with the Per-Title algorithm, and <a href="https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3/">in the third part</a>, you’ll learn how to use the <a href="https://bitmovin.com/video-player">Bitmovin Player</a> to gather analytics and examine how users are consuming your videos in real-time.</span></p>
<h2><span style="font-weight: 400;">What We’re Building</span></h2>
<p><span style="font-weight: 400;">This demo application allows users to upload a video, and then view that video. Behind the scenes, we’ll use both our classic Bitmovin Per-Title as well as our new Cloud Connect options to process and encode the video using a <a href="https://bitmovin.com/per-title-bitrate-ladder-benchmark-tool/">Per-Title ladder</a></span><span style="font-weight: 400;">.</span><br />
<span style="font-weight: 400;">Before starting, it’s important to understand Bitmovin’s services. We offer three services that will be used throughout this application:</span><br />
<span style="font-weight: 400;">&#8211; <strong>Encoder:</strong> Breaks the uploaded video into chunks, transcodes each piece, and stitches them back together when complete.</span><br />
<span style="font-weight: 400;">&#8211; <strong>Player:</strong> Allows users to view the transcoded video on any device and any browser.</span><br />
<span style="font-weight: 400;">&#8211; <strong>Video Analytics</strong>: Give you insight into how users interact with your video, their bitrate, and the amount of data streamed.</span></p>
<figure id="attachment_155122" aria-describedby="caption-attachment-155122" style="width: 960px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-155122 size-full" src="https://bitmovin.com/wp-content/uploads/2021/02/lDgij6O-Imgur-1.jpg" alt="Bitmovin Service offering_Workflow" width="960" height="540" /><figcaption id="caption-attachment-155122" class="wp-caption-text">Bitmovin&#8217;s product&#8217;s in a video workflow</figcaption></figure>
<p><span style="font-weight: 400;">When using Cloud Connect, you still use the Bitmovin platform via its APIs to orchestrate your encoding workflow, but the encoding tasks are performed in your own AWS account. While Cloud Connect runs on your infrastructure, Bitmovin handles most of the hard work of scaling up the number of instances for encoding, so you’ll just need a few Amazon services to glue the pieces together.</span></p>
<h2>Key AWS Services</h2>
<p><span style="font-weight: 400;">AWS has several great products that we’ll use together to handle authentication, file uploads, calling the Bitmovin API, and storing transcoded files and URLs. Let’s look at the key pieces required for this application and what their roles are.</span></p>
<h3><a href="https://aws.amazon.com/cognito/" rel="nofollow noopener" target="_blank"><span style="font-weight: 400;">Cognito</span></a></h3>
<p><span style="font-weight: 400;">AWS Cognito handles user authentication so that only authenticated users can upload a video to your portal. While you could build your own authentication, Cognito saves you a lot of time by integrating with your existing SSO solution and Amazon’s other services.</span></p>
<h3><span style="font-weight: 400;"><a href="https://aws.amazon.com/amplify/" rel="nofollow noopener" target="_blank">Amplify</a></span></h3>
<p><span style="font-weight: 400;">AWS Amplify will power your upload page. It integrates with Cognito and AWS’s various data storage options, so you can focus on the core parts of your application logic rather than the glue that moves data into and out of your backend.</span></p>
<figure id="attachment_155123" aria-describedby="caption-attachment-155123" style="width: 540px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-155123 size-full" src="https://bitmovin.com/wp-content/uploads/2021/02/AWS-Amplify-and-Cognito-for-login_workflow-e1612429766820-2.png" alt="AWS Amplify and Cognito for login_workflow" width="540" height="242" /><figcaption id="caption-attachment-155123" class="wp-caption-text">AWS Amplify and Cognito for login</figcaption></figure>
<h3><span style="font-weight: 400;"><a href="https://aws.amazon.com/s3/" rel="nofollow noopener" target="_blank">Simple Storage Service (S3)</a></span></h3>
<p><span style="font-weight: 400;">AWS S3 offers fast, affordable file hosting. We’ll use it to store the raw video files uploaded by users <em>and</em> the encoded files processed by Bitmovin.</span></p>
<h3><span style="font-weight: 400;"><a href="https://aws.amazon.com/lambda/" rel="nofollow noopener" target="_blank">Lambda</a></span></h3>
<p><span style="font-weight: 400;">AWS Lambda is Amazon’s serverless hosting option, which allows you to write a few lines of code and instantly make them available to run in the cloud rather than having to build and deploy a robust application from scratch. Our Lambda functions will trigger the Bitmovin encoding cluster and handle the results when the encoding is finished.</span></p>
<h3><a href="https://aws.amazon.com/ec2/" rel="nofollow noopener" target="_blank">EC2</a></h3>
<p><span style="font-weight: 400;">Bitmovin’s encoder runs on Amazon EC2 and takes advantage of the pricing discounts for <a href="https://aws.amazon.com/ec2/spot/" rel="nofollow noopener" target="_blank">Spot Instances</a></span><span style="font-weight: 400;"> to help you keep your costs low. While you won’t need to manually spin up any EC2 instances to process videos (Bitmovin handles this for you), it may be helpful to know that this is what’s running under the hood.</span></p>
<figure id="attachment_155124" aria-describedby="caption-attachment-155124" style="width: 720px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-155124 size-full" src="https://bitmovin.com/wp-content/uploads/2021/02/AWS__Bitmovin-Virtual-Hackathon-Deck-e1612429792976-1.jpg" alt="Bitmovin's Cloud Connect Encoding Workflow on AWS_Illustration" width="720" height="405" /><figcaption id="caption-attachment-155124" class="wp-caption-text">Bitmovin Cloud Connect uses EC2 to process videos</figcaption></figure>
<h3><span style="font-weight: 400;"><a href="https://aws.amazon.com/api-gateway/" rel="nofollow noopener" target="_blank">API Gateway</a></span></h3>
<p><span style="font-weight: 400;">Amazon API Gateway will provide a webhook URL that Bitmovin will notify when encoding is complete. API Gateway can then pass data to other Amazon services, so we’ll use it to post encoding information when the processing of a new video is done, to trigger our post-processing Lambda.</span></p>
<h3><span style="font-weight: 400;"><a href="https://aws.amazon.com/dynamodb/" rel="nofollow noopener" target="_blank">DynamoDB</a></span></h3>
<p><span style="font-weight: 400;">Amazon’s proprietary database, DynamoDB, will store the encoded videos’ URLs. The Bitmovin Player will use these URLs to stream video to the user at the appropriate bitrate and resolution.</span></p>
<h3><span style="font-weight: 400;"><a href="https://aws.amazon.com/cloudfront/" rel="nofollow noopener" target="_blank">CloudFront</a></span></h3>
<p><span style="font-weight: 400;">Finally, we’ll use AWS CloudFront to cache the encoded video files. A CDN is essential for streaming video because it ensures that viewers around the world will be able to watch your videos with minimal latency.</span></p>
<h2><span style="font-weight: 400;">Building a Cloud-based Encoding Architecture with AWS</span></h2>
<p><span style="font-weight: 400;">Now that we’ve reviewed how each Amazon service will be used, let’s walk through the flow of data through your application.</span></p>
<figure id="attachment_155298" aria-describedby="caption-attachment-155298" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-155298 size-large" src="https://bitmovin.com/wp-content/uploads/2021/02/aws___bitmovin_-_hackathon_2020_-_live-1-1024x683.png" alt="Bitmovin Products using AWS Services_Workflow" width="1024" height="683" /><figcaption id="caption-attachment-155298" class="wp-caption-text">Bitmovin Products within AWS Service Workflow</figcaption></figure>
<p><span style="font-weight: 400;">There’s a lot going on in the diagram above, so let’s break it down:</span></p>
<ol>
<li><span style="font-weight: 400;"> A user logs in using Cognito and is directed to a simple upload page hosted on Amplify.</span></li>
</ol>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-155174 size-large" src="https://bitmovin.com/wp-content/uploads/2021/02/SjP2EHx-e1612429653587-1024x247.png" alt="- Bitmovin" width="1024" height="247"></p>
<ol start="2">
<li><span style="font-weight: 400;"> The user can upload a file, which is then stored in an S3 bucket.</span></li>
<li><span style="font-weight: 400;"> An <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html" rel="nofollow noopener" target="_blank">S3 event notification</a></span><span style="font-weight: 400;"> triggers a first Lambda function.</span></li>
<li><span style="font-weight: 400;"> The Lambda function configures and triggers a new Bitmovin encoding <a href="https://bitmovin.com/docs/encoding/api-reference">using the API</a></span><span style="font-weight: 400;">, taking as parameter the new file’s location on S3.</span></li>
<li><span style="font-weight: 400;"> Bitmovin spins up Spot Instances as needed to encode the file, and saves the outputs of the encoding to another S3 bucket. </span></li>
<li><span style="font-weight: 400;"> On completion (or failure) of the encoding, Bitmovin calls a webhook hosted on Amazon API Gateway.</span></li>
</ol>
<ol start="7">
<li><span style="font-weight: 400;"> The API gateway endpoint triggers a second Lambda function, which retrieves the <a href="https://bitmovin.com/docs/encoding/api-reference/sections/manifests">manifest URLs</a></span><span style="font-weight: 400;"> from the finished encoding job.</span></li>
<li><span style="font-weight: 400;"> The Lambda saves these URLs to DynamoDB along with some video metadata.</span></li>
<li><span style="font-weight: 400;"> The Demo Page with embedded Bitmovin player retrieves the data from DynamoDB and triggers playback.</span></li>
<li><span style="font-weight: 400;"> The video files are served from S3 through CloudFront to the Bitmovin Player.</span></li>
<li><span style="font-weight: 400;"> The Player sends data to Bitmovin Analytics.</span></li>
</ol>
<p><span style="font-weight: 400;">The <a href="https://demo.bitmovin.com/public/awshack20/">application built for the Bitmovin-AWS hackathon</a></span><span style="font-weight: 400;"> actually triggered 2 encodings, one for a static ladder and the other one with Per-Title. This allowed us to compare and contrast the two types of encodings. It goes without saying that you are unlikely to need to do this in a real-life application, but the principles remain the same. We will highlight in the remainder of this 3-part blog when a step is taken specifically to enable this demo use case.</span></p>
<h2><span style="font-weight: 400;">Other Options</span></h2>
<p><span style="font-weight: 400;">While the architecture discussed here takes advantage of many of AWS’s latest services and features, you might want to integrate the Bitmovin Encoder into an existing application that’s set up very differently. Fortunately, the encoder can be called from any codebase and Bitmovin offers <a href="https://bitmovin.com/docs/encoding/sdks">SDKs</a> and <a href="https://bitmovin.com/docs/getting-started">getting started</a></span><span style="font-weight: 400;"> guides for using the API.</span><br />
<span style="font-weight: 400;">For example, you don’t need to use Lambdas to call the Bitmovin API or API gateway to listen for the completed encoding jobs. You can easily call the encoder’s API from an application deployed to EC2 or <a href="https://aws.amazon.com/ecs/" rel="nofollow noopener" target="_blank">ECS</a></span><span style="font-weight: 400;">. Similarly, there’s no reason you have to use DynamoDB (or a NoSQL data store at all) if you prefer MySQL or Postgres.</span></p>
<h2><span style="font-weight: 400;">What’s Next?</span></h2>
<p><span style="font-weight: 400;">Now that you have a high-level view of how you can deploy Bitmovin Per-Title Encoding with Cloud Connect to your AWS account, you’re probably ready to see some real API calls so you can replicate this yourself. <a href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p2/">In the next part of this series</a>, I’ll get more tactical, showing some of the code you can use to run this application. Finally, <a href="https://bitmovin.com/implementing-video-player-per-title-encoding-aws-p3/">in the third part of this series</a>, you can learn how to use Bitmovin Analytics to understand how your users interact with your content delivered through the player.</span><br />
<span style="font-weight: 400;">In the meantime, you can <a href="https://bitmovin.com/docs/encoding/">check out our API documentation</a></span><span style="font-weight: 400;"> or <a href="https://bitmovin.com/docs/encoding/tutorials/using-bitmovin-cloud-connect-with-aws">our step-by-step tutorial for deploying Cloud Connect</a></span><span style="font-weight: 400;"> to learn more. When you’re ready to implement Bitmovin, <a href="https://bitmovin.com/contact-bitmovin">contact us</a> </span><span style="font-weight: 400;">so we can help you get started.</span></p>
<p>The post <a rel="nofollow" href="https://bitmovin.com/cloud-based-per-title-encoding-aws-p1">Cloud-based Per-Title Encoding Workflows (with AWS) &#8211; Part 1: Establishing the Architecture</a> appeared first on <a rel="nofollow" href="https://bitmovin.com">Bitmovin</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
