]>
Commit | Line | Data |
---|---|---|
7185dab3 RK |
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | ||
3 | import 'mocha' | |
4 | import * as chai from 'chai' | |
c55e3d72 C |
5 | import { buildAbsoluteFixturePath } from '@shared/core-utils' |
6 | import { CLICommand } from '@shared/server-commands' | |
679c12e6 | 7 | import { VideoResolution } from '../../../shared/models/videos' |
7185dab3 RK |
8 | |
9 | const expect = chai.expect | |
10 | ||
9f430a53 | 11 | describe('Test print transcode jobs', function () { |
329619b3 | 12 | |
7185dab3 | 13 | it('Should print the correct command for each resolution', async function () { |
679c12e6 | 14 | const fixturePath = buildAbsoluteFixturePath('video_short.webm') |
7185dab3 RK |
15 | |
16 | for (const resolution of [ | |
17 | VideoResolution.H_720P, | |
18 | VideoResolution.H_1080P | |
19 | ]) { | |
329619b3 | 20 | const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`) |
7185dab3 | 21 | |
21c917b3 C |
22 | expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`) |
23 | expect(command).to.includes(`-y -acodec aac -vcodec libx264`) | |
7185dab3 RK |
24 | expect(command).to.includes('-f mp4') |
25 | expect(command).to.includes('-movflags faststart') | |
26 | expect(command).to.includes('-b:a 256k') | |
27 | expect(command).to.includes('-r 25') | |
28 | expect(command).to.includes('-level:v 3.1') | |
29 | expect(command).to.includes('-g:v 50') | |
d78b51aa C |
30 | expect(command).to.includes(`-maxrate `) |
31 | expect(command).to.includes(`-bufsize `) | |
7185dab3 RK |
32 | } |
33 | }) | |
34 | }) |