AthletiFi / athletifi-website

Official website for AthletiFi
https://www.athleti.fi
1 stars 5 forks source link

Refactor Mux Video Optimization as Lambda Function #194

Closed qisforq closed 3 months ago

qisforq commented 3 months ago

Objective:

Refactor the Mux video optimization process to use a Lambda function that optimizes videos upon uploading to an S3 bucket, instead of optimizing during the Next.js project build.

Tasks:

qisforq commented 3 months ago

This section of the documentation gives me faith that this is the right approach: https://docs.mux.com/core/make-api-requests#using-mux-with-serverless-functions

qisforq commented 3 months ago

Here is my simplified, un-chatgptified, understanding of the approach:

  1. a video gets uploaded to S3, triggering this lambda function
  2. The lambda function takes the S3 URL of the video and sends it to Mux using the 'Create Asset' API method
  3. Mux returns an asset id (or you have to query for the asset id after the video is finished optimizing)
  4. We need to save that asset id in the database, so we can then use it to call the video in the next-video player
chef-louis commented 3 months ago