aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-13 09:52:41 +0100
committerChocobozzz <me@florianbigard.com>2021-01-13 09:52:52 +0100
commitf5961a8cdfca43ffee00aea2d14302b00d356d07 (patch)
tree42c7d1a8f98713e341dcc62dd2d48c447a6dd1fb
parent78d62f4d182be2f72f4901c38a0d10bb147896e8 (diff)
downloadPeerTube-f5961a8cdfca43ffee00aea2d14302b00d356d07.tar.gz
PeerTube-f5961a8cdfca43ffee00aea2d14302b00d356d07.tar.zst
PeerTube-f5961a8cdfca43ffee00aea2d14302b00d356d07.zip
Add 4k transcoding test
-rw-r--r--server/tests/api/videos/video-transcoder.ts32
-rw-r--r--server/tests/fixtures/video_short_4k.mp4bin0 -> 526882 bytes
2 files changed, 31 insertions, 1 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index f88c59f0d..817d9faf2 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -486,7 +486,9 @@ describe('Test video transcoding', function () {
486 '360p': true, 486 '360p': true,
487 '480p': true, 487 '480p': true,
488 '720p': true, 488 '720p': true,
489 '1080p': true 489 '1080p': true,
490 '1440p': true,
491 '2160p': true
490 }, 492 },
491 webtorrent: { enabled: true }, 493 webtorrent: { enabled: true },
492 hls: { enabled: true } 494 hls: { enabled: true }
@@ -567,6 +569,34 @@ describe('Test video transcoding', function () {
567 } 569 }
568 }) 570 })
569 571
572 it('Should transcode a 4k video', async function () {
573 this.timeout(200000)
574
575 const videoAttributes = {
576 name: '4k video',
577 fixture: 'video_short_4k.mp4'
578 }
579
580 const resUpload = await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
581 const videoUUID = resUpload.body.video.uuid
582
583 await waitJobs(servers)
584
585 const resolutions = [ 240, 360, 480, 720, 1080, 1440, 2160 ]
586
587 for (const server of servers) {
588 const res = await getVideo(server.url, videoUUID)
589 const videoDetails: VideoDetails = res.body
590
591 expect(videoDetails.files).to.have.lengthOf(resolutions.length)
592
593 for (const r of resolutions) {
594 expect(videoDetails.files.find(f => f.resolution.id === r)).to.not.be.undefined
595 expect(videoDetails.streamingPlaylists[0].files.find(f => f.resolution.id === r)).to.not.be.undefined
596 }
597 }
598 })
599
570 after(async function () { 600 after(async function () {
571 await cleanupTests(servers) 601 await cleanupTests(servers)
572 }) 602 })
diff --git a/server/tests/fixtures/video_short_4k.mp4 b/server/tests/fixtures/video_short_4k.mp4
new file mode 100644
index 000000000..e17e03e6f
--- /dev/null
+++ b/server/tests/fixtures/video_short_4k.mp4
Binary files differ