package main
import(
livepeergo "github.com/livepeer/livepeer-go"
"github.com/livepeer/livepeer-go/models/components"
"context"
"log"
)
func main() {
client := livepeergo.New(
livepeergo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
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,
},
},
}
ctx := context.Background()
res, err := client.Transcode.Create(ctx, params)
if err != nil {
log.Fatal(err)
}
if res.Task != nil {
// handle response
}
}