]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live.ts
Added 144p encoding (#4492)
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live.ts
index ba952aff57c2204e45fa45f2b4cb62447ebef8cd..619602d0b89d17632899017304c320b972956a6b 100644 (file)
@@ -421,6 +421,7 @@ describe('Test live', function () {
             transcoding: {
               enabled: true,
               resolutions: {
+                '144p': resolutions.includes(144),
                 '240p': resolutions.includes(240),
                 '360p': resolutions.includes(360),
                 '480p': resolutions.includes(480),
@@ -439,7 +440,7 @@ describe('Test live', function () {
     })
 
     it('Should enable transcoding without additional resolutions', async function () {
-      this.timeout(60000)
+      this.timeout(120000)
 
       liveVideoId = await createLiveWrapper(false)
 
@@ -453,7 +454,7 @@ describe('Test live', function () {
     })
 
     it('Should enable transcoding with some resolutions', async function () {
-      this.timeout(60000)
+      this.timeout(120000)
 
       const resolutions = [ 240, 480 ]
       await updateConf(resolutions)
@@ -517,10 +518,16 @@ describe('Test live', function () {
 
       await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
 
-      const bitrateLimits = {
-        720: 5000 * 1000, // 60FPS
-        360: 1100 * 1000,
-        240: 600 * 1000
+      const maxBitrateLimits = {
+        720: 6500 * 1000, // 60FPS
+        360: 1250 * 1000,
+        240: 700 * 1000
+      }
+
+      const minBitrateLimits = {
+        720: 5500 * 1000,
+        360: 1000 * 1000,
+        240: 550 * 1000
       }
 
       for (const server of servers) {
@@ -560,7 +567,8 @@ describe('Test live', function () {
           const probe = await ffprobePromise(segmentPath)
           const videoStream = await getVideoStreamFromFile(segmentPath, probe)
 
-          expect(probe.format.bit_rate).to.be.below(bitrateLimits[videoStream.height])
+          expect(probe.format.bit_rate).to.be.below(maxBitrateLimits[videoStream.height])
+          expect(probe.format.bit_rate).to.be.at.least(minBitrateLimits[videoStream.height])
 
           await makeRawRequest(file.torrentUrl, HttpStatusCode.OK_200)
           await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200)