Skip to content

written in go, fast and efficient processing within AWS Lambda for HLS file encryption. The tool enables the encryption of HLS files directly from a Lambda function, enhancing the flexibility and scalability of handling media streaming workflows on the AWS platform.

License

Notifications You must be signed in to change notification settings

meanii/aws-lambda-hls-enc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-lambda-hls-enc

Go-powered AWS Lambda tool for swift and efficient HLS file encryption, empowering direct encryption of HLS files within Lambda. Boosts flexibility and scalability for managing media streaming workflows on AWS.

Deployment

  1. Create AWS Lambda function with API Gateway

    • Runtime: Amazon Linux 2
    • Architecture: arm64
  2. Deploy the compiled and zipped file to Lambda, using the artifacts from this release.

  3. Now, you need to configure a few environment variables.

Name Value Type Description
CLOUDFRONT_ORIGIN String Cloudfront CDN Domain
CLOUDFRONT_ACCESS_KEY_ID String Cloudfront Public KeyID
CLOUDFRONT_PRIVATE_KEY_BASE64 String Cloudfront Generated Private Key
EXPIRE_TIME String Signature URL Expiry Time, e.g. (2h)
  1. IMPORTANT: To ensure the entire process functions correctly, it is necessary to pre-sign your master.m3u8 file with the corresponding CDN origin URL. Subsequently, update the domain to the deployed Lambda function.

Example:

  1. Pre-sign your master.m3u8 file with the CDN origin URL:
  • Original URL: https://cdn-origin.com/master.m3u8
  • Pre-signed URL: https://cdn-origin.com/master.m3u8?Expires=1610000000&Signature=xxxx&Key-Pair-Id=xxxx
  1. After deploying the Lambda function, update the domain to the Lambda function URL:
  • Updated URL: https://your-lambda-function-url/master.m3u8?Expires=1610000000&Signature=xxxx&Key-Pair-Id=xxxx

Ensure to follow these steps for seamless integration with the Lambda function.

About

written in go, fast and efficient processing within AWS Lambda for HLS file encryption. The tool enables the encryption of HLS files directly from a Lambda function, enhancing the flexibility and scalability of handling media streaming workflows on the AWS platform.

Resources

License

Stars

Watchers

Forks

Packages

No packages published