diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-20 15:06:56 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-20 15:11:31 +0100 |
commit | d218e7de9400938ae6ac593d9ae5842e23abd4f0 (patch) | |
tree | f73795a2e9bea35d53923c8ac6a12098357152b9 /server/tests/api | |
parent | da2516fde1ad8f049c99ba5fd98c37425f379199 (diff) | |
download | PeerTube-d218e7de9400938ae6ac593d9ae5842e23abd4f0.tar.gz PeerTube-d218e7de9400938ae6ac593d9ae5842e23abd4f0.tar.zst PeerTube-d218e7de9400938ae6ac593d9ae5842e23abd4f0.zip |
Do not transcode to an higher bitrate
Thanks bkil https://github.com/bkil
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index a1959e1a9..a3d7b8707 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -20,6 +20,7 @@ import { | |||
20 | generateHighBitrateVideo, | 20 | generateHighBitrateVideo, |
21 | generateVideoWithFramerate, | 21 | generateVideoWithFramerate, |
22 | getMyVideos, | 22 | getMyVideos, |
23 | getServerFileSize, | ||
23 | getVideo, | 24 | getVideo, |
24 | getVideoFileMetadataUrl, | 25 | getVideoFileMetadataUrl, |
25 | getVideosList, | 26 | getVideosList, |
@@ -27,6 +28,7 @@ import { | |||
27 | root, | 28 | root, |
28 | ServerInfo, | 29 | ServerInfo, |
29 | setAccessTokensToServers, | 30 | setAccessTokensToServers, |
31 | updateCustomSubConfig, | ||
30 | uploadVideo, uploadVideoAndGetId, | 32 | uploadVideo, uploadVideoAndGetId, |
31 | waitJobs, | 33 | waitJobs, |
32 | webtorrentAdd | 34 | webtorrentAdd |
@@ -468,6 +470,41 @@ describe('Test video transcoding', function () { | |||
468 | } | 470 | } |
469 | }) | 471 | }) |
470 | 472 | ||
473 | it('Should not transcode to an higher bitrate than the original file', async function () { | ||
474 | this.timeout(160000) | ||
475 | |||
476 | const config = { | ||
477 | transcoding: { | ||
478 | enabled: true, | ||
479 | resolutions: { | ||
480 | '240p': true, | ||
481 | '360p': true, | ||
482 | '480p': true, | ||
483 | '720p': true, | ||
484 | '1080p': true | ||
485 | }, | ||
486 | webtorrent: { enabled: true }, | ||
487 | hls: { enabled: true } | ||
488 | } | ||
489 | } | ||
490 | await updateCustomSubConfig(servers[1].url, servers[1].accessToken, config) | ||
491 | |||
492 | const videoAttributes = { | ||
493 | name: 'low bitrate', | ||
494 | fixture: 'low-bitrate.mp4' | ||
495 | } | ||
496 | |||
497 | const resUpload = await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) | ||
498 | const videoUUID = resUpload.body.video.uuid | ||
499 | |||
500 | await waitJobs(servers) | ||
501 | |||
502 | const resolutions = [ 240, 360, 480, 720, 1080 ] | ||
503 | for (const r of resolutions) { | ||
504 | expect(await getServerFileSize(servers[1], `videos/${videoUUID}-${r}.mp4`)).to.be.below(43) | ||
505 | } | ||
506 | }) | ||
507 | |||
471 | it('Should provide valid ffprobe data', async function () { | 508 | it('Should provide valid ffprobe data', async function () { |
472 | this.timeout(160000) | 509 | this.timeout(160000) |
473 | 510 | ||