package main
import (
"fmt"
"github.com/livepeer/livepeer-go-sdk"
)
func main() {
apiKey := "$API_KEY"
client := livepeer.NewClient(apiKey)
params := map[string]interface{}{
"input": map[string]string{
"url": "$INPUT_VIDEO_URL",
},
"storage": map[string]interface{}{
"type": "web3.storage",
"credentials": map[string]string{
"proof": "$DELEGATION_PROOF",
},
},
"outputs": map[string]map[string]string{
"hls": {
"path": "/",
},
"mp4": {
"path": "/",
},
},
"profiles": []map[string]interface{}{
{
"name": "480p",
"bitrate": 1000000,
"fps": 30,
"width": 854,
"height": 480,
},
{
"name": "360p",
"bitrate": 500000,
"fps": 30,
"width": 640,
"height": 360,
},
},
}
sent, err := client.Transcode(params)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(sent.Id)
}