1
0
Fork 0
peertube/shared/models/runners/runner-job-payload.model.ts
Chocobozzz 0c9668f779 Implement remote runner jobs in server
Move ffmpeg functions to @shared
2023-05-09 08:57:34 +02:00

68 lines
1.4 KiB
TypeScript

export type RunnerJobVODPayload =
RunnerJobVODWebVideoTranscodingPayload |
RunnerJobVODHLSTranscodingPayload |
RunnerJobVODAudioMergeTranscodingPayload
export type RunnerJobPayload =
RunnerJobVODPayload |
RunnerJobLiveRTMPHLSTranscodingPayload
// ---------------------------------------------------------------------------
export interface RunnerJobVODWebVideoTranscodingPayload {
input: {
videoFileUrl: string
}
output: {
resolution: number
fps: number
}
}
export interface RunnerJobVODHLSTranscodingPayload {
input: {
videoFileUrl: string
}
output: {
resolution: number
fps: number
}
}
export interface RunnerJobVODAudioMergeTranscodingPayload {
input: {
audioFileUrl: string
previewFileUrl: string
}
output: {
resolution: number
fps: number
}
}
// ---------------------------------------------------------------------------
export function isAudioMergeTranscodingPayload (payload: RunnerJobPayload): payload is RunnerJobVODAudioMergeTranscodingPayload {
return !!(payload as RunnerJobVODAudioMergeTranscodingPayload).input.audioFileUrl
}
// ---------------------------------------------------------------------------
export interface RunnerJobLiveRTMPHLSTranscodingPayload {
input: {
rtmpUrl: string
}
output: {
toTranscode: {
resolution: number
fps: number
}[]
segmentDuration: number
segmentListSize: number
}
}