From 9f430a53be016f8db2736d5d8111282660b50f4c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Oct 2021 09:18:54 +0200 Subject: Fix bitrate tests --- server/tests/api/live/live.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'server/tests/api/live') diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index 5cac3bc4e..0b405dd94 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -517,10 +517,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 +566,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) -- cgit v1.2.3