aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/print-transcode-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/cli/print-transcode-command.ts')
-rw-r--r--server/tests/cli/print-transcode-command.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.ts
index 2d7255db7..3a7969e68 100644
--- a/server/tests/cli/print-transcode-command.ts
+++ b/server/tests/cli/print-transcode-command.ts
@@ -2,14 +2,15 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { execCLI } from '../../../shared/extra-utils' 5import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils'
6import { CLICommand } from '@shared/extra-utils'
6import { getTargetBitrate, VideoResolution } from '../../../shared/models/videos' 7import { getTargetBitrate, VideoResolution } from '../../../shared/models/videos'
7import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants' 8import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants'
8import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils'
9 9
10const expect = chai.expect 10const expect = chai.expect
11 11
12describe('Test create transcoding jobs', function () { 12describe('Test create transcoding jobs', function () {
13
13 it('Should print the correct command for each resolution', async function () { 14 it('Should print the correct command for each resolution', async function () {
14 const fixturePath = 'server/tests/fixtures/video_short.webm' 15 const fixturePath = 'server/tests/fixtures/video_short.webm'
15 const fps = await getVideoFileFPS(fixturePath) 16 const fps = await getVideoFileFPS(fixturePath)
@@ -19,7 +20,7 @@ describe('Test create transcoding jobs', function () {
19 VideoResolution.H_720P, 20 VideoResolution.H_720P,
20 VideoResolution.H_1080P 21 VideoResolution.H_1080P
21 ]) { 22 ]) {
22 const command = await execCLI(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`) 23 const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`)
23 const targetBitrate = Math.min(getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS), bitrate) 24 const targetBitrate = Math.min(getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS), bitrate)
24 25
25 expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`) 26 expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`)