X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fcli%2Fprint-transcode-command.ts;h=0b86292516771b2306c5ebb74ce7570ebb912925;hb=fa66c9a601d69f6d57c956a3513e8bbed7ee9616;hp=e328a60721788d192df8384f1bb12bee20203443;hpb=679c12e69c9f3a2d003ee3abe8b8da49f25b2bd3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.ts index e328a6072..0b8629251 100644 --- a/server/tests/cli/print-transcode-command.ts +++ b/server/tests/cli/print-transcode-command.ts @@ -2,26 +2,21 @@ import 'mocha' import * as chai from 'chai' -import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils' -import { getMaxBitrate } from '@shared/core-utils' import { buildAbsoluteFixturePath, CLICommand } from '@shared/extra-utils' 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') - const fps = await getVideoFileFPS(fixturePath) - const bitrate = await getVideoFileBitrate(fixturePath) for (const resolution of [ VideoResolution.H_720P, 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) expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`) expect(command).to.includes(`-y -acodec aac -vcodec libx264`) @@ -31,8 +26,8 @@ describe('Test create transcoding jobs', function () { expect(command).to.includes('-r 25') expect(command).to.includes('-level:v 3.1') expect(command).to.includes('-g:v 50') - expect(command).to.includes(`-maxrate ${targetBitrate}`) - expect(command).to.includes(`-bufsize ${targetBitrate * 2}`) + expect(command).to.includes(`-maxrate `) + expect(command).to.includes(`-bufsize `) } }) })