This tutorial will help guide users through uploading and minting a video as an NFT using Livepeer Video Services.
Click to expand
Livepeer is a decentralized video transcoding platform.
Livepeer Video Services makes adding video streaming features into your web3 apps easy. It can handle live streams or video files.
- π Node. js installed on your computer π»
node >=10.0.0oryarn >=1.0.0 - [Yarn]
- πΉ Have a
.mp4video file to mint πΏ - π¦ Metamask wallet π
- Have
Polygon/Mumbai TestnetANDMATICin your Metamask.
Get an API key from Livepeer here
Click Create API Key
Enter the name for your API key and then Click Create.
The page should look like this when you create the API key:
Navigate to a folder π where your video file π₯ is located
- Example:
livepeer.mp4
Run the following command in your terminal or command prompt to install the Livepeer CLI (Command Line Interface):
npm install -g @livepeer/video-nftRun the following command in your terminal: video-nft.
-
Enter your
Livepeer API key. -
Enter the name of the
.mp4file you want to use -
Name you want to give to your NFT
-
Optionally customize the metadata for your
video NFTby hittingYorN.
Once your video has successfully uploaded, you will get an object with fields, including your IPFS hash containing your metadata:
{
"videoFileCid": "QmRNZBCDtuBcvmX1W8U3M9xuEqRYLv6P7mNw8m1v1b91Wt",
"nftMetadataCid": "QmYwabdPZDpcdQf2indzCSWhko8fPvKRAWXoFm5Ka1JB31",
"videoFileUrl": "ipfs://QmRNZBCDtuBcvmX1W8U3M9xuEqRYLv6P7mNw8m1v1b91Wt",
"videoFileGatewayUrl": "https://ipfs.livepeer.com/ipfs/QmRNZBCDtuBcvmX1W8U3M9xuEqRYLv6P7mNw8m1v1b91Wt",
"nftMetadataUrl": "ipfs://QmYwabdPZDpcdQf2indzCSWhko8fPvKRAWXoFm5Ka1JB31",
"nftMetadataGatewayUrl": "https://ipfs.livepeer.com/ipfs/QmYwabdPZDpcdQf2indzCSWhko8fPvKRAWXoFm5Ka1JB31"
}The last line after the successful upload provides a URL like this:
https://livepeer.com/mint-nft?tokenUri=ipfs://QmYwabdPZDpcdQf2indzCSWhko8fPvKRAWXoFm5Ka1JB31
You can pass in your custom ERC721 contract address or use the contract provided by Livepeer.
Click Connect to Metamask button

Choose either Polygon Testnet or Polygon Mainnet.
Only Polygon network is supported right now.
Prerequisite:
- Be sure to have your
Metamasknetwork configured to thePolygon TestnetorPolygon Mainnet.
If you click on the button Polygon Testnet or Polygon Mainnet, it should configure your metamask to add and change your network.
- Be sure to have some Matic Token in your
Metamaskwallet
Polygon faucet can be found at https://matic.supply.
Make sure your Metamask or web 3.0 wallet is connected to the Polygon blockchain.
If you need some Testnet Matic, go to this URL https://faucet.polygon.technology/.
- After navigating to the URL provided, you can leave the contract field blank and default to Livepeer's contract.
- Hit
"Mint NFT"
You'll have to confirm the transaction and pay for the gas in Metamask.
You just minted your nft!
Click on the link Check it out on OpenSea to view your video NFT.
You can view the video nft from this tutorial rignt here
To view the metadata for this NFT, copy the IPFS hash provided to you in the terminal after uploading your video.
You can take this hash and navigate to https://ipfs.io/ipfs/your-ipfs-hash-here
Example: https://ipfs.io/ipfs/QmYwabdPZDpcdQf2indzCSWhko8fPvKRAWXoFm5Ka1JB31
Lets build a video uploader that uses the sdk that you can upload your video using livepeer
- π Node. js installed on your computer π»
node >=10.0.0oryarn >=1.0.0
Create a folder called video-nft-server
mkdir video-nft-serverNext run these commands:
cd video-nft-server
npm init or
cd video-nft-server
yarn init- Install the following npm packages to your package.json
npm install --save @livepeer/video-nft cors dotenv express multeror
yarn add @livepeer/video-nft cors dotenv express multermkdir uploads















