> Canonical URL: https://codingcat.dev/post/aws-amplify-video

# AWS Amplify Video

✏️ Blog PostMay 31, 2022[![](/logos/tags/aws-symbol-light.svg)![](/logos/tags/aws-symbol-dark.svg)AWS](/topic/aws)[![](/logos/tags/react-symbol-light.svg)![](/logos/tags/react-symbol-dark.svg)React](/topic/react)[![](/logos/tags/github-symbol-light.svg)![](/logos/tags/github-symbol-dark.svg)GitHub](/topic/github)[![](/logos/tags/graphql-symbol-light.svg)![](/logos/tags/graphql-symbol-dark.svg)GraphQL](/topic/graphql)[![](/logos/amplify/amplify.svg)![](/logos/amplify/amplify.svg)AWS Amplify](/topic/amplify)[![](/logos/tags/mcp-symbol-light.svg)![](/logos/tags/mcp-symbol-dark.svg)MCP](/topic/mcp)[#WebDev](/topic/webdev)[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)

# AWS Amplify Video

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/fef737e0e6b97819ae74804020afe80d5a85c3ed-1920x1080.png?w=1920&h=1080&q=82&fit=max&auto=format)[@CodingCatDev62.5K / 100K Subscribers Goal](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Subscribe on YouTube→](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Watch on YouTube App ↗](https://www.youtube.com/watch?v=vM_YoZbLQQ0&list=UUnKZ8gEb78zXKMi1ns-IQ2g)[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)

> AWS Account is required for this lesson. You may (and probably will) incur fees associated with these activities. Livestreaming is VERY expensive so be careful!

## Startup

Please make sure that you see the prerequisites, the are Node, NPM and Git. [https://docs.amplify.aws/start/getting-started/installation/q/integration/react](https://docs.amplify.aws/start/getting-started/installation/q/integration/react)

### Installing Amplify

Make sure you install amplify globally. This will allow you to execute commands within your project.

Copied! 🐾

```
npm install @aws-amplify/cli@latest -g
```

### Configuring Amplify with AWS

Run the below command to add configuration to for AWS.

Copied! 🐾

```
amplify configure
```

You will need to finish adding the required role for your amplify CLI to connect with AWS..

### Initializing Project

> If you prefer to follow the guide see the link in the React section.

Copied! 🐾

```
amplify init
```

This is the setup that I provided for using VSCode and creating a React

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/5d643e299632c4ac596ee18619d45dd2a598aa08-1972x734.png?w=1600&q=82&fit=max&auto=format)

## React setup

I would recommend this guide for fully setting up a React project.

[https://docs.amplify.aws/start/getting-started/setup/q/integration/react#initialize-a-new-backend](https://docs.amplify.aws/start/getting-started/setup/q/integration/react#initialize-a-new-backend)

`npx` is an npm command that will fetch the necessary dependencies and create a React Application.

Copied! 🐾

```
npx create-react-app react-amplified
cd react-amplified
```

## Amplify Add Video

At the time of writing this lesson there are two options that you can use for video, Livestream and Video on Demand (VOD). VOD is currently still in beta but it still produces a great streaming setup for VOD.

### Livestream

> I just want to repeat, Livestream is a cool experiement but SUPER expensive to run!

For adding Livestream you can accept all of the defaults (I used a custom name for the project).

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/2aa3b4720d241b3803daf740e003b8a14be80ede-2126x578.png?w=1600&q=82&fit=max&auto=format)

Whenever you add new services to Amplify you then need to push them to AWS. Amplify uses Cloudformation to create all of the required services. The key item that is created for Livestream is AWS Elemental MediaLive.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/d91fc2b478c6b2e90898c1e31b370c3c51cffd80-992x292.png?w=992&q=82&fit=max&auto=format)

You will be able to find a great amount of detail from this link [https://aws.amazon.com/medialive/](https://aws.amazon.com/medialive/). This image represents exactly how we are utilizing the service. Our input source is OBS instead of a camera like depicted on the left.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/e0efd5de842222d496fbbc3668d2d73fe4234d2a-2168x748.png?w=1600&q=82&fit=max&auto=format)

## Video on Demand (VOD)

Probably the best explantion for what is going to happen for this part of the lesson is described in the GitHub Issue for VOD. [https://github.com/awslabs/amplify-video/issues/4](https://github.com/awslabs/amplify-video/issues/4)

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/5416d933e6721483e4b0d9d8bf2f6907e2b7dbba-4032x3024.png?w=1600&q=82&fit=max&auto=format)

This is very similar to the larger image diagram that AWS has listed, however it is much simpler to follow.

[https://aws.amazon.com/solutions/implementations/video-on-demand-on-aws/](https://aws.amazon.com/solutions/implementations/video-on-demand-on-aws/)

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/c303024bd43ae305b10e95c63e6b28fa5ded6a24-1241x662.png?w=1241&q=82&fit=max&auto=format)

### Adding VOD to Amplify

We will first use amplify to add VOD by running the below command

Copied! 🐾

```
amplify video add
```

In the video I choose to add the GraphQL option, but if you would rather keep things simple you can choose these options to ignore it.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/f089b7e03df41d0fef8c57d0a62bb570ced2ffa2-2116x364.png?w=1600&q=82&fit=max&auto=format)

Now that VOD resources have been added to the project you can push them to aws.

Copied! 🐾

```
amplify push
```

You should see a similar message (depending on the changes you have made it could add api).

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/300ddb98067ffb33fb900ab4bafddd23c3d6ef6b-840x434.png?w=840&q=82&fit=max&auto=format)

Once this operation completes you should receive a message like below where your S3 buckets are listed for testing out the process. Select yes to overwrite, you will use this URL from the configuration in your React app.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/12868ee836496f3e80bf5940347ce24e2b6fdb8b-1140x378.png?w=1140&q=82&fit=max&auto=format)

## Showing Videos In React

Now that you have locations for both Livestreaming and VOD, we can update `App.js` to include a package called `video.js`.

Copied! 🐾

```
npm i video.js
```

Once this package is installed we can use it within our React app.

Copied! 🐾

```
import React from "react";
import logo from "./logo.svg";
import "./App.css";
import videojs from "video.js";
import "video.js/dist/video-js.css";
import awsvideoconfig from "./aws-video-exports";

class VideoPlayer extends React.Component {
  componentDidMount() {
    this.player = videojs(this.videoNode, this.props);
  }

  componentWillUnmount() {
    if (this.player) {
      this.player.dispose();
    }
  }

  render() {
    return (

           {
              this.videoNode = node;
            }}
            className="video-js"
          />

    );
  }
}

const videoJsOptions = {
  autoplay: true,
  controls: true,
  sources: [
    {
      src: awsvideoconfig.awsOutputLiveLL,
    },
  ],
};

const videoOnDemandJsOptions = {
  autoplay: true,
  controls: true,
  sources: [
    {
      src: https://${awsvideoconfig.awsOutputVideo}/mediaConvertTest/mediaConvertTest.m3u8,
    },
  ],
};

function App() {
  return (

  );
}

export default App;
```

Above you will notice two configruations, videoJsOptions for our Livestream and videOnDemanJsOptions for our VOD. Because I was manually uploading a test file called mediaConvertTest I hardcoded this file directly in the VOD.I have added this file to the GitHub repo for your testing as well, it is located here: `TestVideo/mediaConvertTest.mov`

## Running VOD conversion

In order to start the process of running Media Convert you will need to upload the test file to your S3 bucket it should have the word input within S3.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/d276c5986643b60d525a1c0637f03eebbb4ab7a2-1780x1198.png?w=1600&q=82&fit=max&auto=format)

It will then trigger a Lambda to start Media Convert, you can see what events are subscribed on the properties tab in S3.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/c516d66630cc3967bba87a2fe8011b171f4b21f0-3190x2138.png?w=1600&q=82&fit=max&auto=format)

This Lambda should have the [yourprojectname]-dev-inputWatcher

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/744200b114e490358596421857f4ab6661201cf3-1620x1636.png?w=1600&q=82&fit=max&auto=format)

You can see in the image above how the trigger is creating a new MediaConvert Job. Below is the full code for the Lambda.

Copied! 🐾

```
// Load the AWS SDK for Node.js
// eslint-disable-next-line import/no-extraneous-dependencies
/* eslint-disable */
const AWS = require('aws-sdk');
/* eslint-enable */
const jobSettings = require('./settings.json');
// Set the region

exports.handler = async (event) => {
  AWS.config.update({ region: event.awsRegion });
  console.log(event);
  if (event.Records[0].eventName.includes('ObjectCreated')) {
    await createJob(event.Records[0].s3);
    const response = {
      statusCode: 200,
      body: JSON.stringify(Transcoding your file: ${event.Records[0].s3.object.key}),
    };
    return response;
  }
};

// Function to submit job to Elemental MediaConvert
async function createJob(eventObject) {
  let mcClient = new AWS.MediaConvert();
  if (!AWS.config.mediaconvert) {
    try {
      const endpoints = await mcClient.describeEndpoints().promise();
      AWS.config.mediaconvert = { endpoint: endpoints.Endpoints[0].Url };
      // Override so config applies
      mcClient = new AWS.MediaConvert();
    } catch (e) {
      console.log(e);
      return;
    }
  }

  const queueParams = {
    Name: 'Default', /* required */
  };
  const AddedKey = eventObject.object.key;
  // Get the name of the file passed in the event without the extension
  const FileName = AddedKey.split('.').slice(0, -1).join('.');
  const Bucket = eventObject.bucket.name;
  const outputBucketName = process.env.OUTPUT_BUCKET;

  // Set the output to have the filename (without extension) as a folder
  jobSettings.OutputGroups[0].OutputGroupSettings.HlsGroupSettings.Destination = s3://${outputBucketName}/${FileName}/;
  jobSettings.Inputs[0].FileInput = s3://${Bucket}/${AddedKey};

  let queueARN = '';
  if (process.env.QUEUE_ARN) {
    queueARN = process.env.QUEUE_ARN;
  } else {
    const q = await mcClient.getQueue(queueParams, (err, data) => {
      if (err) console.log(err, err.stack); // an error occurred
      else console.log(data);
    }).promise();
    queueARN = q.Queue.Arn;
  }

  const jobParams = {
    JobTemplate: process.env.ARN_TEMPLATE,
    Queue: queueARN,
    UserMetadata: {},
    Role: process.env.MC_ROLE,
    Settings: jobSettings,
  };
  await mcClient.createJob(jobParams).promise();
}
```

Within Media Convert you should see a job has started, and hopefully completed.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/361bea7f4684a65d26b6aa3744f2e86f6859a8c1-2932x846.png?w=1600&q=82&fit=max&auto=format)

If you select one of those jobs you will find the input and outputs in the summary.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/f9ab9adda3bf709efb583d4d6b232ac104112152-3840x3014.png?w=1600&q=82&fit=max&auto=format)

Now you will find that exact structure in your output S3 bucket.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/4d26f60e8dfd829dcf8b483ae65f788ded5d609e-1182x918.png?w=1182&q=82&fit=max&auto=format)

If you open that "folder" you can see that there are several files listed that the conversion created.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/113bb5ce2309fd12cdcbe6c543f2cb16d716121e-1470x1132.png?w=1470&q=82&fit=max&auto=format)

The URL to the top one is what we will be using for the example.

### Showing VOD

Now that you have a VOD file in S3 you will view this file being served through Cloud Front which is Amazon's Global CDN. The URL can be found in `src/aws-video-exports.js`. With the full solution in the App.js file for React you will now see the VOD file playing (you may need to refresh).

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/cce54180e4f9637707893fa85b259effff52d0df-1970x598.png?w=1600&q=82&fit=max&auto=format)

## Final Thoughts

I have a message out to the labs team on GitHub about the next triggers. I believe what they are trying to accomplish next is to take the Lambda form the output file and store all of the meta-data into DynamoDB which can then be served through our GraphQL API. I know this is for sure possible and if I don't hear back I will implement my own for the full app. So far this beta version is really awesome though!

## Resources, Links & Official Documentation

- **Watch on YouTube: ** [AWS Amplify Video Full Video](https://www.youtube.com/watch?v=vM_YoZbLQQ0) (plus [Subscribe to CodingCat.dev](https://www.youtube.com/@CodingCatDev?sub_confirmation=1))
- [**AWS Documentation & Builder Center:**](https://docs.aws.amazon.com/) Cloud architecture, serverless compute, IAM, and managed services
- [**React Official Reference:**](https://react.dev/reference/react) Hooks, Server Components, and UI state patterns
- [**GitHub Documentation:**](https://docs.github.com/) Pull requests, GitHub Actions CI/CD, and repository security

## Related CodingCat.dev Tutorials & Podcast Episodes

- [**Next.js Amplified: Full-Stack Web Apps on AWS Amplify Gen2**](/podcast/cwcc-1-2-aws-amplify): AWS Amplify using Gen2, a code first approach
- [**AWS Amplify vs. AWS CDK What is the most powerful AWS IaC in 2020?**](/post/aws-amplify-vs-aws-cdk-2020): AWS Amplify vs. AWS CDK. So you are just getting started with your next project and can't figure out what IaC to start with, lets compare two of AWS's most popu...
- [**AWS Amplify with Nader Dabit**](/podcast/0-10-amplify-with-nader-dabit): Talking with Nader Dabit all about AWS Amplify. How AWS Amplify fits into your web development process.

## Frequently Asked Questions (FAQ)

### What are the main takeaways from AWS Amplify Video?

How to easily add Video for Livestreaming or Video on Demand to your next Amplify project. AWS Amplify Video Livestreaming and Video on Demand: You can find the full tutorial https://codingcat.dev/tutorial/aws-amplify-video ***AWS Account is required for this lesson. You may (and probably will) incur fees associated with these activities. Livestreaming is VERY expensive so be careful!*** How to easily add Video for Livestreaming or Video, welcome back perfect peeps today we're going to be talking about aws amplify and adding videos for both live streaming and video on demand let's get going in order to get started using aws you will have to sign up this includes a 12 month free trial now what it doesn't include is unlimited processing so there could be charges involved with the course if you do a lot of video processing so one of t... Throughout this post, Alex Patterson breaks down real-world implementation details for AWS, React, GitHub so developers can apply these patterns directly in production.

### How do you implement AWS best practices in production?

When adopting AWS and React in a production stack, start by validating your configuration against the [**AWS Documentation & Builder Center**](https://docs.aws.amazon.com/) (Cloud architecture, serverless compute, IAM, and managed services). Focus on incremental adoption, automated testing, and observability so your team can measure performance and developer velocity improvements at each stage.

### Where can I watch the full AWS Amplify Video walkthrough and find related code resources?

You can watch the complete video session for [**AWS Amplify Video**](https://www.youtube.com/watch?v=vM_YoZbLQQ0) on the [**CodingCat.dev YouTube channel**](https://www.youtube.com/@CodingCatDev?sub_confirmation=1). For a deeper dive into AWS, check out our related guide: [**Next.js Amplified: Full-Stack Web Apps on AWS Amplify Gen2**](/podcast/cwcc-1-2-aws-amplify).

## ✏️ Video Summary

AWS Amplify Video Livestreaming and Video on Demand: You can find the full tutorial https://codingcat.dev/tutorial/aws-amplify-video

***AWS Account is required for this lesson. You may (and probably will) incur fees associated with these activities. Livestreaming is VERY expensive so be careful!***

How to easily add Video for Livestreaming or Video — welcome back perfect peeps today we're going to be talking about aws amplify and adding videos for both live streaming and video on demand let's get going in order to get started using aws you will have to sign up this includes a 12 month free trial now what it doesn't include is unlimited processing so there could be charges involved with the course if you do a lot of video processing so one of t...

✏️ Visual Architecture Diagram

## how this post connects together.

Follow AJ through the pipeline topology from input contract to production output.

Let’s build it!✏️ Architecture Diagram: AWS Amplify VideoDATAFLOW PIPELINEARCHITECTURE DIAGRAM[Diagram Walkthrough]Content-driven pipeline diagram for AWS Amplify Video: AWS Amplify Video -> System Implementation -> Edge Delivery & Telemetry.AAA Contrast Verified

## related deep dives.

[All Blog Posts&rarr;](/blog)[![The Odin Project 6: Modern React 19, State Architecture & TypeScript](https://cdn.sanity.io/images/hfh83o0w/production/1a3aad1e42061d9c384f723cdec562e1aa2afd24-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/odin-modern-react-and-typescript)November 4, 2026[![](/logos/tags/react-symbol-light.svg)![](/logos/tags/react-symbol-dark.svg)React](/topic/react)[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)[![](/logos/tags/astro-symbol-light.svg)![](/logos/tags/astro-symbol-dark.svg)Astro](/topic/astro)[+1](/course/odin-modern-react-and-typescript)

### [The Odin Project 6: Modern React 19, State Architecture & TypeScript](/course/odin-modern-react-and-typescript)

Master React 19 components, strict TypeScript props, derived state vs. useEffect traps, Server Actions, and island hydration in Astro.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[![Sanity Knowledge Bases](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/38b0f021c51d97043c8a1ebf31d505a0ea877b7c-2752x1536.jpg?w=1920&q=82&fit=max&auto=format)](/post/sanity-knowledge-bases)October 17, 2026[![](/logos/tags/mcp-symbol-light.svg)![](/logos/tags/mcp-symbol-dark.svg)MCP](/topic/mcp)[#AI & Agents](/topic/ai)[![](/logos/sanity/Sanity-Symbol--black_on_transparent.svg)![](/logos/sanity/Sanity-Symbol--white_on_transparent.svg)Sanity](/topic/sanity)[+5](/post/sanity-knowledge-bases)

### [Sanity Knowledge Bases](/post/sanity-knowledge-bases)

Eliminate query-time guessing in your AI agents. Learn how Sanity Context Knowledge Bases compile structured datasets, crawled documentation websites, and uploaded files ahead of time, resolve conflicting facts, and serve a compact outline over Context MCP.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)