aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/transcoding
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/transcoding')
-rw-r--r--server/tests/api/transcoding/audio-only.ts8
-rw-r--r--server/tests/api/transcoding/create-transcoding.ts18
-rw-r--r--server/tests/api/transcoding/hls.ts8
-rw-r--r--server/tests/api/transcoding/transcoder.ts42
-rw-r--r--server/tests/api/transcoding/update-while-transcoding.ts4
-rw-r--r--server/tests/api/transcoding/video-studio.ts10
6 files changed, 45 insertions, 45 deletions
diff --git a/server/tests/api/transcoding/audio-only.ts b/server/tests/api/transcoding/audio-only.ts
index 1e31418e7..f4cc012ef 100644
--- a/server/tests/api/transcoding/audio-only.ts
+++ b/server/tests/api/transcoding/audio-only.ts
@@ -14,7 +14,7 @@ import {
14describe('Test audio only video transcoding', function () { 14describe('Test audio only video transcoding', function () {
15 let servers: PeerTubeServer[] = [] 15 let servers: PeerTubeServer[] = []
16 let videoUUID: string 16 let videoUUID: string
17 let webtorrentAudioFileUrl: string 17 let webVideoAudioFileUrl: string
18 let fragmentedAudioFileUrl: string 18 let fragmentedAudioFileUrl: string
19 19
20 before(async function () { 20 before(async function () {
@@ -37,7 +37,7 @@ describe('Test audio only video transcoding', function () {
37 hls: { 37 hls: {
38 enabled: true 38 enabled: true
39 }, 39 },
40 webtorrent: { 40 web_videos: {
41 enabled: true 41 enabled: true
42 } 42 }
43 } 43 }
@@ -71,7 +71,7 @@ describe('Test audio only video transcoding', function () {
71 } 71 }
72 72
73 if (server.serverNumber === 1) { 73 if (server.serverNumber === 1) {
74 webtorrentAudioFileUrl = video.files[2].fileUrl 74 webVideoAudioFileUrl = video.files[2].fileUrl
75 fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl 75 fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl
76 } 76 }
77 } 77 }
@@ -79,7 +79,7 @@ describe('Test audio only video transcoding', function () {
79 79
80 it('0p transcoded video should not have video', async function () { 80 it('0p transcoded video should not have video', async function () {
81 const paths = [ 81 const paths = [
82 servers[0].servers.buildWebTorrentFilePath(webtorrentAudioFileUrl), 82 servers[0].servers.buildWebVideoFilePath(webVideoAudioFileUrl),
83 servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl) 83 servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl)
84 ] 84 ]
85 85
diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.ts
index d6f5b01dc..9a891043c 100644
--- a/server/tests/api/transcoding/create-transcoding.ts
+++ b/server/tests/api/transcoding/create-transcoding.ts
@@ -96,12 +96,12 @@ function runTests (enableObjectStorage: boolean) {
96 } 96 }
97 }) 97 })
98 98
99 it('Should generate WebTorrent', async function () { 99 it('Should generate Web Video', async function () {
100 this.timeout(60000) 100 this.timeout(60000)
101 101
102 await servers[0].videos.runTranscoding({ 102 await servers[0].videos.runTranscoding({
103 videoId: videoUUID, 103 videoId: videoUUID,
104 transcodingType: 'webtorrent' 104 transcodingType: 'web-video'
105 }) 105 })
106 106
107 await waitJobs(servers) 107 await waitJobs(servers)
@@ -117,13 +117,13 @@ function runTests (enableObjectStorage: boolean) {
117 } 117 }
118 }) 118 })
119 119
120 it('Should generate WebTorrent from HLS only video', async function () { 120 it('Should generate Web Video from HLS only video', async function () {
121 this.timeout(60000) 121 this.timeout(60000)
122 122
123 await servers[0].videos.removeAllWebTorrentFiles({ videoId: videoUUID }) 123 await servers[0].videos.removeAllWebVideoFiles({ videoId: videoUUID })
124 await waitJobs(servers) 124 await waitJobs(servers)
125 125
126 await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) 126 await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' })
127 await waitJobs(servers) 127 await waitJobs(servers)
128 128
129 for (const server of servers) { 129 for (const server of servers) {
@@ -137,13 +137,13 @@ function runTests (enableObjectStorage: boolean) {
137 } 137 }
138 }) 138 })
139 139
140 it('Should only generate WebTorrent', async function () { 140 it('Should only generate Web Video', async function () {
141 this.timeout(60000) 141 this.timeout(60000)
142 142
143 await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID }) 143 await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID })
144 await waitJobs(servers) 144 await waitJobs(servers)
145 145
146 await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) 146 await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' })
147 await waitJobs(servers) 147 await waitJobs(servers)
148 148
149 for (const server of servers) { 149 for (const server of servers) {
@@ -165,7 +165,7 @@ function runTests (enableObjectStorage: boolean) {
165 enabled: true, 165 enabled: true,
166 resolutions: ConfigCommand.getCustomConfigResolutions(false), 166 resolutions: ConfigCommand.getCustomConfigResolutions(false),
167 167
168 webtorrent: { 168 webVideos: {
169 enabled: true 169 enabled: true
170 }, 170 },
171 hls: { 171 hls: {
@@ -201,7 +201,7 @@ function runTests (enableObjectStorage: boolean) {
201 enabled: true, 201 enabled: true,
202 resolutions: ConfigCommand.getCustomConfigResolutions(true), 202 resolutions: ConfigCommand.getCustomConfigResolutions(true),
203 203
204 webtorrent: { 204 webVideos: {
205 enabled: true 205 enabled: true
206 }, 206 },
207 hls: { 207 hls: {
diff --git a/server/tests/api/transcoding/hls.ts b/server/tests/api/transcoding/hls.ts
index c668d7e0b..d67043c2a 100644
--- a/server/tests/api/transcoding/hls.ts
+++ b/server/tests/api/transcoding/hls.ts
@@ -75,8 +75,8 @@ describe('Test HLS videos', function () {
75 75
76 it('Should have the playlists/segment deleted from the disk', async function () { 76 it('Should have the playlists/segment deleted from the disk', async function () {
77 for (const server of servers) { 77 for (const server of servers) {
78 await checkDirectoryIsEmpty(server, 'videos', [ 'private' ]) 78 await checkDirectoryIsEmpty(server, 'web-videos', [ 'private' ])
79 await checkDirectoryIsEmpty(server, join('videos', 'private')) 79 await checkDirectoryIsEmpty(server, join('web-videos', 'private'))
80 80
81 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls'), [ 'private' ]) 81 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls'), [ 'private' ])
82 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls', 'private')) 82 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls', 'private'))
@@ -111,7 +111,7 @@ describe('Test HLS videos', function () {
111 await doubleFollow(servers[0], servers[1]) 111 await doubleFollow(servers[0], servers[1])
112 }) 112 })
113 113
114 describe('With WebTorrent & HLS enabled', function () { 114 describe('With Web Video & HLS enabled', function () {
115 runTestSuite(false) 115 runTestSuite(false)
116 }) 116 })
117 117
@@ -136,7 +136,7 @@ describe('Test HLS videos', function () {
136 hls: { 136 hls: {
137 enabled: true 137 enabled: true
138 }, 138 },
139 webtorrent: { 139 webVideos: {
140 enabled: false 140 enabled: false
141 } 141 }
142 } 142 }
diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.ts
index 8a0a7f6d2..5386d236f 100644
--- a/server/tests/api/transcoding/transcoder.ts
+++ b/server/tests/api/transcoding/transcoder.ts
@@ -31,7 +31,7 @@ function updateConfigForTranscoding (server: PeerTubeServer) {
31 allowAdditionalExtensions: true, 31 allowAdditionalExtensions: true,
32 allowAudioFiles: true, 32 allowAudioFiles: true,
33 hls: { enabled: true }, 33 hls: { enabled: true },
34 webtorrent: { enabled: true }, 34 webVideos: { enabled: true },
35 resolutions: { 35 resolutions: {
36 '0p': false, 36 '0p': false,
37 '144p': true, 37 '144p': true,
@@ -251,7 +251,7 @@ describe('Test video transcoding', function () {
251 expect(videoDetails.files).to.have.lengthOf(5) 251 expect(videoDetails.files).to.have.lengthOf(5)
252 252
253 const file = videoDetails.files.find(f => f.resolution.id === 240) 253 const file = videoDetails.files.find(f => f.resolution.id === 240)
254 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 254 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
255 const probe = await getAudioStream(path) 255 const probe = await getAudioStream(path)
256 256
257 if (probe.audioStream) { 257 if (probe.audioStream) {
@@ -281,7 +281,7 @@ describe('Test video transcoding', function () {
281 const videoDetails = await server.videos.get({ id: video.id }) 281 const videoDetails = await server.videos.get({ id: video.id })
282 282
283 const file = videoDetails.files.find(f => f.resolution.id === 240) 283 const file = videoDetails.files.find(f => f.resolution.id === 240)
284 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 284 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
285 285
286 expect(await hasAudioStream(path)).to.be.false 286 expect(await hasAudioStream(path)).to.be.false
287 } 287 }
@@ -310,7 +310,7 @@ describe('Test video transcoding', function () {
310 const fixtureVideoProbe = await getAudioStream(fixturePath) 310 const fixtureVideoProbe = await getAudioStream(fixturePath)
311 311
312 const file = videoDetails.files.find(f => f.resolution.id === 240) 312 const file = videoDetails.files.find(f => f.resolution.id === 240)
313 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 313 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
314 314
315 const videoProbe = await getAudioStream(path) 315 const videoProbe = await getAudioStream(path)
316 316
@@ -333,7 +333,7 @@ describe('Test video transcoding', function () {
333 newConfig: { 333 newConfig: {
334 transcoding: { 334 transcoding: {
335 hls: { enabled: true }, 335 hls: { enabled: true },
336 webtorrent: { enabled: true }, 336 webVideos: { enabled: true },
337 resolutions: { 337 resolutions: {
338 '0p': false, 338 '0p': false,
339 '144p': false, 339 '144p': false,
@@ -353,7 +353,7 @@ describe('Test video transcoding', function () {
353 it('Should merge an audio file with the preview file', async function () { 353 it('Should merge an audio file with the preview file', async function () {
354 this.timeout(60_000) 354 this.timeout(60_000)
355 355
356 const attributes = { name: 'audio_with_preview', previewfile: 'preview.jpg', fixture: 'sample.ogg' } 356 const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' }
357 await servers[1].videos.upload({ attributes, mode }) 357 await servers[1].videos.upload({ attributes, mode })
358 358
359 await waitJobs(servers) 359 await waitJobs(servers)
@@ -405,7 +405,7 @@ describe('Test video transcoding', function () {
405 newConfig: { 405 newConfig: {
406 transcoding: { 406 transcoding: {
407 hls: { enabled: true }, 407 hls: { enabled: true },
408 webtorrent: { enabled: true }, 408 webVideos: { enabled: true },
409 resolutions: { 409 resolutions: {
410 '0p': true, 410 '0p': true,
411 '144p': false, 411 '144p': false,
@@ -416,7 +416,7 @@ describe('Test video transcoding', function () {
416 } 416 }
417 }) 417 })
418 418
419 const attributes = { name: 'audio_with_preview', previewfile: 'preview.jpg', fixture: 'sample.ogg' } 419 const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' }
420 const { id } = await servers[1].videos.upload({ attributes, mode }) 420 const { id } = await servers[1].videos.upload({ attributes, mode })
421 421
422 await waitJobs(servers) 422 await waitJobs(servers)
@@ -472,14 +472,14 @@ describe('Test video transcoding', function () {
472 472
473 for (const resolution of [ 144, 240, 360, 480 ]) { 473 for (const resolution of [ 144, 240, 360, 480 ]) {
474 const file = videoDetails.files.find(f => f.resolution.id === resolution) 474 const file = videoDetails.files.find(f => f.resolution.id === resolution)
475 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 475 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
476 const fps = await getVideoStreamFPS(path) 476 const fps = await getVideoStreamFPS(path)
477 477
478 expect(fps).to.be.below(31) 478 expect(fps).to.be.below(31)
479 } 479 }
480 480
481 const file = videoDetails.files.find(f => f.resolution.id === 720) 481 const file = videoDetails.files.find(f => f.resolution.id === 720)
482 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 482 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
483 const fps = await getVideoStreamFPS(path) 483 const fps = await getVideoStreamFPS(path)
484 484
485 expect(fps).to.be.above(58).and.below(62) 485 expect(fps).to.be.above(58).and.below(62)
@@ -516,14 +516,14 @@ describe('Test video transcoding', function () {
516 516
517 { 517 {
518 const file = video.files.find(f => f.resolution.id === 240) 518 const file = video.files.find(f => f.resolution.id === 240)
519 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 519 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
520 const fps = await getVideoStreamFPS(path) 520 const fps = await getVideoStreamFPS(path)
521 expect(fps).to.be.equal(25) 521 expect(fps).to.be.equal(25)
522 } 522 }
523 523
524 { 524 {
525 const file = video.files.find(f => f.resolution.id === 720) 525 const file = video.files.find(f => f.resolution.id === 720)
526 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 526 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
527 const fps = await getVideoStreamFPS(path) 527 const fps = await getVideoStreamFPS(path)
528 expect(fps).to.be.equal(59) 528 expect(fps).to.be.equal(59)
529 } 529 }
@@ -556,7 +556,7 @@ describe('Test video transcoding', function () {
556 556
557 for (const resolution of [ 240, 360, 480, 720, 1080 ]) { 557 for (const resolution of [ 240, 360, 480, 720, 1080 ]) {
558 const file = video.files.find(f => f.resolution.id === resolution) 558 const file = video.files.find(f => f.resolution.id === resolution)
559 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 559 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
560 560
561 const bitrate = await getVideoStreamBitrate(path) 561 const bitrate = await getVideoStreamBitrate(path)
562 const fps = await getVideoStreamFPS(path) 562 const fps = await getVideoStreamFPS(path)
@@ -586,7 +586,7 @@ describe('Test video transcoding', function () {
586 '1440p': true, 586 '1440p': true,
587 '2160p': true 587 '2160p': true
588 }, 588 },
589 webtorrent: { enabled: true }, 589 webVideos: { enabled: true },
590 hls: { enabled: true } 590 hls: { enabled: true }
591 } 591 }
592 } 592 }
@@ -607,7 +607,7 @@ describe('Test video transcoding', function () {
607 for (const r of resolutions) { 607 for (const r of resolutions) {
608 const file = video.files.find(f => f.resolution.id === r) 608 const file = video.files.find(f => f.resolution.id === r)
609 609
610 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 610 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
611 const bitrate = await getVideoStreamBitrate(path) 611 const bitrate = await getVideoStreamBitrate(path)
612 612
613 const inputBitrate = 60_000 613 const inputBitrate = 60_000
@@ -631,7 +631,7 @@ describe('Test video transcoding', function () {
631 { 631 {
632 const video = await servers[1].videos.get({ id: videoUUID }) 632 const video = await servers[1].videos.get({ id: videoUUID })
633 const file = video.files.find(f => f.resolution.id === 240) 633 const file = video.files.find(f => f.resolution.id === 240)
634 const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) 634 const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
635 635
636 const probe = await ffprobePromise(path) 636 const probe = await ffprobePromise(path)
637 const metadata = new VideoFileMetadata(probe) 637 const metadata = new VideoFileMetadata(probe)
@@ -704,14 +704,14 @@ describe('Test video transcoding', function () {
704 expect(transcodingJobs).to.have.lengthOf(16) 704 expect(transcodingJobs).to.have.lengthOf(16)
705 705
706 const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls') 706 const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls')
707 const webtorrentJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-webtorrent') 707 const webVideoJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-web-video')
708 const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-webtorrent') 708 const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-web-video')
709 709
710 expect(hlsJobs).to.have.lengthOf(8) 710 expect(hlsJobs).to.have.lengthOf(8)
711 expect(webtorrentJobs).to.have.lengthOf(7) 711 expect(webVideoJobs).to.have.lengthOf(7)
712 expect(optimizeJobs).to.have.lengthOf(1) 712 expect(optimizeJobs).to.have.lengthOf(1)
713 713
714 for (const j of optimizeJobs.concat(hlsJobs.concat(webtorrentJobs))) { 714 for (const j of optimizeJobs.concat(hlsJobs.concat(webVideoJobs))) {
715 expect(j.priority).to.be.greaterThan(100) 715 expect(j.priority).to.be.greaterThan(100)
716 expect(j.priority).to.be.lessThan(150) 716 expect(j.priority).to.be.lessThan(150)
717 } 717 }
@@ -728,7 +728,7 @@ describe('Test video transcoding', function () {
728 transcoding: { 728 transcoding: {
729 enabled: true, 729 enabled: true,
730 hls: { enabled: true }, 730 hls: { enabled: true },
731 webtorrent: { enabled: true }, 731 webVideos: { enabled: true },
732 resolutions: { 732 resolutions: {
733 '0p': false, 733 '0p': false,
734 '144p': false, 734 '144p': false,
diff --git a/server/tests/api/transcoding/update-while-transcoding.ts b/server/tests/api/transcoding/update-while-transcoding.ts
index 61655f102..cfb4fa0cc 100644
--- a/server/tests/api/transcoding/update-while-transcoding.ts
+++ b/server/tests/api/transcoding/update-while-transcoding.ts
@@ -96,7 +96,7 @@ describe('Test update video privacy while transcoding', function () {
96 await doubleFollow(servers[0], servers[1]) 96 await doubleFollow(servers[0], servers[1])
97 }) 97 })
98 98
99 describe('With WebTorrent & HLS enabled', function () { 99 describe('With Web Video & HLS enabled', function () {
100 runTestSuite(false) 100 runTestSuite(false)
101 }) 101 })
102 102
@@ -121,7 +121,7 @@ describe('Test update video privacy while transcoding', function () {
121 hls: { 121 hls: {
122 enabled: true 122 enabled: true
123 }, 123 },
124 webtorrent: { 124 webVideos: {
125 enabled: false 125 enabled: false
126 } 126 }
127 } 127 }
diff --git a/server/tests/api/transcoding/video-studio.ts b/server/tests/api/transcoding/video-studio.ts
index d1298caf7..ba68f8e24 100644
--- a/server/tests/api/transcoding/video-studio.ts
+++ b/server/tests/api/transcoding/video-studio.ts
@@ -241,7 +241,7 @@ describe('Test video studio', function () {
241 { 241 {
242 name: 'add-watermark', 242 name: 'add-watermark',
243 options: { 243 options: {
244 file: 'thumbnail.png' 244 file: 'custom-thumbnail.png'
245 } 245 }
246 } 246 }
247 ]) 247 ])
@@ -273,11 +273,11 @@ describe('Test video studio', function () {
273 describe('HLS only studio edition', function () { 273 describe('HLS only studio edition', function () {
274 274
275 before(async function () { 275 before(async function () {
276 // Disable webtorrent 276 // Disable Web Videos
277 await servers[0].config.updateExistingSubConfig({ 277 await servers[0].config.updateExistingSubConfig({
278 newConfig: { 278 newConfig: {
279 transcoding: { 279 transcoding: {
280 webtorrent: { 280 webVideos: {
281 enabled: false 281 enabled: false
282 } 282 }
283 } 283 }
@@ -354,8 +354,8 @@ describe('Test video studio', function () {
354 expect(oldFileUrls).to.not.include(f.fileUrl) 354 expect(oldFileUrls).to.not.include(f.fileUrl)
355 } 355 }
356 356
357 for (const webtorrentFile of video.files) { 357 for (const webVideoFile of video.files) {
358 expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) 358 expectStartWith(webVideoFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
359 } 359 }
360 360
361 for (const hlsFile of video.streamingPlaylists[0].files) { 361 for (const hlsFile of video.streamingPlaylists[0].files) {