aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-04 15:29:34 +0200
committerChocobozzz <chocobozzz@cpy.re>2023-05-09 08:57:34 +0200
commit5e47f6ab984a7d00782e4c7030afffa1ba480add (patch)
tree1ce586b591a8d71acbc301eba29b9a5e6490439e /shared/models
parent6a4905602636afd6650c9e6f4d0fcc2105d91100 (diff)
downloadPeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.gz
PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.zst
PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.zip
Support studio transcoding in peertube runner
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/runners/runner-job-payload.model.ts13
-rw-r--r--shared/models/runners/runner-job-private-payload.model.ts12
-rw-r--r--shared/models/runners/runner-job-success-body.model.ts7
-rw-r--r--shared/models/runners/runner-job-type.type.ts3
-rw-r--r--shared/models/server/custom-config.model.ts4
-rw-r--r--shared/models/server/job.model.ts4
-rw-r--r--shared/models/server/server-config.model.ts6
-rw-r--r--shared/models/videos/studio/video-studio-create-edit.model.ts18
8 files changed, 62 insertions, 5 deletions
diff --git a/shared/models/runners/runner-job-payload.model.ts b/shared/models/runners/runner-job-payload.model.ts
index 8f0c17135..9f0db0dc4 100644
--- a/shared/models/runners/runner-job-payload.model.ts
+++ b/shared/models/runners/runner-job-payload.model.ts
@@ -1,3 +1,5 @@
1import { VideoStudioTaskPayload } from '../server'
2
1export type RunnerJobVODPayload = 3export type RunnerJobVODPayload =
2 RunnerJobVODWebVideoTranscodingPayload | 4 RunnerJobVODWebVideoTranscodingPayload |
3 RunnerJobVODHLSTranscodingPayload | 5 RunnerJobVODHLSTranscodingPayload |
@@ -5,7 +7,8 @@ export type RunnerJobVODPayload =
5 7
6export type RunnerJobPayload = 8export type RunnerJobPayload =
7 RunnerJobVODPayload | 9 RunnerJobVODPayload |
8 RunnerJobLiveRTMPHLSTranscodingPayload 10 RunnerJobLiveRTMPHLSTranscodingPayload |
11 RunnerJobVideoEditionTranscodingPayload
9 12
10// --------------------------------------------------------------------------- 13// ---------------------------------------------------------------------------
11 14
@@ -43,6 +46,14 @@ export interface RunnerJobVODAudioMergeTranscodingPayload {
43 } 46 }
44} 47}
45 48
49export interface RunnerJobVideoEditionTranscodingPayload {
50 input: {
51 videoFileUrl: string
52 }
53
54 tasks: VideoStudioTaskPayload[]
55}
56
46// --------------------------------------------------------------------------- 57// ---------------------------------------------------------------------------
47 58
48export function isAudioMergeTranscodingPayload (payload: RunnerJobPayload): payload is RunnerJobVODAudioMergeTranscodingPayload { 59export function isAudioMergeTranscodingPayload (payload: RunnerJobPayload): payload is RunnerJobVODAudioMergeTranscodingPayload {
diff --git a/shared/models/runners/runner-job-private-payload.model.ts b/shared/models/runners/runner-job-private-payload.model.ts
index c1d8d1045..c8fe0a7d8 100644
--- a/shared/models/runners/runner-job-private-payload.model.ts
+++ b/shared/models/runners/runner-job-private-payload.model.ts
@@ -1,3 +1,5 @@
1import { VideoStudioTaskPayload } from '../server'
2
1export type RunnerJobVODPrivatePayload = 3export type RunnerJobVODPrivatePayload =
2 RunnerJobVODWebVideoTranscodingPrivatePayload | 4 RunnerJobVODWebVideoTranscodingPrivatePayload |
3 RunnerJobVODAudioMergeTranscodingPrivatePayload | 5 RunnerJobVODAudioMergeTranscodingPrivatePayload |
@@ -5,7 +7,8 @@ export type RunnerJobVODPrivatePayload =
5 7
6export type RunnerJobPrivatePayload = 8export type RunnerJobPrivatePayload =
7 RunnerJobVODPrivatePayload | 9 RunnerJobVODPrivatePayload |
8 RunnerJobLiveRTMPHLSTranscodingPrivatePayload 10 RunnerJobLiveRTMPHLSTranscodingPrivatePayload |
11 RunnerJobVideoEditionTranscodingPrivatePayload
9 12
10// --------------------------------------------------------------------------- 13// ---------------------------------------------------------------------------
11 14
@@ -32,3 +35,10 @@ export interface RunnerJobLiveRTMPHLSTranscodingPrivatePayload {
32 masterPlaylistName: string 35 masterPlaylistName: string
33 outputDirectory: string 36 outputDirectory: string
34} 37}
38
39// ---------------------------------------------------------------------------
40
41export interface RunnerJobVideoEditionTranscodingPrivatePayload {
42 videoUUID: string
43 originalTasks: VideoStudioTaskPayload[]
44}
diff --git a/shared/models/runners/runner-job-success-body.model.ts b/shared/models/runners/runner-job-success-body.model.ts
index 223b7552d..17e921f69 100644
--- a/shared/models/runners/runner-job-success-body.model.ts
+++ b/shared/models/runners/runner-job-success-body.model.ts
@@ -11,7 +11,8 @@ export type RunnerJobSuccessPayload =
11 VODWebVideoTranscodingSuccess | 11 VODWebVideoTranscodingSuccess |
12 VODHLSTranscodingSuccess | 12 VODHLSTranscodingSuccess |
13 VODAudioMergeTranscodingSuccess | 13 VODAudioMergeTranscodingSuccess |
14 LiveRTMPHLSTranscodingSuccess 14 LiveRTMPHLSTranscodingSuccess |
15 VideoEditionTranscodingSuccess
15 16
16export interface VODWebVideoTranscodingSuccess { 17export interface VODWebVideoTranscodingSuccess {
17 videoFile: Blob | string 18 videoFile: Blob | string
@@ -30,6 +31,10 @@ export interface LiveRTMPHLSTranscodingSuccess {
30 31
31} 32}
32 33
34export interface VideoEditionTranscodingSuccess {
35 videoFile: Blob | string
36}
37
33export function isWebVideoOrAudioMergeTranscodingPayloadSuccess ( 38export function isWebVideoOrAudioMergeTranscodingPayloadSuccess (
34 payload: RunnerJobSuccessPayload 39 payload: RunnerJobSuccessPayload
35): payload is VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess { 40): payload is VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess {
diff --git a/shared/models/runners/runner-job-type.type.ts b/shared/models/runners/runner-job-type.type.ts
index 36d3b9b25..3b997cb6e 100644
--- a/shared/models/runners/runner-job-type.type.ts
+++ b/shared/models/runners/runner-job-type.type.ts
@@ -2,4 +2,5 @@ export type RunnerJobType =
2 'vod-web-video-transcoding' | 2 'vod-web-video-transcoding' |
3 'vod-hls-transcoding' | 3 'vod-hls-transcoding' |
4 'vod-audio-merge-transcoding' | 4 'vod-audio-merge-transcoding' |
5 'live-rtmp-hls-transcoding' 5 'live-rtmp-hls-transcoding' |
6 'video-edition-transcoding'
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 5d2c10278..4202589f3 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -165,6 +165,10 @@ export interface CustomConfig {
165 165
166 videoStudio: { 166 videoStudio: {
167 enabled: boolean 167 enabled: boolean
168
169 remoteRunners: {
170 enabled: boolean
171 }
168 } 172 }
169 173
170 import: { 174 import: {
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
index 3fd5bf7f9..22ecee324 100644
--- a/shared/models/server/job.model.ts
+++ b/shared/models/server/job.model.ts
@@ -225,6 +225,10 @@ export type VideoStudioTaskWatermarkPayload = {
225 225
226 options: { 226 options: {
227 file: string 227 file: string
228
229 watermarkSizeRatio: number
230 horitonzalMarginRatio: number
231 verticalMarginRatio: number
228 } 232 }
229} 233}
230 234
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
index 38b9d0385..024ed35bf 100644
--- a/shared/models/server/server-config.model.ts
+++ b/shared/models/server/server-config.model.ts
@@ -1,6 +1,6 @@
1import { VideoPrivacy } from '../videos/video-privacy.enum'
2import { ClientScriptJSON } from '../plugins/plugin-package-json.model' 1import { ClientScriptJSON } from '../plugins/plugin-package-json.model'
3import { NSFWPolicyType } from '../videos/nsfw-policy.type' 2import { NSFWPolicyType } from '../videos/nsfw-policy.type'
3import { VideoPrivacy } from '../videos/video-privacy.enum'
4import { BroadcastMessageLevel } from './broadcast-message-level.type' 4import { BroadcastMessageLevel } from './broadcast-message-level.type'
5 5
6export interface ServerConfigPlugin { 6export interface ServerConfigPlugin {
@@ -186,6 +186,10 @@ export interface ServerConfig {
186 186
187 videoStudio: { 187 videoStudio: {
188 enabled: boolean 188 enabled: boolean
189
190 remoteRunners: {
191 enabled: boolean
192 }
189 } 193 }
190 194
191 import: { 195 import: {
diff --git a/shared/models/videos/studio/video-studio-create-edit.model.ts b/shared/models/videos/studio/video-studio-create-edit.model.ts
index 001d65c90..5e8296dc9 100644
--- a/shared/models/videos/studio/video-studio-create-edit.model.ts
+++ b/shared/models/videos/studio/video-studio-create-edit.model.ts
@@ -40,3 +40,21 @@ export interface VideoStudioTaskWatermark {
40 file: Blob | string 40 file: Blob | string
41 } 41 }
42} 42}
43
44// ---------------------------------------------------------------------------
45
46export function isVideoStudioTaskIntro (v: VideoStudioTask): v is VideoStudioTaskIntro {
47 return v.name === 'add-intro'
48}
49
50export function isVideoStudioTaskOutro (v: VideoStudioTask): v is VideoStudioTaskOutro {
51 return v.name === 'add-outro'
52}
53
54export function isVideoStudioTaskWatermark (v: VideoStudioTask): v is VideoStudioTaskWatermark {
55 return v.name === 'add-watermark'
56}
57
58export function hasVideoStudioTaskFile (v: VideoStudioTask): v is VideoStudioTaskIntro | VideoStudioTaskOutro | VideoStudioTaskWatermark {
59 return isVideoStudioTaskIntro(v) || isVideoStudioTaskOutro(v) || isVideoStudioTaskWatermark(v)
60}