How to mint a video NFT using Livepeer Video Services + Polygon
Published: 2022-04-11 22:17:58


The concept of NFTs has been around since the 2014s but it wasn't until 2017 that projects like [CryptoKitties](https://www.cryptokitties.co/) and [CryptoPunks](https://www.larvalabs.com/cryptopunks) started to create traction for NFTs. Jumping to 2021, NFTs took off like wildfire. They started being referenced in pop culture, mainstream media, and they influenced the concepts that many hackathon projects were based on.

The technology for creating NFTs has come a long way and is now more accessible to developers and non-developers alike. Along with the creation of NFT marketplaces such as [OpenSea ](https://opensea.io/)and [Rarible](https://rarible.com/), anyone can mint their own NFTs and sell them.

When minting video NFTs, a major factor to consider is the file size. Livepeer Video Services solves this issue when using the [Video NFT SDK](https://www.npmjs.com/package/@livepeer/video-nft). This SDK will transcode the video to the proper file size utilizing the [Livepeer Network](https://livepeer.org/) as well as leveraging the layer 2 solutions of [Polygon](https://polygon.technology/) to reduce the cost of transactions on the Ethereum blockchain. Using the SDK makes it easy and more affordable to create video NFTs.

In this tutorial, we will utilize Livepeer Video Services' [Mint a Video NFT](https://github.com/livepeer/video-nft) tool to create our own NFT that can play a video.
Before we get started, here is a checklist of items required for this tutorial. Instructions on how to get and install these items will be provided in the steps that follow.

**Checklist**
☑️ Sign up for a free account at [Livepeer Video Services](https://livepeer.com/register) to create an API key
☑️ [Jellyfish Video](https://www.pexels.com/video/group-of-jellyfish-swimming-underwater-5613843/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels)
*This is an example video that will be used, there are other free videos available at [Pexels](https://www.pexels.com/videos/).
☑️ Sign up for a free [Metamask](https://metamask.io/download/) account
☑️ Add Polygon Mumbai testnet to Metamask wallet
☑️ Get Polygon test [MATIC](https://faucet.polygon.technology/)
☑️ Install [Video NFT](https://livepeer.com/docs/guides/video-nft)


**Installation process**

**Step 1:** Signup for a free account at [Livepeer Video Services](https://livepeer.com/) and create an API key

*If you need a step-by-step process for getting a free account and the API key, visit the How to make API calls with Postman tutorial.

**Step 2:** Get a video to mint as an NFT

For this example, we will use this video: [Jellyfish Video](https://www.pexels.com/video/group-of-jellyfish-swimming-underwater-5613843/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels)

*You can also find another video using [Pexels](https://www.pexels.com/videos/) or use provide one of your own. If you do use one of your own, make sure it is in a .mp4 format.


**Step 3:** Install Metamask (if you do not already have one)

- 
Go to [Metamask](https://metamask.io/download/) and download the browser extension. For this tutorial, we will use the Chrome version, but a Firefox version is also available.


![Metamask Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iw1yr9ry5yyhuvf34rkm.png)


![Metamask Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wu8hhqu8uotxlduugy4h.png)

- Once downloaded, you should see the Metamask logo in the extension menu


![Metamask Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9u3jnawovt7i3q6oky94.png)

- Next, set up your Metamask wallet - [Polygon](https://docs.polygon.technology/docs/develop/metamask/hello/) has a great tutorial on how to do this

**Step 4:** Configuring Polygon network for Metamask


- We need to configure the Polygon network to the Metamask wallet. For this tutorial, we will use the Polygon testnet called [Mumbai](https://docs.polygon.technology/docs/develop/metamask/config-polygon-on-metamask), but they also have the [Polygon mainnet](https://docs.polygon.technology/docs/develop/metamask/config-polygon-on-metamask) configuration as well.

**Step 5:** Getting MATIC for testing

- Minting NFTs has a gas fee associated with it, so we need to add funds to our wallet. Since we are using the Mumbai testnet, we will need to get some [test MATIC tokens](https://faucet.polygon.technology/). If you are using Polygon's mainnet, you can find the [MATIC faucet](https://matic.supply/) here.

![Polygon Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dz2eyir30uxbn4rwimx8.png)


- Make sure the Mumbai tab is selected
- Paste in your wallet address and you should receive some test MATIC token


![Polygon Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbpfkg888n1uwdsdgvfe.png)


- Click the submit button and a confirmation window should pop up


![Polygon Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldhhnhzj4pltpqw5ncro.png)

- Click confirm and a message should appear stating the transaction went through


![Polygon Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkx4jlpoxee5czf2zs08.png)

- Your wallet should be funded with some test MATIC tokens


![Polygon Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ul621a0zs4ru5md8fih2.png)

**Step 6:** Installing the mint Video-NFT

_*If you want to have video-nft available as a command on your machine, you can also install the CLI persistently with `npm i -g @livepeer/video-nft`, and after that just call video-nft from anywhere to run it._


- Create a new directory with the command
`mkdir VideoNFT` 


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cetptje9mqfubzcll6u7.png)

- Change into that directory using
`cd VideoNFT `


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o8ouxtmx3ybokvrknxus.png)

- Move the video from **Step 2** into this directory
- The file should be in this directory, use the ls command to view it

`ls`


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uz3ipfwtjc71451xfvgz.png)

- Run Livepeer Video Services Video NFT using

`npx @livepeer/video-nft`



![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8rrahhirntx1zzvj5f4.png)


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyt5qvs9nu6ht4tecz62.png)


- Copy and paste the API key that you got from **Step 1**



![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sc5tc6rp824rxtt08lu3.png)


- Type in the name of the video file, for this example, it is _jellyfish.mp4_


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3u5rk1kkxo33kl95xwlb.png)



- Provide the name you want to give the NFT, you can use the file name to name the NFT but in this example, we will use _JellyFish_



![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qkteqms3vgie17ur00t.png)



![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8hiudqra1svxc400n6k.png)

- In this example we will not customize our metadata so select no for customizing the metadata for the NFT


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x22uizl3vcby13ykyc45.png)

- A message should appear that states the export is successful along with the metadata and our URL for minting


![Image of terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kcgrc6o5fuwzgop45jaz.png)

- Copy the URL in **Step 3** for the next step

**Step 7:** Minting the video NFT

- Copy and paste the URL from the previous step into a browser window
- A Livepeer Video Services site should appear with a Mint a Video NFT pop up


![LVS minting dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otsckd8vd1fjb91bp6sw.png)

- Click the **Connect to Metamask** button
- Metamask browser extension should open and ask the account to connect to
- Select the account with the funded testnet MATIC and connect it


![Metamask extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ss1501dxvabkjleu9lla.png)

- Once connected, the pop up should have the **ContractAddress** and the message box should state that you are connected to the Polygon Testnet

![LVS minting dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jfj9i4j0lhul5zpdj6hs.png)


- Click the **Mint NFT** button


![LVS minting dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gwepyia6sju0kf5hvf6.png)

- Metamask browser extension should open and ask to confirm the transaction fee


![Metamask extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zl2xejpfvfz8k1husgy.png)

- Click the **Confirm** button
- You should see the minting in progress in the message field


![LVS minting dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vz8kcerm2x6xp9tiwwa.png)

- Once the minting is completed, it should provide a link to OpenSea testnet where you can view your Video NFT! For example:

_[https://testnets.opensea.io/assets/mumbai/0xA4E1d8FE768d471B048F9d73ff90ED8fcCC03643/56](https://testnets.opensea.io/assets/mumbai/0xA4E1d8FE768d471B048F9d73ff90ED8fcCC03643/56)_


![LVS minting dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2w9c8lpx9l3yl1vztntq.png)


![Image of NFT](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxbi9vnf2681m0t8upwe.png)


Congratulations! You have minted a video NFT using Livepeer Video Services' [Video NFT SDK](https://www.npmjs.com/package/@livepeer/video-nft).

Using the SDK is a great way to get started with being able to upload video NFTs. If you want to upload videos and do not want to mint NFTS, Livepeer Video Services also has Video on Demand where you can do just that.

[Check out Video On Demand](https://livepeer.com/docs/api-reference/vod)