{"id":53264,"date":"2019-07-23T11:17:32","date_gmt":"2019-07-23T05:47:32","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=53264"},"modified":"2019-07-23T11:17:32","modified_gmt":"2019-07-23T05:47:32","slug":"live-stream-encoding","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/live-stream-encoding\/","title":{"rendered":"Live Stream Encoding"},"content":{"rendered":"<p><span style=\"font-weight: 400\">In this blog, we have listed the steps to create a set-up using which we can capture live streaming from source camera &amp; pass it to any streaming device which includes mobile, browser or smart-tv apps. Using this set-up, we can stream any live event like a conference, cricket match etc.\u00a0<\/span><\/p>\n<p>MediaLive is a real-time video service that lets you create live outputs for streaming. It is used to transform live video content from one format\/package into another format\/package. For different formats and packages, AWS Elemental MediaPackage comes into the picture.<\/p>\n<p><strong>Deployment of Live Streaming Template:<\/strong><\/p>\n<ol>\n<li><span style=\"font-weight: 400\"> Download a sample template from this <\/span><a title=\"AWS CloudFormation Template\" href=\"https:\/\/docs.aws.amazon.com\/solutions\/latest\/live-streaming\/template.html\"><span style=\"font-weight: 400\">link<\/span><\/a><span style=\"font-weight: 400\">.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400\"> Go to &#8220;cloudformation&#8221; from the services tab, and choose &#8220;stack&#8221; from the left navigation panel and then select &#8220;create stack&#8221;.<\/span><\/li>\n<li><span style=\"font-weight: 400\"> Select &#8220;Template is ready&#8221; under prepare template and &#8220;Upload a template file&#8221; under the template source section. Then, select the template file which is to be uploaded and click on the next button.<\/span><\/li>\n<li><span style=\"font-weight: 400\"> &#8220;Specify stack details&#8221; form will be displayed wherein you can update the parameters. Set the source code to python, Input CIDR Block to &#8220;0.0.0.0\/0&#8221; and source input type to &#8220;RTMP PUSH&#8221;.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53265 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/41.png\" alt=\"Specify stack details\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/41.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/41-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/41-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/41-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/li>\n<li>Click on the next button. Check acknowledgment checkbox and click on the &#8220;create stack&#8221; button.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53279 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/55.png\" alt=\"acknowledgment checkbox\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/55.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/55-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/55-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/55-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/li>\n<li><strong><span style=\"font-weight: 400\">It may take a while in processing. After completion, it will look like below screenshot.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53267 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/61.png\" alt=\"Completion Stage\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/61.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/61-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/61-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/61-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Now, the template would have created the medialive input, media live channels and media package channel. You can confirm all this via AWS console.<\/span><\/strong><\/li>\n<\/ol>\n<p><strong><span style=\"text-decoration: underline\">Setting up live stream Encoder:<\/span><\/strong><\/p>\n<ol>\n<li><strong><span style=\"font-weight: 400\">Go to &#8220;medialive&#8221; service, choose inputs from the left panel and check input created by the template.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53268 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/15.png\" alt=\"medialive\" width=\"1299\" height=\"620\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/15.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/15-300x143.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/15-1024x488.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/15-624x297.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Note down the streams generated on the input detail page.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53269 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/22.png\" alt=\"streams generated \" width=\"1299\" height=\"620\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/22.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/22-300x143.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/22-1024x488.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/22-624x297.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Choose channels option from the left panel and check channel created by the template. You can verify the input associated with this channel.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53270 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/31.png\" alt=\"check channel created\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/31.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/31-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/31-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/31-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Go to mediapackage service, choose channels from the left panel and check input URL\/username\/password created by the template.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53271 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/4a.png\" alt=\"mediapackage service\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/4a.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/4a-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/4a-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/4a-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">These URL\/username\/password are given as the destination in the output profile of mediaLive channel. You can verify the same under the settings tab of the media live channel.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53273 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/5a.png\" alt=\"output profile of mediaLive channel\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/5a.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/5a-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/5a-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/5a-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/> <\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Now if everything looks fine, then it&#8217;s time to test live video streaming. For this, you need to install a mobile app named as &#8220;Larix broadcaster&#8221;.\u00a0 <\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Once the app is installed on a device then go to the settings icon and click on choose connections, choose new connection, and provide any name in the name field, give that input stream URL in the URL field, which you noted down in the 2nd step. Also, save the connection.\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53275 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/71.png\" alt=\"media package channel\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/71.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/71-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/71-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/71-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Now, go to your media package channel where you can see the endpoints generated. <\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Open medialive channel in the other tab and start the channel.<\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Now, open your mobile app and make sure that your input stream is selected under the connections. Start capturing the video, if medialive channel is in the running state.\u00a0<\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Now your mobile app will start pushing the video to the input stream. Play the URL in the endpoint section of mediapackage channel. It will open the video preview.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53281 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/101.png\" alt=\"endpoint section of mediapackage channel\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/101.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/101-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/101-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/101-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/><\/span><\/strong><\/li>\n<li><strong><span style=\"font-weight: 400\">Video may take upto 30 seconds to play on the mediapackage player. To decrease the latency, you can reduce the segment duration of mediapackage by editing any endpoint. You can find the segment duration under packager settings section of endpoint detail page.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-53282 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/112.png\" alt=\"mediapackage player.\" width=\"1299\" height=\"669\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2019\/07\/112.png 1299w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/112-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/112-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2019\/07\/112-624x321.png 624w\" sizes=\"(max-width: 1299px) 100vw, 1299px\" \/> <\/span><\/strong><\/li>\n<\/ol>\n<p><strong><strong><br \/>\n<\/strong><\/strong><strong><strong><br \/>\n<\/strong><\/strong><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we have listed the steps to create a set-up using which we can capture live streaming from source camera &amp; pass it to any streaming device which includes mobile, browser or smart-tv apps. Using this set-up, we can stream any live event like a conference, cricket match etc.\u00a0 MediaLive is a real-time [&hellip;]<\/p>\n","protected":false},"author":1222,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5},"categories":[1,4683],"tags":[4812,4811,4810,2235,4817,4816,2109],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/53264"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1222"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=53264"}],"version-history":[{"count":5,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/53264\/revisions"}],"predecessor-version":[{"id":53274,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/53264\/revisions\/53274"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=53264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=53264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=53264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}