Transcode with W3S
This guide will describe how to use the Livepeer transcode API to transcode and store video files in web3.storage.
The playback of long videos (longer than 1h) stored in Web3 Storage can be slow due to the W3 Link issue tracked here.
Also, there are code examples provided for reference.
UCAN Proof
This step assumes that you have w3 CLI installed. Follow the Getting Started instructions to create new space for storing data and register the space.
Get Livepeer Studio DID.
The response should contain the Livepeer Studio DID.
Create a UCAN delegation.
This returns the base64-encoded delegation proof which authorizes the Livepeer Studio DID to store data to your space. Note that the proof should not contain any whitespaces.
Upload Video to web3.storage
Make sure you have a video file uploaded to web3.storage. You can do upload a
file using the w3 up
command by following
these instructions.
Transcode with Livepeer
This step assumes that you have already created a Livepeer Studio account and an API key.
Submit the following request:
The parameters are defined as:
$API_KEY
is your Livepeer Studio API key$DELEGATION_PROOF
is the delegation proof you created usingw3
input.url
is the URL of the video you would like to transcodeoutputs.hls.path
is the relative path that the HLS playlist and mpegts segments is found in when transcoding is completeoutputs.mp4.path
is the path that the MP4 video files is found in when transcoding is completeprofiles
is an optional parameter to specify the desired properties of transcoded video
Use the task ID in the response to query for the transcoding task status. Once
the task is complete, you’ll see the output directory IPFS URL in the
/api/task
response in the output.transcodeFile.baseUrl
field.
For more information about transcode API usage refer to the API reference docs.
Code Examples
Was this page helpful?