diff options
Diffstat (limited to 'server/tests/cli/print-transcode-command.ts')
-rw-r--r-- | server/tests/cli/print-transcode-command.ts | 7 |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { execCLI } from '../../../shared/extra-utils' | 5 | import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils' |
6 | import { CLICommand } from '@shared/extra-utils' | ||
6 | import { getTargetBitrate, VideoResolution } from '../../../shared/models/videos' | 7 | import { getTargetBitrate, VideoResolution } from '../../../shared/models/videos' |
7 | import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants' | 8 | import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants' |
8 | import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils' | ||
9 | 9 | ||
10 | const expect = chai.expect | 10 | const expect = chai.expect |
11 | 11 | ||
12 | describe('Test create transcoding jobs', function () { | 12 | describe('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}`) |