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