How to mint a video NFT using Livepeer Video Services + Polygon

The concept of NFTs has been around since the 2014s but it wasn’t until 2017 that projects like CryptoKitties and 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 and Rarible, 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. This SDK will transcode the video to the proper file size utilizing the Livepeer Network as well as leveraging the layer 2 solutions of Polygon 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 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

Installation process

Step 1: Signup for a free account at Livepeer Video Services 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 You can also find another video using Pexels 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 and download the browser extension. For this tutorial, we will use the Chrome version, but a Firefox version is also available.

VideoNFT1.png

VideoNFT2.png

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

VideoNFT3.png

  • Next, set up your Metamask wallet — Polygon 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, but they also have the Polygon mainnet 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. If you are using Polygon’s mainnet, you can find the MATIC faucet here.

VideoNFT4.png

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

VideoNFT5.png

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

VideoNFT6.png

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

VideoNFT7.png

  • Your wallet should be funded with some test MATIC tokens

VideoNFT8.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

VideoNFT9.png

  • Change into that directory using the cd VideoNFT command

VideoNFT10.png

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

VideoNFT11.png

  • Run Livepeer Video Services Video NFT using the npx @livepeer/video-nft command

VideoNFT12.png

VideoNFT15.png

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

VideoNFT16.png

  • Type in the name of the video file, for this example, it is jellyfish.mp4

VideoNFT17.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

VideoNFT18.png

VideoNFT19.png

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

VideoNFT20.png

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

VideoNFT21.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

VideoNFT22.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

VideoNFT23small.png

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

VideoNFT25.png

  • Click the Mint NFT button

VideoNFT26.png

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

Asset 1.png

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

VideoNFT28.png

VideoNFT29.png

VideoNFT30.png

Congratulations! You have minted a video NFT using Livepeer Video Services Video NFT.

Using the Video NFT 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