2023-05-04 15:29:34 +02:00
|
|
|
import { VideoStudioTaskPayload } from '../server'
|
|
|
|
|
2023-04-21 14:55:10 +02:00
|
|
|
export type RunnerJobVODPayload =
|
|
|
|
RunnerJobVODWebVideoTranscodingPayload |
|
|
|
|
RunnerJobVODHLSTranscodingPayload |
|
|
|
|
RunnerJobVODAudioMergeTranscodingPayload
|
|
|
|
|
|
|
|
export type RunnerJobPayload =
|
|
|
|
RunnerJobVODPayload |
|
2023-05-04 15:29:34 +02:00
|
|
|
RunnerJobLiveRTMPHLSTranscodingPayload |
|
2023-05-04 15:55:51 +02:00
|
|
|
RunnerJobStudioTranscodingPayload
|
2023-04-21 14:55:10 +02:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 15:55:51 +02:00
|
|
|
export interface RunnerJobStudioTranscodingPayload {
|
2023-05-04 15:29:34 +02:00
|
|
|
input: {
|
|
|
|
videoFileUrl: string
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks: VideoStudioTaskPayload[]
|
|
|
|
}
|
|
|
|
|
2023-04-21 14:55:10 +02:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|