-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e64f8b
commit 607eae4
Showing
7 changed files
with
259 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
import { EncorePipelineConfiguration } from '../src/pipelines/encore/encore-pipeline-configuration'; | ||
import { EncorePipeline, delay } from '../src/pipelines/encore/encore-pipeline'; | ||
import { EncoreInstance } from '../src/models/encoreInstance'; | ||
import { JobDescription } from '../src/create-job'; | ||
import createJob from '../src/create-job'; | ||
|
||
async function transcodeInputsAndAnalyze() { | ||
const configuration: EncorePipelineConfiguration = { | ||
apiAddress: "https://api-encore.stage.osaas.io", | ||
token: "", | ||
instanceId: "dummy", | ||
profile: "program", | ||
outputFolder: "/usercontent/demo", | ||
baseName: "_demo_job", | ||
inputs: ["https://testcontent.eyevinn.technology/mp4/stswe-tvplus-promo.mp4"], | ||
duration: 5, | ||
priority: 0, | ||
encorePollingInterval_ms: 60000, | ||
encoreInstancePostCreationDelay_ms: 10000 | ||
}; | ||
|
||
const configuration: EncorePipelineConfiguration = { | ||
apiAddress: "https://api-encore.stage.osaas.io", | ||
token: "", | ||
instanceId: "dummy", | ||
profile: "program", | ||
outputFolder: "/usercontent/demo", | ||
baseName: "_demo", | ||
inputs: ["https://testcontent.eyevinn.technology/mp4/stswe-tvplus-promo.mp4"], | ||
duration: 120, | ||
priority: 0, | ||
encorePollingInterval_ms: 30000, | ||
encoreInstancePostCreationDelay_ms: 10000 | ||
}; | ||
|
||
const pipeline: EncorePipeline = new EncorePipeline(configuration); | ||
const instance: EncoreInstance = await pipeline.createEncoreInstance(configuration.apiAddress, configuration.token, configuration.instanceId, configuration.profile); | ||
await delay(pipeline.configuration.encoreInstancePostCreationDelay_ms); // Delay required to allow instance to be created before calling it | ||
await pipeline.runTranscodeThenAnalyze(instance); | ||
|
||
} | ||
|
||
transcodeInputsAndAnalyze(); | ||
const job: JobDescription = { | ||
name: "oliver_testjob", | ||
pipeline: configuration, | ||
encodingProfile: "null", | ||
reference: "null" | ||
} | ||
|
||
createJob(job); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { EncorePipelineConfiguration } from "./pipelines/encore/encore-pipeline-configuration"; | ||
import { LocalPipelineConfiguration } from "./pipelines/local/local-pipeline-configuration"; | ||
|
||
export function instanceOfLocalPipelineConfiguration(object: any): object is LocalPipelineConfiguration { | ||
return (typeof object === 'object' && | ||
'ffmpegPath' in object && 'pythonPath' in object && 'easyVmafPath' in object && | ||
'ffmpegEncoder' in object && 'ffmpegOptions' in object); | ||
} | ||
|
||
export function instanceOfEncorePipelineConfiguration(object: any): object is EncorePipelineConfiguration { | ||
return (typeof object === 'object' && | ||
'apiAddress' in object && 'token' in object && 'instanceId' in object && | ||
'profile' in object && 'outputFolder' in object && 'baseName' in object && | ||
'inputs' in object && 'duration' in object && 'priority' in object && | ||
'encorePollingInterval_ms' in object && 'encoreInstancePostCreationDelay_ms' in object); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.