diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-12 09:18:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-12 09:18:54 +0200 |
commit | 9f430a53be016f8db2736d5d8111282660b50f4c (patch) | |
tree | 42be1b6a4b0c48f99a42f6462da2307f18d57bdc /server/tests/cli/print-transcode-command.ts | |
parent | 41085b1583ade5ea1bb1d69965a62b98cf012209 (diff) | |
download | PeerTube-9f430a53be016f8db2736d5d8111282660b50f4c.tar.gz PeerTube-9f430a53be016f8db2736d5d8111282660b50f4c.tar.zst PeerTube-9f430a53be016f8db2736d5d8111282660b50f4c.zip |
Fix bitrate tests
Diffstat (limited to 'server/tests/cli/print-transcode-command.ts')
-rw-r--r-- | server/tests/cli/print-transcode-command.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.ts index e328a6072..e2cca17f9 100644 --- a/server/tests/cli/print-transcode-command.ts +++ b/server/tests/cli/print-transcode-command.ts | |||
@@ -9,7 +9,7 @@ import { VideoResolution } from '../../../shared/models/videos' | |||
9 | 9 | ||
10 | const expect = chai.expect | 10 | const expect = chai.expect |
11 | 11 | ||
12 | describe('Test create transcoding jobs', function () { | 12 | describe('Test print transcode jobs', function () { |
13 | 13 | ||
14 | it('Should print the correct command for each resolution', async function () { | 14 | it('Should print the correct command for each resolution', async function () { |
15 | const fixturePath = buildAbsoluteFixturePath('video_short.webm') | 15 | const fixturePath = buildAbsoluteFixturePath('video_short.webm') |
@@ -21,7 +21,7 @@ describe('Test create transcoding jobs', function () { | |||
21 | VideoResolution.H_1080P | 21 | VideoResolution.H_1080P |
22 | ]) { | 22 | ]) { |
23 | const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`) | 23 | const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`) |
24 | const targetBitrate = Math.min(getMaxBitrate({ resolution, fps, ratio: 16 / 9 }), bitrate) | 24 | const targetBitrate = Math.min(getMaxBitrate({ resolution, fps, ratio: 16 / 9 }), bitrate + (bitrate * 0.3)) |
25 | 25 | ||
26 | expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`) | 26 | expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`) |
27 | expect(command).to.includes(`-y -acodec aac -vcodec libx264`) | 27 | expect(command).to.includes(`-y -acodec aac -vcodec libx264`) |