Medical Imaging with AWS
February 6, 2023Accelerating Performance and Optimizing Costs with AWS Elastic Beanstalk
May 22, 2023According to forecasts, the digital media industry in the United States will experience an increase in the average revenue per user, ranging from 78.7 to 407 U.S. dollars by 2027. The user base is also expected to increase from 126.4 million to 202.6 million by 2027.
Audio will be a crucial segment for this market base – digital audio content and digital music available as downloads or internet streams.
Entrepreneurs looking for innovative ways to harness this opportunity are on the lookout for solutions that helps them build audio streaming platforms while ensuring IP protection and secure delivery.
Architecture Overview
I have designed an audio streaming solution on the AWS cloud to publish curated audio.
The AWS services used are Amazon Cognito, AWS API Gateway, Amazon S3, AWS Lambda, Amazon DynamoDB, AWS Elemental MediaConvert, and Amazon CloudFront
- The mobile and web app utilizes Cognito for user authentication.
- API Gateway handles various tasks associated with managing API calls, such as traffic management, CORS support, access control, monitoring, throttling, and API version management.
- Multiple Lambda functions serve different purposes within this solution, such as triggering MediaConvert jobs, storing metadata in DynamoDB, creating signed URL tokens, and sending notifications when MediaConvert jobs are finished.
- MediaConvert is utilized to automatically transcode uploaded videos into HLS format for various bitrates, including 2 Mbps, 1 Mbps, 600 Kbps, and 400 Kbps. This ensures that video content can be played on multiple devices with different network bandwidth connections using adaptive bitrate streams.
Additional setup information
- Signed Cookies/URLs: Allow CloudFront to configure Expiry Time, Allowed IP Address, FileName for each URL. By default, No Read access is assigned to content distributed by the CDN. Content can only be downloaded and accessed when requested using the proper Signed Cookies generated by the app.
Solution Walkthrough
- Admin log’s-in by Authentication itself from Cognito via API Gateway (Steps1,2,3)
- Once Authenticated, Admin uploads an Audio file via a signed URL to the Input S3 and records its metadata in DynamoDB. The signed URL is obtained via Lambda (Steps4,5,6,7)
- The audio file is then transcoded and placed in an Output S3. (Steps8, 9,10,11,12)
- Now that the audio is ready for streaming
- Customers can now log in. They get authenticated from Cognito via API Gateway. (Steps13, 14, 15)
- Once authenticated, they can request a list of available audios stored in the DynamoDB and also get signed URLs via Lambda functions (Steps16,17,18,19,20)
- And finally, they can choose the audio to play. The request is made to the CloudFront endpoint, which caches and loads the files from the output bucket (Steps21,22,23)
Benefits of this solution
- Saves compute power by direct upload
- Ensures Security with Signed URLs
- Saves transcoding costs with Elemental MediaConnect
- Option of using DRM with Elemental
Eye on the future
This solution is also extensible; using the mobile phone location function, you could publish audio that is relatable to that location only.