skip to Main Content

I have a project that requires creating a video streaming service, where users get to upload their video content, the video stream service is suppose to handle transcoding into different resolutions, add watermark and other steps. i need guidance building such a robust system on aws, that is also cost effective.

I have tried to setup a basic lambda from the aws docs, and use mediaconvert, but i feel like i still need to create more of a system, and i am also looking at the aws cost, someone suggested a custom solution

2

Answers


  1. We have developed this way.

    • frontend uploads video to Cloudfront -> s3
    • and store a json file with details of video like if any other caption file uploaded by user or any thumbnail
    • once this json file is uploaded in s3, event bridge will initiate a step function
    • Step function will have multiple step, each executing specific task, you use lambda here to consume all the services you need.
    • you can add as many step as you like for example media convert, transcribe, Rekognition or any other.
    • once stepfunction completes processing it can generate an event in SNS/SQS to inform consumer that it completed or if there was any error.

    You can follow this architecture help from AWS.
    https://aws.amazon.com/developer/application-security-performance/articles/video-streaming-architectures/
    [![enter image description here][1]][1]

    Login or Signup to reply.
  2. Here is a high-level architecture and steps you can follow:

    • Create an Amazon S3 bucket to store the uploaded videos. This can be
      the source location for videos before transcoding.
    • Use AWS Lambda to trigger the video processing workflow when a new
      video is uploaded to the S3 bucket. Lambda can be configured to run
      in response to S3 events (e.g., an object creation event).
    • Set up an AWS Elemental MediaConvert job in the Lambda function to
      transcode the uploaded video into different resolutions. Define the
      output settings according to your requirements.
    • To add a watermark, you can extend the Lambda function or introduce
      another Lambda function to overlay the watermark on the transcoded
      videos. You might use an image stored in an S3 bucket as the
      watermark.
    • Store metadata related to videos, such as video ID, user, transcoding
      status, etc., in Amazon DynamoDB. This can be useful for tracking the
      status of transcoding jobs and managing the state of the system.
    • Use Amazon CloudFront (Cloudflare / Akamai – better options) for content delivery to provide low-latency access to the transcoded videos. This also helps in reducing the load on your origin (S3 bucket) and improving the end-user experience.

    From Cost effectiveness purpose:
    a. Optimize the Lambda function execution time to minimize costs. Consider using provisioned concurrency if you have consistent traffic.
    b. Consider using reserved capacity for AWS Elemental MediaConvert if you have predictable and consistent transcoding workloads.
    c. Utilize S3 storage classes based on access patterns. Infrequent Access (S3 IA) or Glacier might be more cost-effective for videos that are accessed less frequently.
    d. Regularly monitor and analyze your AWS costs using AWS Cost Explorer and set up billing alerts to stay within your budget.
    e. For burstable transcoding workloads, consider using AWS Elemental MediaConvert with Spot Instances to potentially reduce costs.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search