import { Livepeer } from "livepeer";
const apiKey = "YOUR_API_KEY"
const livepeer = new Livepeer({apiKey});
livepeer.transcode({
input: {
url: "$INPUT_VIDEO_URL",
},
storage: {
type: "web3.storage",
credentials: {
proof: "$DELEGATION_PROOF",
},
},
outputs: {
hls: {
path: "/",
},
mp4: {
path: "/",
},
},
profiles: [
{
name: "480p",
bitrate: 1000000,
fps: 30,
width: 854,
height: 480,
},
{
name: "360p",
bitrate: 500000,
fps: 30,
width: 640,
height: 360,
},
],
}).then((video) => {
console.log(video);
}).catch((error) => {
console.error(error);
});