aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/tests/api/check-params/runners.ts4
-rw-r--r--server/tests/api/check-params/video-files.ts6
-rw-r--r--server/tests/api/live/live-fast-restream.ts2
-rw-r--r--server/tests/api/runners/runner-common.ts2
-rw-r--r--server/tests/api/runners/runner-socket.ts2
-rw-r--r--server/tests/api/runners/runner-studio-transcoding.ts2
-rw-r--r--server/tests/api/runners/runner-vod-transcoding.ts10
-rw-r--r--server/tests/api/videos/video-files.ts2
-rw-r--r--server/tests/api/videos/video-source.ts4
-rw-r--r--server/tests/api/videos/videos-common-filters.ts6
-rw-r--r--server/tests/peertube-runner/live-transcoding.ts4
-rw-r--r--server/tests/peertube-runner/studio-transcoding.ts2
-rw-r--r--server/tests/peertube-runner/vod-transcoding.ts14
-rw-r--r--shared/server-commands/server/config-command.ts17
14 files changed, 43 insertions, 34 deletions
diff --git a/server/tests/api/check-params/runners.ts b/server/tests/api/check-params/runners.ts
index 7f9a0cd32..0e5012da5 100644
--- a/server/tests/api/check-params/runners.ts
+++ b/server/tests/api/check-params/runners.ts
@@ -65,7 +65,7 @@ describe('Test managing runners', function () {
65 registrationToken = data[0].registrationToken 65 registrationToken = data[0].registrationToken
66 registrationTokenId = data[0].id 66 registrationTokenId = data[0].id
67 67
68 await server.config.enableTranscoding(true, true) 68 await server.config.enableTranscoding({ hls: true, webVideo: true })
69 await server.config.enableStudio() 69 await server.config.enableStudio()
70 await server.config.enableRemoteTranscoding() 70 await server.config.enableRemoteTranscoding()
71 await server.config.enableRemoteStudio() 71 await server.config.enableRemoteStudio()
@@ -451,7 +451,7 @@ describe('Test managing runners', function () {
451 const { uuid } = await server.videos.quickUpload({ name: 'video studio' }) 451 const { uuid } = await server.videos.quickUpload({ name: 'video studio' })
452 videoStudioUUID = uuid 452 videoStudioUUID = uuid
453 453
454 await server.config.enableTranscoding(true, true) 454 await server.config.enableTranscoding({ hls: true, webVideo: true })
455 await server.config.enableStudio() 455 await server.config.enableStudio()
456 456
457 await server.videoStudio.createEditionTasks({ 457 await server.videoStudio.createEditionTasks({
diff --git a/server/tests/api/check-params/video-files.ts b/server/tests/api/check-params/video-files.ts
index 4d43ab6f8..01d6a912b 100644
--- a/server/tests/api/check-params/video-files.ts
+++ b/server/tests/api/check-params/video-files.ts
@@ -87,7 +87,7 @@ describe('Test videos files', function () {
87 } 87 }
88 88
89 { 89 {
90 await servers[0].config.enableTranscoding(true, true) 90 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
91 91
92 { 92 {
93 const { uuid } = await servers[0].videos.quickUpload({ name: 'both 1' }) 93 const { uuid } = await servers[0].videos.quickUpload({ name: 'both 1' })
@@ -108,7 +108,7 @@ describe('Test videos files', function () {
108 await waitJobs(servers) 108 await waitJobs(servers)
109 109
110 { 110 {
111 await servers[0].config.enableTranscoding(false, true) 111 await servers[0].config.enableTranscoding({ hls: true, webVideo: false })
112 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls' }) 112 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls' })
113 hlsId = uuid 113 hlsId = uuid
114 } 114 }
@@ -116,7 +116,7 @@ describe('Test videos files', function () {
116 await waitJobs(servers) 116 await waitJobs(servers)
117 117
118 { 118 {
119 await servers[0].config.enableTranscoding(false, true) 119 await servers[0].config.enableTranscoding({ webVideo: true, hls: false })
120 const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' }) 120 const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' })
121 webVideoId = uuid 121 webVideoId = uuid
122 } 122 }
diff --git a/server/tests/api/live/live-fast-restream.ts b/server/tests/api/live/live-fast-restream.ts
index d7085a957..1b7fddd8b 100644
--- a/server/tests/api/live/live-fast-restream.ts
+++ b/server/tests/api/live/live-fast-restream.ts
@@ -133,7 +133,7 @@ describe('Fast restream in live', function () {
133 await setAccessTokensToServers([ server ]) 133 await setAccessTokensToServers([ server ])
134 await setDefaultVideoChannel([ server ]) 134 await setDefaultVideoChannel([ server ])
135 135
136 await server.config.enableMinimumTranscoding(false, true) 136 await server.config.enableMinimumTranscoding({ webVideo: false, hls: true })
137 await server.config.enableLive({ allowReplay: true, transcoding: true, resolutions: 'min' }) 137 await server.config.enableLive({ allowReplay: true, transcoding: true, resolutions: 'min' })
138 }) 138 })
139 139
diff --git a/server/tests/api/runners/runner-common.ts b/server/tests/api/runners/runner-common.ts
index 7fed75f40..9b2eb8b27 100644
--- a/server/tests/api/runners/runner-common.ts
+++ b/server/tests/api/runners/runner-common.ts
@@ -40,7 +40,7 @@ describe('Test runner common actions', function () {
40 await setAccessTokensToServers([ server ]) 40 await setAccessTokensToServers([ server ])
41 await setDefaultVideoChannel([ server ]) 41 await setDefaultVideoChannel([ server ])
42 42
43 await server.config.enableTranscoding(true, true) 43 await server.config.enableTranscoding({ hls: true, webVideo: true })
44 await server.config.enableRemoteTranscoding() 44 await server.config.enableRemoteTranscoding()
45 }) 45 })
46 46
diff --git a/server/tests/api/runners/runner-socket.ts b/server/tests/api/runners/runner-socket.ts
index a77e57a11..215164e48 100644
--- a/server/tests/api/runners/runner-socket.ts
+++ b/server/tests/api/runners/runner-socket.ts
@@ -23,7 +23,7 @@ describe('Test runner socket', function () {
23 await setAccessTokensToServers([ server ]) 23 await setAccessTokensToServers([ server ])
24 await setDefaultVideoChannel([ server ]) 24 await setDefaultVideoChannel([ server ])
25 25
26 await server.config.enableTranscoding(true, true) 26 await server.config.enableTranscoding({ hls: true, webVideo: true })
27 await server.config.enableRemoteTranscoding() 27 await server.config.enableRemoteTranscoding()
28 runnerToken = await server.runners.autoRegisterRunner() 28 runnerToken = await server.runners.autoRegisterRunner()
29 }) 29 })
diff --git a/server/tests/api/runners/runner-studio-transcoding.ts b/server/tests/api/runners/runner-studio-transcoding.ts
index 443a9d02a..f5cea6cea 100644
--- a/server/tests/api/runners/runner-studio-transcoding.ts
+++ b/server/tests/api/runners/runner-studio-transcoding.ts
@@ -53,7 +53,7 @@ describe('Test runner video studio transcoding', function () {
53 53
54 await doubleFollow(servers[0], servers[1]) 54 await doubleFollow(servers[0], servers[1])
55 55
56 await servers[0].config.enableTranscoding(true, true) 56 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
57 await servers[0].config.enableStudio() 57 await servers[0].config.enableStudio()
58 await servers[0].config.enableRemoteStudio() 58 await servers[0].config.enableRemoteStudio()
59 59
diff --git a/server/tests/api/runners/runner-vod-transcoding.ts b/server/tests/api/runners/runner-vod-transcoding.ts
index ca16d9c10..ee6be4ee9 100644
--- a/server/tests/api/runners/runner-vod-transcoding.ts
+++ b/server/tests/api/runners/runner-vod-transcoding.ts
@@ -85,7 +85,7 @@ describe('Test runner VOD transcoding', function () {
85 before(async function () { 85 before(async function () {
86 this.timeout(60000) 86 this.timeout(60000)
87 87
88 await servers[0].config.enableTranscoding(true, true) 88 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
89 }) 89 })
90 90
91 it('Should error a transcoding job', async function () { 91 it('Should error a transcoding job', async function () {
@@ -133,7 +133,7 @@ describe('Test runner VOD transcoding', function () {
133 this.timeout(60000) 133 this.timeout(60000)
134 134
135 await servers[0].runnerJobs.cancelAllJobs() 135 await servers[0].runnerJobs.cancelAllJobs()
136 await servers[0].config.enableTranscoding(true, false) 136 await servers[0].config.enableTranscoding({ hls: false, webVideo: true })
137 137
138 const { uuid } = await servers[0].videos.quickUpload({ name: 'web video', fixture: 'video_short.webm' }) 138 const { uuid } = await servers[0].videos.quickUpload({ name: 'web video', fixture: 'video_short.webm' })
139 videoUUID = uuid 139 videoUUID = uuid
@@ -264,7 +264,7 @@ describe('Test runner VOD transcoding', function () {
264 before(async function () { 264 before(async function () {
265 this.timeout(60000) 265 this.timeout(60000)
266 266
267 await servers[0].config.enableTranscoding(false, true) 267 await servers[0].config.enableTranscoding({ hls: true, webVideo: false })
268 268
269 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls video', fixture: 'video_short.webm' }) 269 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls video', fixture: 'video_short.webm' })
270 videoUUID = uuid 270 videoUUID = uuid
@@ -384,7 +384,7 @@ describe('Test runner VOD transcoding', function () {
384 before(async function () { 384 before(async function () {
385 this.timeout(60000) 385 this.timeout(60000)
386 386
387 await servers[0].config.enableTranscoding(true, true) 387 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
388 388
389 await servers[0].videos.quickUpload({ name: 'web video and hls video', fixture: 'video_short.webm' }) 389 await servers[0].videos.quickUpload({ name: 'web video and hls video', fixture: 'video_short.webm' })
390 390
@@ -422,7 +422,7 @@ describe('Test runner VOD transcoding', function () {
422 before(async function () { 422 before(async function () {
423 this.timeout(60000) 423 this.timeout(60000)
424 424
425 await servers[0].config.enableTranscoding(true, true) 425 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
426 426
427 const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' } 427 const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' }
428 const { uuid } = await servers[0].videos.upload({ attributes, mode: 'legacy' }) 428 const { uuid } = await servers[0].videos.upload({ attributes, mode: 'legacy' })
diff --git a/server/tests/api/videos/video-files.ts b/server/tests/api/videos/video-files.ts
index 0a183c44d..4f75cd106 100644
--- a/server/tests/api/videos/video-files.ts
+++ b/server/tests/api/videos/video-files.ts
@@ -25,7 +25,7 @@ describe('Test videos files', function () {
25 25
26 await doubleFollow(servers[0], servers[1]) 26 await doubleFollow(servers[0], servers[1])
27 27
28 await servers[0].config.enableTranscoding(true, true) 28 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
29 }) 29 })
30 30
31 describe('When deleting all files', function () { 31 describe('When deleting all files', function () {
diff --git a/server/tests/api/videos/video-source.ts b/server/tests/api/videos/video-source.ts
index 8669f342e..1f394f904 100644
--- a/server/tests/api/videos/video-source.ts
+++ b/server/tests/api/videos/video-source.ts
@@ -114,7 +114,7 @@ describe('Test a video file replacement', function () {
114 114
115 const previousPaths: string[] = [] 115 const previousPaths: string[] = []
116 116
117 await servers[0].config.enableTranscoding(true, true, true) 117 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
118 118
119 const { uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'fs with transcoding', fixture: 'video_short_720p.mp4' }) 119 const { uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'fs with transcoding', fixture: 'video_short_720p.mp4' })
120 uuid = videoUUID 120 uuid = videoUUID
@@ -387,7 +387,7 @@ describe('Test a video file replacement', function () {
387 387
388 const previousPaths: string[] = [] 388 const previousPaths: string[] = []
389 389
390 await servers[0].config.enableTranscoding(true, true, true) 390 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
391 391
392 const { uuid: videoUUID } = await servers[0].videos.quickUpload({ 392 const { uuid: videoUUID } = await servers[0].videos.quickUpload({
393 name: 'object storage with transcoding', 393 name: 'object storage with transcoding',
diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.ts
index ba861164b..f68560b06 100644
--- a/server/tests/api/videos/videos-common-filters.ts
+++ b/server/tests/api/videos/videos-common-filters.ts
@@ -468,19 +468,19 @@ describe('Test videos filter', function () {
468 468
469 const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name) 469 const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name)
470 470
471 await servers[0].config.enableTranscoding(true, false) 471 await servers[0].config.enableTranscoding({ hls: false, webVideo: true })
472 await servers[0].videos.upload({ attributes: { name: 'web video' } }) 472 await servers[0].videos.upload({ attributes: { name: 'web video' } })
473 const hasWebVideo = finderFactory('web video') 473 const hasWebVideo = finderFactory('web video')
474 474
475 await waitJobs(servers) 475 await waitJobs(servers)
476 476
477 await servers[0].config.enableTranscoding(false, true) 477 await servers[0].config.enableTranscoding({ hls: true, webVideo: false })
478 await servers[0].videos.upload({ attributes: { name: 'hls video' } }) 478 await servers[0].videos.upload({ attributes: { name: 'hls video' } })
479 const hasHLS = finderFactory('hls video') 479 const hasHLS = finderFactory('hls video')
480 480
481 await waitJobs(servers) 481 await waitJobs(servers)
482 482
483 await servers[0].config.enableTranscoding(true, true) 483 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
484 await servers[0].videos.upload({ attributes: { name: 'hls and web video' } }) 484 await servers[0].videos.upload({ attributes: { name: 'hls and web video' } })
485 const hasBoth = finderFactory('hls and web video') 485 const hasBoth = finderFactory('hls and web video')
486 486
diff --git a/server/tests/peertube-runner/live-transcoding.ts b/server/tests/peertube-runner/live-transcoding.ts
index 4826c61f7..41b01f8d5 100644
--- a/server/tests/peertube-runner/live-transcoding.ts
+++ b/server/tests/peertube-runner/live-transcoding.ts
@@ -139,7 +139,7 @@ describe('Test Live transcoding in peertube-runner program', function () {
139 sqlCommandServer1 = new SQLCommand(servers[0]) 139 sqlCommandServer1 = new SQLCommand(servers[0])
140 140
141 await servers[0].config.enableRemoteTranscoding() 141 await servers[0].config.enableRemoteTranscoding()
142 await servers[0].config.enableTranscoding(true, true, true) 142 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
143 await servers[0].config.enableLive({ allowReplay: true, resolutions: 'max', transcoding: true }) 143 await servers[0].config.enableLive({ allowReplay: true, resolutions: 'max', transcoding: true })
144 144
145 const registrationToken = await servers[0].runnerRegistrationTokens.getFirstRegistrationToken() 145 const registrationToken = await servers[0].runnerRegistrationTokens.getFirstRegistrationToken()
@@ -152,7 +152,7 @@ describe('Test Live transcoding in peertube-runner program', function () {
152 describe('With lives on local filesystem storage', function () { 152 describe('With lives on local filesystem storage', function () {
153 153
154 before(async function () { 154 before(async function () {
155 await servers[0].config.enableTranscoding(true, false, true) 155 await servers[0].config.enableTranscoding({ webVideo: true, hls: false, with0p: true })
156 }) 156 })
157 157
158 runSuite() 158 runSuite()
diff --git a/server/tests/peertube-runner/studio-transcoding.ts b/server/tests/peertube-runner/studio-transcoding.ts
index c265d7934..56bfef897 100644
--- a/server/tests/peertube-runner/studio-transcoding.ts
+++ b/server/tests/peertube-runner/studio-transcoding.ts
@@ -68,7 +68,7 @@ describe('Test studio transcoding in peertube-runner program', function () {
68 68
69 await doubleFollow(servers[0], servers[1]) 69 await doubleFollow(servers[0], servers[1])
70 70
71 await servers[0].config.enableTranscoding(true, true) 71 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
72 await servers[0].config.enableStudio() 72 await servers[0].config.enableStudio()
73 await servers[0].config.enableRemoteStudio() 73 await servers[0].config.enableRemoteStudio()
74 74
diff --git a/server/tests/peertube-runner/vod-transcoding.ts b/server/tests/peertube-runner/vod-transcoding.ts
index eef6faf4e..b3b62e5e0 100644
--- a/server/tests/peertube-runner/vod-transcoding.ts
+++ b/server/tests/peertube-runner/vod-transcoding.ts
@@ -201,7 +201,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
201 expect(getAllFiles(video)).to.have.lengthOf(1) 201 expect(getAllFiles(video)).to.have.lengthOf(1)
202 } 202 }
203 203
204 await servers[0].config.enableTranscoding(true, true, true) 204 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
205 205
206 await servers[0].videos.runTranscoding({ transcodingType: 'web-video', videoId: uuid }) 206 await servers[0].videos.runTranscoding({ transcodingType: 'web-video', videoId: uuid })
207 await waitJobs(servers, { runnerJobs: true }) 207 await waitJobs(servers, { runnerJobs: true })
@@ -259,7 +259,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
259 describe('Web video only enabled', function () { 259 describe('Web video only enabled', function () {
260 260
261 before(async function () { 261 before(async function () {
262 await servers[0].config.enableTranscoding(true, false, true) 262 await servers[0].config.enableTranscoding({ webVideo: true, hls: false, with0p: true })
263 }) 263 })
264 264
265 runSuite({ webVideoEnabled: true, hlsEnabled: false }) 265 runSuite({ webVideoEnabled: true, hlsEnabled: false })
@@ -268,7 +268,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
268 describe('HLS videos only enabled', function () { 268 describe('HLS videos only enabled', function () {
269 269
270 before(async function () { 270 before(async function () {
271 await servers[0].config.enableTranscoding(false, true, true) 271 await servers[0].config.enableTranscoding({ webVideo: false, hls: true, with0p: true })
272 }) 272 })
273 273
274 runSuite({ webVideoEnabled: false, hlsEnabled: true }) 274 runSuite({ webVideoEnabled: false, hlsEnabled: true })
@@ -277,7 +277,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
277 describe('Web video & HLS enabled', function () { 277 describe('Web video & HLS enabled', function () {
278 278
279 before(async function () { 279 before(async function () {
280 await servers[0].config.enableTranscoding(true, true, true) 280 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
281 }) 281 })
282 282
283 runSuite({ webVideoEnabled: true, hlsEnabled: true }) 283 runSuite({ webVideoEnabled: true, hlsEnabled: true })
@@ -303,7 +303,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
303 describe('Web video only enabled', function () { 303 describe('Web video only enabled', function () {
304 304
305 before(async function () { 305 before(async function () {
306 await servers[0].config.enableTranscoding(true, false, true) 306 await servers[0].config.enableTranscoding({ webVideo: true, hls: false, with0p: true })
307 }) 307 })
308 308
309 runSuite({ webVideoEnabled: true, hlsEnabled: false, objectStorage }) 309 runSuite({ webVideoEnabled: true, hlsEnabled: false, objectStorage })
@@ -312,7 +312,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
312 describe('HLS videos only enabled', function () { 312 describe('HLS videos only enabled', function () {
313 313
314 before(async function () { 314 before(async function () {
315 await servers[0].config.enableTranscoding(false, true, true) 315 await servers[0].config.enableTranscoding({ webVideo: false, hls: true, with0p: true })
316 }) 316 })
317 317
318 runSuite({ webVideoEnabled: false, hlsEnabled: true, objectStorage }) 318 runSuite({ webVideoEnabled: false, hlsEnabled: true, objectStorage })
@@ -321,7 +321,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
321 describe('Web video & HLS enabled', function () { 321 describe('Web video & HLS enabled', function () {
322 322
323 before(async function () { 323 before(async function () {
324 await servers[0].config.enableTranscoding(true, true, true) 324 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
325 }) 325 })
326 326
327 runSuite({ webVideoEnabled: true, hlsEnabled: true, objectStorage }) 327 runSuite({ webVideoEnabled: true, hlsEnabled: true, objectStorage })
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts
index 3521b2d69..5ee2fe021 100644
--- a/shared/server-commands/server/config-command.ts
+++ b/shared/server-commands/server/config-command.ts
@@ -152,8 +152,13 @@ export class ConfigCommand extends AbstractCommand {
152 }) 152 })
153 } 153 }
154 154
155 // TODO: convert args to object 155 enableTranscoding (options: {
156 enableTranscoding (webVideo = true, hls = true, with0p = false) { 156 webVideo?: boolean // default true
157 hls?: boolean // default true
158 with0p?: boolean // default false
159 } = {}) {
160 const { webVideo = true, hls = true, with0p = false } = options
161
157 return this.updateExistingSubConfig({ 162 return this.updateExistingSubConfig({
158 newConfig: { 163 newConfig: {
159 transcoding: { 164 transcoding: {
@@ -175,8 +180,12 @@ export class ConfigCommand extends AbstractCommand {
175 }) 180 })
176 } 181 }
177 182
178 // TODO: convert args to object 183 enableMinimumTranscoding (options: {
179 enableMinimumTranscoding (webVideo = true, hls = true) { 184 webVideo?: boolean // default true
185 hls?: boolean // default true
186 } = {}) {
187 const { webVideo = true, hls = true } = options
188
180 return this.updateExistingSubConfig({ 189 return this.updateExistingSubConfig({
181 newConfig: { 190 newConfig: {
182 transcoding: { 191 transcoding: {