Live Stream Encoding

23 / Jul / 2019 by Minakshi Sharma 0 comments

In this blog, we have listed the steps to create a set-up using which we can capture live streaming from source camera & 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. 

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.

Deployment of Live Streaming Template:

  1. Download a sample template from this link
  2. Go to “cloudformation” from the services tab, and choose “stack” from the left navigation panel and then select “create stack”.
  3. Select “Template is ready” under prepare template and “Upload a template file” under the template source section. Then, select the template file which is to be uploaded and click on the next button.
  4. “Specify stack details” form will be displayed wherein you can update the parameters. Set the source code to python, Input CIDR Block to “” and source input type to “RTMP PUSH”. Specify stack details
  5. Click on the next button. Check acknowledgment checkbox and click on the “create stack” button.acknowledgment checkbox
  6. It may take a while in processing. After completion, it will look like below screenshot. Completion Stage
  7. Now, the template would have created the medialive input, media live channels and media package channel. You can confirm all this via AWS console.

Setting up live stream Encoder:

  1. Go to “medialive” service, choose inputs from the left panel and check input created by the template. medialive
  2. Note down the streams generated on the input detail page. streams generated
  3. Choose channels option from the left panel and check channel created by the template. You can verify the input associated with this channel. check channel created
  4. Go to mediapackage service, choose channels from the left panel and check input URL/username/password created by the template. mediapackage service
  5. 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.output profile of mediaLive channel
  6. Now if everything looks fine, then it’s time to test live video streaming. For this, you need to install a mobile app named as “Larix broadcaster”. 
  7. 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. media package channel
  8. Now, go to your media package channel where you can see the endpoints generated.
  9. Open medialive channel in the other tab and start the channel.
  10. 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. 
  11. 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.endpoint section of mediapackage channel
  12. 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.mediapackage player.



Leave a Reply

Your email address will not be published. Required fields are marked *