Skip to content

Latest commit

 

History

History

video_transcode

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

S3 Direct Upload And Video Transcoding Demo

Provisioning

Unlike the upload only demo, provisioning for this demo is harder because it's not yet possible to automate all the steps with Terraform. There is a configuration under src/main/terraform but it's not complete (it lacks Elastic Transcoder support).

  1. Change into src/main/terraform under the demo directory.

  2. Set the following environment variables:

  • TF_VAR_AWS_SECRET_KEY
  • TF_VAR_AWS_ACCESS_KEY
  1. Configure the remaining AWS variables in variables.tf.

  2. Disable the Lambda config:

    mv aws_lambda.tf aws_lambda.tf.disabled

  3. Run the following to check all is well:

    terraform plan

  4. Apply the config:

    terraform apply

  5. Log in to the AWS console and create an Elastic Transcoder pipeline. It needs to read from and write to the S3 buckets created by Terraform. Note the pipeline ID once it is created.

  6. Update src/main/js/index.js with the pipeline ID.

  7. Re-enable the Terraform Lambda config, in src/main/terraform:

    mv aws_lambda.tf.disabled aws_lambda.tf

  8. Run the plan again to check all is well:

    terraform plan

  9. Apply the remaining config:

    terraform apply

  10. In the S3 Console, open the input bucket's properties. Change the Events sections and add a notification on ObjectCreated to call the lambda created above.

Running the demo

  1. Edit src/main/resources/application.properties to set the appropriate values.

  2. Run maven with mvn.

  3. Navigate to http://localhost:8080/.

  4. Upload a video.

  5. After a short delay, check the Elastic Transcoder console to see if a job has been scheduled. If not, check the Lamba console and see if there were any errors.