diff options
Diffstat (limited to 'packages/models/src/runners/runner-job-payload.model.ts')
-rw-r--r-- | packages/models/src/runners/runner-job-payload.model.ts | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/packages/models/src/runners/runner-job-payload.model.ts b/packages/models/src/runners/runner-job-payload.model.ts new file mode 100644 index 000000000..19b9d649b --- /dev/null +++ b/packages/models/src/runners/runner-job-payload.model.ts | |||
@@ -0,0 +1,79 @@ | |||
1 | import { VideoStudioTaskPayload } from '../server/index.js' | ||
2 | |||
3 | export type RunnerJobVODPayload = | ||
4 | RunnerJobVODWebVideoTranscodingPayload | | ||
5 | RunnerJobVODHLSTranscodingPayload | | ||
6 | RunnerJobVODAudioMergeTranscodingPayload | ||
7 | |||
8 | export type RunnerJobPayload = | ||
9 | RunnerJobVODPayload | | ||
10 | RunnerJobLiveRTMPHLSTranscodingPayload | | ||
11 | RunnerJobStudioTranscodingPayload | ||
12 | |||
13 | // --------------------------------------------------------------------------- | ||
14 | |||
15 | export interface RunnerJobVODWebVideoTranscodingPayload { | ||
16 | input: { | ||
17 | videoFileUrl: string | ||
18 | } | ||
19 | |||
20 | output: { | ||
21 | resolution: number | ||
22 | fps: number | ||
23 | } | ||
24 | } | ||
25 | |||
26 | export interface RunnerJobVODHLSTranscodingPayload { | ||
27 | input: { | ||
28 | videoFileUrl: string | ||
29 | } | ||
30 | |||
31 | output: { | ||
32 | resolution: number | ||
33 | fps: number | ||
34 | } | ||
35 | } | ||
36 | |||
37 | export interface RunnerJobVODAudioMergeTranscodingPayload { | ||
38 | input: { | ||
39 | audioFileUrl: string | ||
40 | previewFileUrl: string | ||
41 | } | ||
42 | |||
43 | output: { | ||
44 | resolution: number | ||
45 | fps: number | ||
46 | } | ||
47 | } | ||
48 | |||
49 | export interface RunnerJobStudioTranscodingPayload { | ||
50 | input: { | ||
51 | videoFileUrl: string | ||
52 | } | ||
53 | |||
54 | tasks: VideoStudioTaskPayload[] | ||
55 | } | ||
56 | |||
57 | // --------------------------------------------------------------------------- | ||
58 | |||
59 | export function isAudioMergeTranscodingPayload (payload: RunnerJobPayload): payload is RunnerJobVODAudioMergeTranscodingPayload { | ||
60 | return !!(payload as RunnerJobVODAudioMergeTranscodingPayload).input.audioFileUrl | ||
61 | } | ||
62 | |||
63 | // --------------------------------------------------------------------------- | ||
64 | |||
65 | export interface RunnerJobLiveRTMPHLSTranscodingPayload { | ||
66 | input: { | ||
67 | rtmpUrl: string | ||
68 | } | ||
69 | |||
70 | output: { | ||
71 | toTranscode: { | ||
72 | resolution: number | ||
73 | fps: number | ||
74 | }[] | ||
75 | |||
76 | segmentDuration: number | ||
77 | segmentListSize: number | ||
78 | } | ||
79 | } | ||