import { Livepeer } from "livepeer";
import { TranscodeProfileEncoder, TranscodeProfileProfile, Type } from "livepeer/models/components";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.asset.create({
name: "filename.mp4",
staticMp4: true,
playbackPolicy: {
type: Type.Webhook,
webhookId: "1bde4o2i6xycudoy",
webhookContext: {
"streamerId": "my-custom-id",
},
refreshInterval: 600,
},
profiles: [
{
width: 1280,
name: "720p",
height: 720,
bitrate: 3000000,
quality: 23,
fps: 30,
fpsDen: 1,
gop: "2",
profile: TranscodeProfileProfile.H264Baseline,
encoder: TranscodeProfileEncoder.H264,
},
],
});
// Handle the result
console.log(result);
}
run();package main
import(
livepeergo "github.com/livepeer/livepeer-go"
"context"
"github.com/livepeer/livepeer-go/models/components"
"log"
)
func main() {
s := livepeergo.New(
livepeergo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Asset.Create(ctx, components.NewAssetPayload{
Name: "filename.mp4",
StaticMp4: livepeergo.Bool(true),
PlaybackPolicy: &components.PlaybackPolicy{
Type: components.TypeWebhook,
WebhookID: livepeergo.String("1bde4o2i6xycudoy"),
WebhookContext: map[string]any{
"streamerId": "my-custom-id",
},
RefreshInterval: livepeergo.Float64(600),
},
Profiles: []components.TranscodeProfile{
components.TranscodeProfile{
Width: livepeergo.Int64(1280),
Name: livepeergo.String("720p"),
Height: livepeergo.Int64(720),
Bitrate: 3000000,
Quality: livepeergo.Int64(23),
Fps: livepeergo.Int64(30),
FpsDen: livepeergo.Int64(1),
Gop: livepeergo.String("2"),
Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),
Encoder: components.TranscodeProfileEncoderH264.ToPointer(),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Data != nil {
// handle response
}
}from livepeer import Livepeer
from livepeer.models import components
s = Livepeer(
api_key="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.asset.create(request={
"name": "filename.mp4",
"static_mp4": True,
"playback_policy": {
"type": components.Type.WEBHOOK,
"webhook_id": "1bde4o2i6xycudoy",
"webhook_context": {
"streamerId": "my-custom-id",
},
"refresh_interval": 600,
},
"profiles": [
{
"width": 1280,
"name": "720p",
"height": 720,
"bitrate": 3000000,
"quality": 23,
"fps": 30,
"fps_den": 1,
"gop": "2",
"profile": components.TranscodeProfileProfile.H264_BASELINE,
"encoder": components.TranscodeProfileEncoder.H_264,
},
],
})
if res.data is not None:
# handle response
passcurl --request POST \
--url https://livepeer.studio/api/asset/request-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "filename.mp4",
"staticMp4": true,
"playbackPolicy": {
"type": "webhook",
"webhookId": "1bde4o2i6xycudoy",
"webhookContext": {
"streamerId": "my-custom-id"
},
"refreshInterval": 600,
"allowedOrigins": [
"<string>"
]
},
"creatorId": {
"type": "unverified",
"value": "<string>"
},
"storage": {
"ipfs": {
"spec": "<unknown>"
}
},
"c2pa": true,
"profiles": [
{
"bitrate": 3000000,
"width": 1280,
"name": "720p",
"height": 720,
"quality": 23,
"fps": 30,
"fpsDen": 1,
"gop": 2,
"profile": "H264Baseline",
"encoder": "H.264"
}
],
"targetSegmentSizeSecs": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'filename.mp4',
staticMp4: true,
playbackPolicy: {
type: 'webhook',
webhookId: '1bde4o2i6xycudoy',
webhookContext: {streamerId: 'my-custom-id'},
refreshInterval: 600,
allowedOrigins: ['<string>']
},
creatorId: {type: 'unverified', value: '<string>'},
storage: {ipfs: {spec: '<unknown>'}},
c2pa: true,
profiles: [
{
bitrate: 3000000,
width: 1280,
name: '720p',
height: 720,
quality: 23,
fps: 30,
fpsDen: 1,
gop: 2,
profile: 'H264Baseline',
encoder: 'H.264'
}
],
targetSegmentSizeSecs: 123
})
};
fetch('https://livepeer.studio/api/asset/request-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://livepeer.studio/api/asset/request-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'filename.mp4',
'staticMp4' => true,
'playbackPolicy' => [
'type' => 'webhook',
'webhookId' => '1bde4o2i6xycudoy',
'webhookContext' => [
'streamerId' => 'my-custom-id'
],
'refreshInterval' => 600,
'allowedOrigins' => [
'<string>'
]
],
'creatorId' => [
'type' => 'unverified',
'value' => '<string>'
],
'storage' => [
'ipfs' => [
'spec' => '<unknown>'
]
],
'c2pa' => true,
'profiles' => [
[
'bitrate' => 3000000,
'width' => 1280,
'name' => '720p',
'height' => 720,
'quality' => 23,
'fps' => 30,
'fpsDen' => 1,
'gop' => 2,
'profile' => 'H264Baseline',
'encoder' => 'H.264'
]
],
'targetSegmentSizeSecs' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://livepeer.studio/api/asset/request-upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"filename.mp4\",\n \"staticMp4\": true,\n \"playbackPolicy\": {\n \"type\": \"webhook\",\n \"webhookId\": \"1bde4o2i6xycudoy\",\n \"webhookContext\": {\n \"streamerId\": \"my-custom-id\"\n },\n \"refreshInterval\": 600,\n \"allowedOrigins\": [\n \"<string>\"\n ]\n },\n \"creatorId\": {\n \"type\": \"unverified\",\n \"value\": \"<string>\"\n },\n \"storage\": {\n \"ipfs\": {\n \"spec\": \"<unknown>\"\n }\n },\n \"c2pa\": true,\n \"profiles\": [\n {\n \"bitrate\": 3000000,\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"quality\": 23,\n \"fps\": 30,\n \"fpsDen\": 1,\n \"gop\": 2,\n \"profile\": \"H264Baseline\",\n \"encoder\": \"H.264\"\n }\n ],\n \"targetSegmentSizeSecs\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://livepeer.studio/api/asset/request-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"filename.mp4\",\n \"staticMp4\": true,\n \"playbackPolicy\": {\n \"type\": \"webhook\",\n \"webhookId\": \"1bde4o2i6xycudoy\",\n \"webhookContext\": {\n \"streamerId\": \"my-custom-id\"\n },\n \"refreshInterval\": 600,\n \"allowedOrigins\": [\n \"<string>\"\n ]\n },\n \"creatorId\": {\n \"type\": \"unverified\",\n \"value\": \"<string>\"\n },\n \"storage\": {\n \"ipfs\": {\n \"spec\": \"<unknown>\"\n }\n },\n \"c2pa\": true,\n \"profiles\": [\n {\n \"bitrate\": 3000000,\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"quality\": 23,\n \"fps\": 30,\n \"fpsDen\": 1,\n \"gop\": 2,\n \"profile\": \"H264Baseline\",\n \"encoder\": \"H.264\"\n }\n ],\n \"targetSegmentSizeSecs\": 123\n}"
response = http.request(request)
puts response.read_body{
"url": "https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q",
"tusEndpoint": "https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q",
"asset": {
"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"source": {
"type": "url",
"url": "<string>",
"gatewayUrl": "<string>",
"encryption": "<unknown>"
},
"name": "filename.mp4",
"type": "video",
"playbackId": "eaw4nk06ts2d0mzb",
"userId": "66E2161C-7670-4D05-B71D-DA2D6979556F",
"playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8",
"downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4",
"playbackPolicy": {
"type": "webhook",
"webhookId": "1bde4o2i6xycudoy",
"webhookContext": {
"streamerId": "my-custom-id"
},
"refreshInterval": 600,
"allowedOrigins": [
"<string>"
]
},
"creatorId": {
"type": "unverified",
"value": "user123"
},
"profiles": [
{
"bitrate": 3000000,
"width": 1280,
"name": "720p",
"height": 720,
"quality": 23,
"fps": 30,
"fpsDen": 1,
"gop": 2,
"profile": "H264Baseline",
"encoder": "H.264"
}
],
"storage": {
"ipfs": {
"spec": {},
"nftMetadata": {
"cid": "<string>",
"url": "<string>",
"gatewayUrl": "<string>"
},
"updatedAt": 1587667174725
},
"status": {
"phase": "ready",
"tasks": {
"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"last": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"
},
"progress": 0.5,
"errorMessage": "Failed to update storage"
}
},
"status": {
"updatedAt": 1587667174725,
"progress": 123,
"errorMessage": "<string>"
},
"projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
"createdAt": 1587667174725,
"createdByTokenName": "<string>",
"size": 84934509,
"hash": [
{
"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57",
"algorithm": "sha256"
}
],
"videoSpec": {
"format": "mp4",
"duration": 23.8328,
"bitrate": 1000000,
"tracks": [
{
"type": "video",
"codec": "aac",
"startTime": 23.8238,
"duration": 23.8238,
"bitrate": 1000000,
"width": 1920,
"height": 1080,
"pixelFormat": "yuv420p",
"fps": 30,
"channels": 2,
"sampleRate": 44100,
"bitDepth": 16
}
]
}
},
"task": {
"id": "34d7618e-fd42-4798-acf5-19504616a11e"
}
}{
"errors": [
[
"id not provided",
"Account not found"
]
]
}Upload an asset
Upload a video or audio asset
import { Livepeer } from "livepeer";
import { TranscodeProfileEncoder, TranscodeProfileProfile, Type } from "livepeer/models/components";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.asset.create({
name: "filename.mp4",
staticMp4: true,
playbackPolicy: {
type: Type.Webhook,
webhookId: "1bde4o2i6xycudoy",
webhookContext: {
"streamerId": "my-custom-id",
},
refreshInterval: 600,
},
profiles: [
{
width: 1280,
name: "720p",
height: 720,
bitrate: 3000000,
quality: 23,
fps: 30,
fpsDen: 1,
gop: "2",
profile: TranscodeProfileProfile.H264Baseline,
encoder: TranscodeProfileEncoder.H264,
},
],
});
// Handle the result
console.log(result);
}
run();package main
import(
livepeergo "github.com/livepeer/livepeer-go"
"context"
"github.com/livepeer/livepeer-go/models/components"
"log"
)
func main() {
s := livepeergo.New(
livepeergo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Asset.Create(ctx, components.NewAssetPayload{
Name: "filename.mp4",
StaticMp4: livepeergo.Bool(true),
PlaybackPolicy: &components.PlaybackPolicy{
Type: components.TypeWebhook,
WebhookID: livepeergo.String("1bde4o2i6xycudoy"),
WebhookContext: map[string]any{
"streamerId": "my-custom-id",
},
RefreshInterval: livepeergo.Float64(600),
},
Profiles: []components.TranscodeProfile{
components.TranscodeProfile{
Width: livepeergo.Int64(1280),
Name: livepeergo.String("720p"),
Height: livepeergo.Int64(720),
Bitrate: 3000000,
Quality: livepeergo.Int64(23),
Fps: livepeergo.Int64(30),
FpsDen: livepeergo.Int64(1),
Gop: livepeergo.String("2"),
Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),
Encoder: components.TranscodeProfileEncoderH264.ToPointer(),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Data != nil {
// handle response
}
}from livepeer import Livepeer
from livepeer.models import components
s = Livepeer(
api_key="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.asset.create(request={
"name": "filename.mp4",
"static_mp4": True,
"playback_policy": {
"type": components.Type.WEBHOOK,
"webhook_id": "1bde4o2i6xycudoy",
"webhook_context": {
"streamerId": "my-custom-id",
},
"refresh_interval": 600,
},
"profiles": [
{
"width": 1280,
"name": "720p",
"height": 720,
"bitrate": 3000000,
"quality": 23,
"fps": 30,
"fps_den": 1,
"gop": "2",
"profile": components.TranscodeProfileProfile.H264_BASELINE,
"encoder": components.TranscodeProfileEncoder.H_264,
},
],
})
if res.data is not None:
# handle response
passcurl --request POST \
--url https://livepeer.studio/api/asset/request-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "filename.mp4",
"staticMp4": true,
"playbackPolicy": {
"type": "webhook",
"webhookId": "1bde4o2i6xycudoy",
"webhookContext": {
"streamerId": "my-custom-id"
},
"refreshInterval": 600,
"allowedOrigins": [
"<string>"
]
},
"creatorId": {
"type": "unverified",
"value": "<string>"
},
"storage": {
"ipfs": {
"spec": "<unknown>"
}
},
"c2pa": true,
"profiles": [
{
"bitrate": 3000000,
"width": 1280,
"name": "720p",
"height": 720,
"quality": 23,
"fps": 30,
"fpsDen": 1,
"gop": 2,
"profile": "H264Baseline",
"encoder": "H.264"
}
],
"targetSegmentSizeSecs": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'filename.mp4',
staticMp4: true,
playbackPolicy: {
type: 'webhook',
webhookId: '1bde4o2i6xycudoy',
webhookContext: {streamerId: 'my-custom-id'},
refreshInterval: 600,
allowedOrigins: ['<string>']
},
creatorId: {type: 'unverified', value: '<string>'},
storage: {ipfs: {spec: '<unknown>'}},
c2pa: true,
profiles: [
{
bitrate: 3000000,
width: 1280,
name: '720p',
height: 720,
quality: 23,
fps: 30,
fpsDen: 1,
gop: 2,
profile: 'H264Baseline',
encoder: 'H.264'
}
],
targetSegmentSizeSecs: 123
})
};
fetch('https://livepeer.studio/api/asset/request-upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://livepeer.studio/api/asset/request-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'filename.mp4',
'staticMp4' => true,
'playbackPolicy' => [
'type' => 'webhook',
'webhookId' => '1bde4o2i6xycudoy',
'webhookContext' => [
'streamerId' => 'my-custom-id'
],
'refreshInterval' => 600,
'allowedOrigins' => [
'<string>'
]
],
'creatorId' => [
'type' => 'unverified',
'value' => '<string>'
],
'storage' => [
'ipfs' => [
'spec' => '<unknown>'
]
],
'c2pa' => true,
'profiles' => [
[
'bitrate' => 3000000,
'width' => 1280,
'name' => '720p',
'height' => 720,
'quality' => 23,
'fps' => 30,
'fpsDen' => 1,
'gop' => 2,
'profile' => 'H264Baseline',
'encoder' => 'H.264'
]
],
'targetSegmentSizeSecs' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://livepeer.studio/api/asset/request-upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"filename.mp4\",\n \"staticMp4\": true,\n \"playbackPolicy\": {\n \"type\": \"webhook\",\n \"webhookId\": \"1bde4o2i6xycudoy\",\n \"webhookContext\": {\n \"streamerId\": \"my-custom-id\"\n },\n \"refreshInterval\": 600,\n \"allowedOrigins\": [\n \"<string>\"\n ]\n },\n \"creatorId\": {\n \"type\": \"unverified\",\n \"value\": \"<string>\"\n },\n \"storage\": {\n \"ipfs\": {\n \"spec\": \"<unknown>\"\n }\n },\n \"c2pa\": true,\n \"profiles\": [\n {\n \"bitrate\": 3000000,\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"quality\": 23,\n \"fps\": 30,\n \"fpsDen\": 1,\n \"gop\": 2,\n \"profile\": \"H264Baseline\",\n \"encoder\": \"H.264\"\n }\n ],\n \"targetSegmentSizeSecs\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://livepeer.studio/api/asset/request-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"filename.mp4\",\n \"staticMp4\": true,\n \"playbackPolicy\": {\n \"type\": \"webhook\",\n \"webhookId\": \"1bde4o2i6xycudoy\",\n \"webhookContext\": {\n \"streamerId\": \"my-custom-id\"\n },\n \"refreshInterval\": 600,\n \"allowedOrigins\": [\n \"<string>\"\n ]\n },\n \"creatorId\": {\n \"type\": \"unverified\",\n \"value\": \"<string>\"\n },\n \"storage\": {\n \"ipfs\": {\n \"spec\": \"<unknown>\"\n }\n },\n \"c2pa\": true,\n \"profiles\": [\n {\n \"bitrate\": 3000000,\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"quality\": 23,\n \"fps\": 30,\n \"fpsDen\": 1,\n \"gop\": 2,\n \"profile\": \"H264Baseline\",\n \"encoder\": \"H.264\"\n }\n ],\n \"targetSegmentSizeSecs\": 123\n}"
response = http.request(request)
puts response.read_body{
"url": "https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q",
"tusEndpoint": "https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q",
"asset": {
"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"source": {
"type": "url",
"url": "<string>",
"gatewayUrl": "<string>",
"encryption": "<unknown>"
},
"name": "filename.mp4",
"type": "video",
"playbackId": "eaw4nk06ts2d0mzb",
"userId": "66E2161C-7670-4D05-B71D-DA2D6979556F",
"playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8",
"downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4",
"playbackPolicy": {
"type": "webhook",
"webhookId": "1bde4o2i6xycudoy",
"webhookContext": {
"streamerId": "my-custom-id"
},
"refreshInterval": 600,
"allowedOrigins": [
"<string>"
]
},
"creatorId": {
"type": "unverified",
"value": "user123"
},
"profiles": [
{
"bitrate": 3000000,
"width": 1280,
"name": "720p",
"height": 720,
"quality": 23,
"fps": 30,
"fpsDen": 1,
"gop": 2,
"profile": "H264Baseline",
"encoder": "H.264"
}
],
"storage": {
"ipfs": {
"spec": {},
"nftMetadata": {
"cid": "<string>",
"url": "<string>",
"gatewayUrl": "<string>"
},
"updatedAt": 1587667174725
},
"status": {
"phase": "ready",
"tasks": {
"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"last": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"
},
"progress": 0.5,
"errorMessage": "Failed to update storage"
}
},
"status": {
"updatedAt": 1587667174725,
"progress": 123,
"errorMessage": "<string>"
},
"projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
"createdAt": 1587667174725,
"createdByTokenName": "<string>",
"size": 84934509,
"hash": [
{
"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57",
"algorithm": "sha256"
}
],
"videoSpec": {
"format": "mp4",
"duration": 23.8328,
"bitrate": 1000000,
"tracks": [
{
"type": "video",
"codec": "aac",
"startTime": 23.8238,
"duration": 23.8238,
"bitrate": 1000000,
"width": 1920,
"height": 1080,
"pixelFormat": "yuv420p",
"fps": 30,
"channels": 2,
"sampleRate": 44100,
"bitDepth": 16
}
]
}
},
"task": {
"id": "34d7618e-fd42-4798-acf5-19504616a11e"
}
}{
"errors": [
[
"id not provided",
"Account not found"
]
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The name of the asset. This is not necessarily the filename - it can be a custom name or title.
"filename.mp4"
Whether to generate MP4s for the asset.
true
Whether the playback policy for an asset or stream is public or signed
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Decides if the output video should include C2PA signature
Show child attributes
Show child attributes
How many seconds the duration of each output segment should be
Response
Success
The direct upload endpoint for which supports PUT requests. It is recommended to use the Tus endpoint for a better upload experience.
"https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q"
The Tus-compatible endpoint for resumable uploads. This is the recommended way to upload assets. See the Tus-js client for more information.
"https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?