1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Fix bitrate tests

This commit is contained in:
Chocobozzz 2021-10-12 09:18:54 +02:00
parent 41085b1583
commit 9f430a53be
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 17 additions and 11 deletions

View file

@ -9,7 +9,7 @@ import { VideoResolution } from '../../../shared/models/videos'
const expect = chai.expect
describe('Test create transcoding jobs', function () {
describe('Test print transcode jobs', function () {
it('Should print the correct command for each resolution', async function () {
const fixturePath = buildAbsoluteFixturePath('video_short.webm')
@ -21,7 +21,7 @@ describe('Test create transcoding jobs', function () {
VideoResolution.H_1080P
]) {
const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`)
const targetBitrate = Math.min(getMaxBitrate({ resolution, fps, ratio: 16 / 9 }), bitrate)
const targetBitrate = Math.min(getMaxBitrate({ resolution, fps, ratio: 16 / 9 }), bitrate + (bitrate * 0.3))
expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`)
expect(command).to.includes(`-y -acodec aac -vcodec libx264`)