import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.task.getAll();
// Handle the result
console.log(result);
}
run();[
{
"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"type": "upload",
"createdAt": 1587667174725,
"scheduledAt": 1587667174725,
"inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"params": {
"upload": {
"url": "https://cdn.livepeer.com/ABC123/filename.mp4",
"encryption": "<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": 6
},
"export": {
"custom": {
"url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB",
"method": "POST",
"headers": {}
}
},
"exportData": {
"content": {
"data": "Hello, World!"
},
"ipfs": {
"pinata": {}
},
"type": "text/plain",
"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"
},
"transcode-file": {
"input": {
"url": "https://cdn.livepeer.com/ABC123/filename.mp4"
},
"storage": {
"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"
},
"outputs": {
"hls": {
"path": "/samplevideo/hls"
},
"mp4": {
"path": "/samplevideo/mp4"
}
},
"profiles": [
{
"bitrate": 3000000,
"width": 1280,
"name": "720p",
"height": 720,
"quality": 23,
"fps": 30,
"fpsDen": 1,
"gop": 2,
"profile": "H264Baseline",
"encoder": "H.264"
}
],
"targetSegmentSizeSecs": 10,
"creatorId": {
"type": "unverified",
"value": "<string>"
},
"c2pa": false
},
"clip": {
"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4",
"clipStrategy": {
"startTime": "<unknown>",
"endTime": "<unknown>",
"playbackId": "<unknown>"
},
"catalystPipelineStrategy": "catalyst_ffmpeg",
"sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16",
"inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"
}
},
"status": {
"phase": "pending",
"updatedAt": 1587667174725,
"progress": 0.5,
"errorMessage": "Failed to upload file",
"retries": 3
},
"output": {
"upload": {
"assetSpec": {
"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": {
"phase": "uploading",
"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
}
]
}
}
},
"export": {
"ipfs": {
"videoFileCid": "Qmabc123xyz341",
"videoFileUrl": "ipfs://Qmabc123xyz341",
"videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341",
"nftMetadataCid": "Qmabc123xyz341",
"nftMetadataUrl": "ipfs://Qmabc123xyz341",
"nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"
}
},
"exportData": {
"ipfs": {
"cid": "Qmabc123xyz341"
}
}
}
}
]import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.task.getAll();
// Handle the result
console.log(result);
}
run();[
{
"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"type": "upload",
"createdAt": 1587667174725,
"scheduledAt": 1587667174725,
"inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7",
"params": {
"upload": {
"url": "https://cdn.livepeer.com/ABC123/filename.mp4",
"encryption": "<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": 6
},
"export": {
"custom": {
"url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB",
"method": "POST",
"headers": {}
}
},
"exportData": {
"content": {
"data": "Hello, World!"
},
"ipfs": {
"pinata": {}
},
"type": "text/plain",
"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"
},
"transcode-file": {
"input": {
"url": "https://cdn.livepeer.com/ABC123/filename.mp4"
},
"storage": {
"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"
},
"outputs": {
"hls": {
"path": "/samplevideo/hls"
},
"mp4": {
"path": "/samplevideo/mp4"
}
},
"profiles": [
{
"bitrate": 3000000,
"width": 1280,
"name": "720p",
"height": 720,
"quality": 23,
"fps": 30,
"fpsDen": 1,
"gop": 2,
"profile": "H264Baseline",
"encoder": "H.264"
}
],
"targetSegmentSizeSecs": 10,
"creatorId": {
"type": "unverified",
"value": "<string>"
},
"c2pa": false
},
"clip": {
"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4",
"clipStrategy": {
"startTime": "<unknown>",
"endTime": "<unknown>",
"playbackId": "<unknown>"
},
"catalystPipelineStrategy": "catalyst_ffmpeg",
"sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16",
"inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"
}
},
"status": {
"phase": "pending",
"updatedAt": 1587667174725,
"progress": 0.5,
"errorMessage": "Failed to upload file",
"retries": 3
},
"output": {
"upload": {
"assetSpec": {
"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": {
"phase": "uploading",
"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
}
]
}
}
},
"export": {
"ipfs": {
"videoFileCid": "Qmabc123xyz341",
"videoFileUrl": "ipfs://Qmabc123xyz341",
"videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341",
"nftMetadataCid": "Qmabc123xyz341",
"nftMetadataUrl": "ipfs://Qmabc123xyz341",
"nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"
}
},
"exportData": {
"ipfs": {
"cid": "Qmabc123xyz341"
}
}
}
}
]Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Success
Task ID
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
Type of the task
upload, export, export-data, transcode-file, clip "upload"
Timestamp (in milliseconds) at which task was created
1587667174725
Timestamp (in milliseconds) at which the task was scheduled for execution (e.g. after file upload finished).
1587667174725
ID of the input asset
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
ID of the output asset
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
ID of the project
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
ID of the requester hash(IP + SALT + PlaybackId)
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
Parameters of the task
Show child attributes
Parameters for the upload task
Show child attributes
URL of the asset to "upload"
"https://cdn.livepeer.com/ABC123/filename.mp4"
Decides if the output video should include C2PA signature
true
Show child attributes
x >= 4003000000
x >= 1281280
1 - 500"720p"
x >= 128720
Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
0 <= x <= 4423
x >= 030
x >= 11
2
H264Baseline, H264Main, H264High, H264ConstrainedHigh "H264Baseline"
H.264, HEVC, VP8, VP9 "H.264"
How many seconds the duration of each output segment should be
6
Parameters for the export task
Show child attributes
custom URL parameters for the export task
Show child attributes
URL where to export the asset
"https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB"
Method to use on the export request
"POST"
Parameters for the export-data task
Show child attributes
File content to store into IPFS
{ "data": "Hello, World!" }Optional type of content
"text/plain"
Optional ID of the content
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
Parameters for the transcode-file task
Show child attributes
Output formats
Show child attributes
Show child attributes
x >= 4003000000
x >= 1281280
1 - 500"720p"
x >= 128720
Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
0 <= x <= 4423
x >= 030
x >= 11
2
H264Baseline, H264Main, H264High, H264ConstrainedHigh "H264Baseline"
H.264, HEVC, VP8, VP9 "H.264"
How many seconds the duration of each output segment should be
10
Decides if the output video should include C2PA signature
false
Show child attributes
URL of the asset to "clip"
"https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4"
Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing.
Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing.
catalyst, catalyst_ffmpeg, background_external, background_mist, fallback_external, external "catalyst_ffmpeg"
ID of the session
"d32ae9e6-c459-4931-9898-e86e2f5e7e16"
ID of the input asset or stream
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
Status of the task
Show child attributes
Phase of the task
pending, waiting, running, failed, completed, cancelled "pending"
Timestamp (in milliseconds) at which task was updated
1587667174725
Current progress of the task in a 0-1 ratio
0.5
Error message if the task failed
"Failed to upload file"
Number of retries done on the task
3
Output of the task
Show child attributes
Output of the upload task
Show child attributes
Show child attributes
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
Show child attributes
url URL from which the asset was uploaded.
Gateway URL from asset if parsed from provided URL on upload.
The name of the asset. This is not necessarily the filename - it can be a custom name or title.
"filename.mp4"
Type of the asset.
video, audio "video"
The playback ID to use with the Playback Info endpoint to retrieve playback URLs.
"eaw4nk06ts2d0mzb"
"66E2161C-7670-4D05-B71D-DA2D6979556F"
URL for HLS playback. It is recommended to not use this URL, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8).
"https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8"
The URL to directly download the asset, e.g. https://livepeercdn.com/asset/eawrrk06ts2d0mzb/video. It is not recommended to use this for playback.
"https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4"
Whether the playback policy for an asset or stream is public or signed
Show child attributes
public, jwt, webhook "webhook"
ID of the webhook to use for playback policy
"1bde4o2i6xycudoy"
User-defined webhook context
{ "streamerId": "my-custom-id" }Interval (in seconds) at which the playback policy should be refreshed (default 600 seconds)
600
List of allowed origins for CORS playback (
Requested profiles for the asset to be transcoded into. Configured
on the upload APIs payload or through the stream.recordingSpec
field for recordings. If not specified, default profiles are derived
based on the source input. If this is a recording, the source will
not be present in this list but will be available for playback.
Show child attributes
x >= 4003000000
x >= 1281280
1 - 500"720p"
x >= 128720
Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
0 <= x <= 4423
x >= 030
x >= 11
2
H264Baseline, H264Main, H264High, H264ConstrainedHigh "H264Baseline"
H.264, HEVC, VP8, VP9 "H.264"
Show child attributes
Show child attributes
Show child attributes
Name of the NFT metadata template to export. 'player' will embed the Livepeer Player on the NFT while 'file' will reference only the immutable MP4 files.
file, player Additional data to add to the NFT metadata exported to IPFS. Will be deep merged with the default metadata exported.
Show child attributes
Timestamp (in milliseconds) at which IPFS export task was updated
1587667174725
Show child attributes
Phase of the asset storage
waiting, processing, ready, failed, reverted "ready"
Show child attributes
ID of any currently running task that is exporting this asset to IPFS.
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
ID of the last task to run successfully, that created the currently saved data.
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
ID of the last task to fail execution.
"09F8B46C-61A0-4254-9875-F71F4C605BC7"
Current progress of the task updating the storage.
0.5
Error message if the last storage changed failed.
"Failed to update storage"
Status of the asset
Show child attributes
Phase of the asset
uploading, waiting, processing, ready, failed, deleting, deleted Timestamp (in milliseconds) at which the asset was last updated
1587667174725
Current progress of the task creating this asset.
Error message if the asset creation failed.
The ID of the project
"aac12556-4d65-4d34-9fb6-d1f0985eb0a9"
Timestamp (in milliseconds) at which asset was created
1587667174725
Name of the token used to create this object
Size of the asset in bytes
84934509
Video metadata
Show child attributes
Format of the asset
"mp4"
Duration of the asset in seconds (float)
23.8328
Bitrate of the video in bits per second
1000000
List of tracks associated with the asset when the format contemplates them (e.g. mp4)
Show child attributes
type of track
video, audio "video"
Codec of the track
"aac"
Start time of the track in seconds
23.8238
Duration of the track in seconds
23.8238
Bitrate of the track in bits per second
1000000
Width of the track - only for video tracks
1920
Height of the track - only for video tracks
1080
Pixel format of the track - only for video tracks
"yuv420p"
Frame rate of the track - only for video tracks
30
Amount of audio channels in the track
2
Sample rate of the track in samples per second - only for audio tracks
44100
Bit depth of the track - only for audio tracks
16
Output of the export task
Show child attributes
Show child attributes
IPFS CID of the exported video file
"Qmabc123xyz341"
URL for the file with the IPFS protocol
"ipfs://Qmabc123xyz341"
URL to access file via HTTP through an IPFS gateway
"https://gateway.ipfs.io/ipfs/Qmabc123xyz341"
IPFS CID of the default metadata exported for the video
"Qmabc123xyz341"
URL for the metadata file with the IPFS protocol
"ipfs://Qmabc123xyz341"
URL to access metadata file via HTTP through an IPFS gateway
"https://gateway.ipfs.io/ipfs/Qmabc123xyz341"
Was this page helpful?