aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-transcoder.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-15 15:56:56 +0100
committerGitHub <noreply@github.com>2021-01-15 15:56:56 +0100
commit454c20fa7cdb05eba7f1be3c83389b54807af0b3 (patch)
treee9b364da69eaf88f0470414c506c3b5631984c60 /server/tests/api/videos/video-transcoder.ts
parentd43c6b1ffc5e6c895f9e9f9de6625f17a9755c20 (diff)
downloadPeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.tar.gz
PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.tar.zst
PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.zip
stricter youtubedl format selectors (#3516)
* stricter youtubedl format selectors make sure selectors avoid av1, and otherwise match as closely to the maximum resolution enabled for transcoding * add support for merge formats in youtubedl * avoid vp9.2 in youtubedl to avoid any HDR * move getEnabledResolutions, safer replace of imported extension * add test for youtube-dl selectors
Diffstat (limited to 'server/tests/api/videos/video-transcoder.ts')
-rw-r--r--server/tests/api/videos/video-transcoder.ts36
1 files changed, 18 insertions, 18 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 817d9faf2..32f566506 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -45,7 +45,7 @@ describe('Test video transcoding', function () {
45 let servers: ServerInfo[] = [] 45 let servers: ServerInfo[] = []
46 46
47 before(async function () { 47 before(async function () {
48 this.timeout(30000) 48 this.timeout(30_000)
49 49
50 // Run servers 50 // Run servers
51 servers = await flushAndRunMultipleServers(2) 51 servers = await flushAndRunMultipleServers(2)
@@ -56,7 +56,7 @@ describe('Test video transcoding', function () {
56 }) 56 })
57 57
58 it('Should not transcode video on server 1', async function () { 58 it('Should not transcode video on server 1', async function () {
59 this.timeout(60000) 59 this.timeout(60_000)
60 60
61 const videoAttributes = { 61 const videoAttributes = {
62 name: 'my super name for server 1', 62 name: 'my super name for server 1',
@@ -86,7 +86,7 @@ describe('Test video transcoding', function () {
86 }) 86 })
87 87
88 it('Should transcode video on server 2', async function () { 88 it('Should transcode video on server 2', async function () {
89 this.timeout(120000) 89 this.timeout(120_000)
90 90
91 const videoAttributes = { 91 const videoAttributes = {
92 name: 'my super name for server 2', 92 name: 'my super name for server 2',
@@ -117,7 +117,7 @@ describe('Test video transcoding', function () {
117 }) 117 })
118 118
119 it('Should transcode high bit rate mp3 to proper bit rate', async function () { 119 it('Should transcode high bit rate mp3 to proper bit rate', async function () {
120 this.timeout(60000) 120 this.timeout(60_000)
121 121
122 const videoAttributes = { 122 const videoAttributes = {
123 name: 'mp3_256k', 123 name: 'mp3_256k',
@@ -149,7 +149,7 @@ describe('Test video transcoding', function () {
149 }) 149 })
150 150
151 it('Should transcode video with no audio and have no audio itself', async function () { 151 it('Should transcode video with no audio and have no audio itself', async function () {
152 this.timeout(60000) 152 this.timeout(60_000)
153 153
154 const videoAttributes = { 154 const videoAttributes = {
155 name: 'no_audio', 155 name: 'no_audio',
@@ -174,7 +174,7 @@ describe('Test video transcoding', function () {
174 }) 174 })
175 175
176 it('Should leave the audio untouched, but properly transcode the video', async function () { 176 it('Should leave the audio untouched, but properly transcode the video', async function () {
177 this.timeout(60000) 177 this.timeout(60_000)
178 178
179 const videoAttributes = { 179 const videoAttributes = {
180 name: 'untouched_audio', 180 name: 'untouched_audio',
@@ -209,7 +209,7 @@ describe('Test video transcoding', function () {
209 }) 209 })
210 210
211 it('Should transcode a 60 FPS video', async function () { 211 it('Should transcode a 60 FPS video', async function () {
212 this.timeout(60000) 212 this.timeout(60_000)
213 213
214 const videoAttributes = { 214 const videoAttributes = {
215 name: 'my super 30fps name for server 2', 215 name: 'my super 30fps name for server 2',
@@ -248,7 +248,7 @@ describe('Test video transcoding', function () {
248 }) 248 })
249 249
250 it('Should wait for transcoding before publishing the video', async function () { 250 it('Should wait for transcoding before publishing the video', async function () {
251 this.timeout(160000) 251 this.timeout(160_000)
252 252
253 { 253 {
254 // Upload the video, but wait transcoding 254 // Upload the video, but wait transcoding
@@ -301,7 +301,7 @@ describe('Test video transcoding', function () {
301 }) 301 })
302 302
303 it('Should respect maximum bitrate values', async function () { 303 it('Should respect maximum bitrate values', async function () {
304 this.timeout(160000) 304 this.timeout(160_000)
305 305
306 let tempFixturePath: string 306 let tempFixturePath: string
307 307
@@ -341,7 +341,7 @@ describe('Test video transcoding', function () {
341 }) 341 })
342 342
343 it('Should accept and transcode additional extensions', async function () { 343 it('Should accept and transcode additional extensions', async function () {
344 this.timeout(300000) 344 this.timeout(300_000)
345 345
346 let tempFixturePath: string 346 let tempFixturePath: string
347 347
@@ -378,14 +378,14 @@ describe('Test video transcoding', function () {
378 }) 378 })
379 379
380 it('Should correctly detect if quick transcode is possible', async function () { 380 it('Should correctly detect if quick transcode is possible', async function () {
381 this.timeout(10000) 381 this.timeout(10_000)
382 382
383 expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.mp4'))).to.be.true 383 expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.mp4'))).to.be.true
384 expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.webm'))).to.be.false 384 expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.webm'))).to.be.false
385 }) 385 })
386 386
387 it('Should merge an audio file with the preview file', async function () { 387 it('Should merge an audio file with the preview file', async function () {
388 this.timeout(60000) 388 this.timeout(60_000)
389 389
390 const videoAttributesArg = { name: 'audio_with_preview', previewfile: 'preview.jpg', fixture: 'sample.ogg' } 390 const videoAttributesArg = { name: 'audio_with_preview', previewfile: 'preview.jpg', fixture: 'sample.ogg' }
391 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributesArg) 391 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributesArg)
@@ -410,7 +410,7 @@ describe('Test video transcoding', function () {
410 }) 410 })
411 411
412 it('Should upload an audio file and choose a default background image', async function () { 412 it('Should upload an audio file and choose a default background image', async function () {
413 this.timeout(60000) 413 this.timeout(60_000)
414 414
415 const videoAttributesArg = { name: 'audio_without_preview', fixture: 'sample.ogg' } 415 const videoAttributesArg = { name: 'audio_without_preview', fixture: 'sample.ogg' }
416 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributesArg) 416 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributesArg)
@@ -435,7 +435,7 @@ describe('Test video transcoding', function () {
435 }) 435 })
436 436
437 it('Should downscale to the closest divisor standard framerate', async function () { 437 it('Should downscale to the closest divisor standard framerate', async function () {
438 this.timeout(200000) 438 this.timeout(200_000)
439 439
440 let tempFixturePath: string 440 let tempFixturePath: string
441 441
@@ -476,7 +476,7 @@ describe('Test video transcoding', function () {
476 }) 476 })
477 477
478 it('Should not transcode to an higher bitrate than the original file', async function () { 478 it('Should not transcode to an higher bitrate than the original file', async function () {
479 this.timeout(160000) 479 this.timeout(160_000)
480 480
481 const config = { 481 const config = {
482 transcoding: { 482 transcoding: {
@@ -508,12 +508,12 @@ describe('Test video transcoding', function () {
508 508
509 const resolutions = [ 240, 360, 480, 720, 1080 ] 509 const resolutions = [ 240, 360, 480, 720, 1080 ]
510 for (const r of resolutions) { 510 for (const r of resolutions) {
511 expect(await getServerFileSize(servers[1], `videos/${videoUUID}-${r}.mp4`)).to.be.below(60000) 511 expect(await getServerFileSize(servers[1], `videos/${videoUUID}-${r}.mp4`)).to.be.below(60_000)
512 } 512 }
513 }) 513 })
514 514
515 it('Should provide valid ffprobe data', async function () { 515 it('Should provide valid ffprobe data', async function () {
516 this.timeout(160000) 516 this.timeout(160_000)
517 517
518 const videoUUID = (await uploadVideoAndGetId({ server: servers[1], videoName: 'ffprobe data' })).uuid 518 const videoUUID = (await uploadVideoAndGetId({ server: servers[1], videoName: 'ffprobe data' })).uuid
519 await waitJobs(servers) 519 await waitJobs(servers)
@@ -570,7 +570,7 @@ describe('Test video transcoding', function () {
570 }) 570 })
571 571
572 it('Should transcode a 4k video', async function () { 572 it('Should transcode a 4k video', async function () {
573 this.timeout(200000) 573 this.timeout(200_000)
574 574
575 const videoAttributes = { 575 const videoAttributes = {
576 name: '4k video', 576 name: '4k video',