Classes
Methods
(async, static) createLiveMultiBitrateHLS(ctx, name, streamKey)
- Description:
Create live multi-bitrate HLS encoder
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Eyevinn OSC context |
|
name |
name of the encoder |
|
streamKey |
optional stream key |
Returns:
RTMP and HLS URLs
(async, static) createStreamingPackage(ctx, sourceBucket, videos, audio, resultBucket)
- Description:
Create a HLS and MPEG-DASH streaming package
Example
import { Context } from '@osaas/client-core';
import { createStreamingPackage } from '@osaas/client-transcode';
const ctx = new Context();
await createStreamingPackage(
ctx,
new URL('s3://video/abr'),
['video1080p.mp4', 'video720p.mp4', 'video360p.mp4'],
'audio.mp4',
new URL('s3://video/streaming')
);
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Context | Open Source Cloud configuration context |
sourceBucket |
URL | URL to source bucket (supported protocols: s3) |
videos |
Array.<string> | List of video files in source bucket |
audio |
string | Audio file in source bucket |
resultBucket |
URL | URL to bucket where streaming package will be stored (supported protocols: s3) |
(async, static) createVod(pipeline, source, context) → {VodJob}
- Description:
Create a VOD using a VOD pipeline in Eyevinn OSC
Example
import { Context } from '@osaas/client-core';
import { createVod, createVodPipeline } from '@osaas/client-transcode';
async function main() {
const ctx = new Context();
const pipeline = await createVodPipeline('sdkexample', ctx);
const vod = await createVod(
pipeline,
'https://testcontent.eyevinn.technology/mp4/VINN.mp4',
ctx
);
console.log(vod);
}
main();
Parameters:
Name | Type | Description |
---|---|---|
pipeline |
name of the VOD pipeline to use |
|
source |
URL of the source video file |
|
context |
Eyevinn OSC context |
Returns:
- VOD job object
- Type
- VodJob
(async, static) createVodPipeline(name, ctx, optsopt) → {VodPipeline}
- Description:
Create a VOD pipeline based on Encore and Shaka Packager
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
name of the pipeline |
||
ctx |
Eyevinn OSC context |
||
opts |
VodPipelineOpts |
<optional> |
VOD pipeline options |
Returns:
- VOD pipeline object
- Type
- VodPipeline
(async, static) getTranscodeJob(ctx, instanceName, jobId, endpointopt) → {Job}
- Description:
Get details of an SVT Encore transcode job in Eyevinn Open Source Cloud
Example
const job = await getTranscodeJob(ctx, 'tutorial', 'fb2baa17-8972-451b-bb1e-1bc773283476');
console.log(job);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ctx |
Eyevinn OSC context |
||
instanceName |
string | Name of Encore instance |
|
jobId |
string | Id of the Encore job |
|
endpoint |
CustomEndpoint |
<optional> |
Use a custom Encore endpoint (optional) |
Returns:
- The Encore job
- Type
- Job
(async, static) listTranscodeJobs(ctx, instanceName, endpointopt) → {Array.<Job>}
- Description:
Get a list of all SVT Encore transcode job in Eyevinn Open Source Cloud
Example
const jobs = await listTranscodeJobs(ctx, 'tutorial');
console.log(jobs);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ctx |
Eyevinn OSC context |
||
instanceName |
string | Name of Encore instance |
|
endpoint |
CustomEndpoint |
<optional> |
Use a custom Encore endpoint (optional) |
Returns:
- List of Encore jobs
- Type
- Array.<Job>
(async, static) removeVodPipeline(name, context)
- Description:
Remove a VOD pipeline
Parameters:
Name | Type | Description |
---|---|---|
name |
name of pipeline to remove |
|
context |
Eyevinn OSC context |
(async, static) startLiveMultiBitrateHLS(ctx, name)
- Description:
Start live multi-bitrate HLS encoding
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Eyevinn OSC context |
|
name |
name of the encoder |
Returns:
RTMP and HLS URLs
(async, static) stopLiveMultiBitrateHLS(ctx, name)
- Description:
Stop live multi-bitrate HLS encoding
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Eyevinn OSC context |
|
name |
name of the encoder |
(async, static) transcode(ctx, opts, endpointopt) → {Job}
- Description:
Transcode a video file using SVT Encore in Eyevinn Open Source Cloud
Examples
const job = await transcode(ctx, {
encoreInstanceName: 'tutorial',
profile: 'program',
externalId: 'tutorial',
outputUrl: new URL('s3://output/tutorial/'),
inputUrl: new URL('s3://input/VINN.mp4')
});
console.log(job);
// Using a custom Encore endpoint
const job = await transcode(ctx, {
encoreInstanceName: 'dummy',
profile: 'program',
externalId: 'tutorial',
outputUrl: new URL('s3://output/tutorial/'),
inputUrl: new URL('s3://input/VINN.mp4'),
}, {
endpointUrl: new URL('https://my-custom-encore-endpoint.example.com/'),
});
console.log(job);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ctx |
Eyevinn OSC context |
||
opts |
TranscodeOptions | Transcode options |
|
endpoint |
CustomEndpoint |
<optional> |
Use a custom Encore endpoint (optional) |
Returns:
- The created Encore job
- Type
- Job
(async, static) vmafCompare(ctx, reference, distorted, resultBucket)
- Description:
Compare two video files using VMAF
Example
import { Context } from '@osaas/client-core';
import { vmafCompare } from '@osaas/client-transcode';
const ctx = new Context();
const reference = new URL('s3://video/reference.mp4');
const distorted = new URL('s3://video/distorted.mp4');
const resultBucket = new URL('s3://video/results');
const resultFile = await vmafCompare(ctx, reference, distorted, resultBucket);
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Context | Open Source Cloud configuration context |
reference |
URL | URL to reference video file (supported protocols: s3) |
distorted |
URL | URL to distorted video file (supported protocols: s3) |
resultBucket |
URL | URL to S3 bucket where result file will be stored |
Returns:
S3 URL to result file