{"id":13907410,"url":"https://github.com/aws-solutions-library-samples/live-streaming-on-aws","last_synced_at":"2026-01-17T08:05:44.931Z","repository":{"id":40418834,"uuid":"74421869","full_name":"aws-solutions/live-streaming-on-aws","owner":"aws-solutions","description":"The live stream solution is a reference deployment that demonstrates how to deliver highly available live streaming video through an integrated workflow between Elemental Cloud and AWS.","archived":false,"fork":false,"pushed_at":"2025-03-14T18:27:38.000Z","size":4604,"stargazers_count":296,"open_issues_count":0,"forks_count":112,"subscribers_count":55,"default_branch":"main","last_synced_at":"2025-04-08T11:10:00.973Z","etag":null,"topics":["aws","cloudfront","live-streaming","medialive","mediapackage","mediastore","ott"],"latest_commit_sha":null,"homepage":"https://aws.amazon.com/solutions/implementations/live-streaming-on-aws/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws-solutions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-22T01:29:19.000Z","updated_at":"2025-03-14T18:27:22.000Z","dependencies_parsed_at":"2024-01-19T10:21:40.176Z","dependency_job_id":"4df03266-3ee5-4d38-af4b-e38893c1bcd8","html_url":"https://github.com/aws-solutions/live-streaming-on-aws","commit_stats":{"total_commits":122,"total_committers":17,"mean_commits":7.176470588235294,"dds":0.6311475409836065,"last_synced_commit":"e44cb5ee0a0bf623091a028d7e1f941f3f522407"},"previous_names":["aws-solutions/live-streaming-on-aws","aws-solutions/live-stream-on-aws"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Flive-streaming-on-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Flive-streaming-on-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Flive-streaming-on-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-solutions%2Flive-streaming-on-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws-solutions","download_url":"https://codeload.github.com/aws-solutions/live-streaming-on-aws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloudfront","live-streaming","medialive","mediapackage","mediastore","ott"],"created_at":"2024-08-06T23:01:55.674Z","updated_at":"2026-01-17T08:05:43.379Z","avatar_url":"https://github.com/aws-solutions.png","language":"JavaScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# Live Streaming on AWS\n\nHow to implement Live streaming on AWS  at scale leveraging AWS Elemental MediaLive,  MediaPackage and Amazon CloudFront. This repo contains the source code for the AWS solution [Live Streaming on AWS](https://aws.amazon.com/solutions/implementations/live-streaming-on-aws/?did=sl_card\u0026trk=sl_card).\n\n## Architecture Overview\n\n![Architecture](architecture.png)\n\n**AWS Elemental MediaLive**\u003cbr/\u003e\nIs configured to ingest 2 live feeds and transcode the content into multiple adaptive bitrate HLS content.  The solution can be configured to ingest RTP RTMP HLS and MediaConnect streams and will apply 1 of 3 encoding profiles which include bitrates of 1080p through 270p. The encoding profile is set at launch and is based on the source resolution (See Encoding Profiles below).\n\n**AWS Elemental MediaPackage**\u003cbr/\u003e\nIngests the MediaLive Output and package the Live stream into HLS, DASH, and CMAF formats that are delivered through 3 MediaPackage custom endpoints.\n\n**Amazon CloudFront**\u003cbr/\u003e\nIs configured with the MediaPackage custom endpoints as the Origins for the distribution. CloudFront then enable the live stream content to be delivered globally and at scale.\n\n**Optional Demo Deployment**\u003cbr/\u003e\nAs part of the CloudFormation template a Demo HTML preview player is deployed to an Amazon S3 bucket which is a single page HTML/JavaScript application that will playback the HLS, DASH, MSS and CMAF streams. In addition, the solution can be configured to ingest a Demo HLS feed hosted on AWS.   \n\n\n## Deployment\nThe solution is deployed using a CloudFormation template with a lambda backed custom resource, available in both NodeJS and Python.\nFor details on deploying the solution please see the details on the Solution home page:  [Live Streaming on AWS](https://aws.amazon.com/solutions/implementations/live-streaming-on-aws/?did=sl_card\u0026trk=sl_card)\n\n## Encoding Profiles\nTo solution Configures AWS Elemental MediaLive with one of three encoding profiles based on the source resolution defined at launch as a CloudFormation parameter. The three options are 1080, 720, 540 and correspond to the following encoding profiles:\n\n* HD-1080p profile: 1920x1080, 1280x720, 960x540, 768x432, 640x360, 512x288\n* HD-720p profile: 1280x720, 960x540, 768x432, 640x360, 512x288\n* SD-540p profile:  960x540, 768x432, 640x360, 512x288\n\nThe profiles are defined in JSON and and can be found in:\n```\n  source/custom-resource/lib/medialive/encoding-profiles/\n```\n\n## Source code\n\n**source/custom-resources::**\u003cbr/\u003e\nA NodeJS based  Lambda function used as a custom resource for deploying MediaLive and MediaPackage resources through CloudFormation.\n\n## Deployment\nThe solution can be deployed through the CloudFormation template available on the solution [home page](https://aws.amazon.com/solutions/implementations/live-streaming-on-aws/).\n\n## Creating a custom build\n\n### Prerequisites:\n* [AWS Command Line Interface](https://aws.amazon.com/cli/)\n* Node.js 12.x or later\n* AWS CDK 1.125.0\n\nThe are 2 options for deploying the solution: using the CDK deployment tools or running the build script to generate a CFN template and the packaged lambda code.\n\n### Options 1: Deploying through the CDK.\nThis options simply flollows the standard CDK deployment process. You will need to run `cdk bootstrap` before you run cdk deploy the first time to setup the cdk resource in your AWS account. Details on using the CDK can be found [here].\n\n1. Download or clone the repo and make the required changes to the source code.\n2. installl the dependencies for the lambda function and construct.\n3. then run `cdk deploy` (first time use you will need to run `cdk bootstrap` first)\n\n```\ncd ./source/custom-resource\nnpm install --production\ncd ../constructs\nnpm install \ncdk bootstrap //if you havent already done so.\ncdk deploy\n```\n\n### Option 2: Generate a CloudFormation template.\nThe CloudFormation template (generated by the CDK) includes a lambda backed custom resource to configure MediaLive and create a UUID. To launch the solution the Lambda source code has to be deployed to an Amazon S3 bucket in the region you intend to deploy the solution. \n\n### 1. Clone the repo\nDownload or clone the repo and make the required changes to the source code.\n\n### 2. Running unit tests for customization\nRun unit tests to make sure added customization passes the tests:\n```\ncd ./deployment\nchmod +x ./run-unit-tests.sh \u0026\u0026 ./run-unit-tests.sh\n```\n\n### 3. Create an Amazon S3 Bucket\nThe CloudFormation template is configured to pull the Lambda deployment packages from Amazon S3 bucket in the region the template is being launched in. Create a bucket in the desired region with the region name appended to the name of the bucket. eg: for us-east-1 create a bucket named: `my-bucket-us-east-1`\n```\naws s3 mb s3://my-bucket-us-east-1\n```\n\nEnsure that you are owner of the AWS S3 bucket. \n```\naws s3api head-bucket --bucket my-bucket-us-east-1 --expected-bucket-owner YOUR-AWS-ACCOUNT-NUMBER\n```\n\n### 4. Create the deployment packages\nBuild the distributable:\n```\nchmod +x ./build-s3-dist.sh\n./build-s3-dist.sh \u003cmy-bucket\u003e live-streaming-on-aws \u003cversion\u003e\n```\n\n\u003e **Notes**: The _build-s3-dist_ script expects the bucket name as one of its parameters. This value should not have the region suffix (remove the -us-east-1)\n\nDeploy the distributable to the Amazon S3 bucket in your account:\n```\naws s3 sync ./regional-s3-assets/ s3://my-bucket-us-east-1/live-streaming-on-aws/\u003cversion\u003e/ \naws s3 sync ./global-s3-assets/ s3://my-bucket-us-east-1/live-streaming-on-aws/\u003cversion\u003e/ \n```\n\n### 5. Launch the CloudFormation template.\n* Get the link of the live-streaming-on-aws.template uploaded to your Amazon S3 bucket.\n* Deploy the solution.\n\n## License\n\n* This project is licensed under the terms of the Apache 2.0 license. See here `LICENSE`.\n\nThis solution collects anonymized operational metrics to help AWS improve the\nquality of features of the solution. For more information, including how to disable\nthis capability, please see the [implementation guide](https://docs.aws.amazon.com/solutions/latest/live-streaming/welcome.html).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-solutions-library-samples%2Flive-streaming-on-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-solutions-library-samples%2Flive-streaming-on-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-solutions-library-samples%2Flive-streaming-on-aws/lists"}