]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - server/tests/cli/print-transcode-command.ts
Increase captions max size
[github/Chocobozzz/PeerTube.git] / server / tests / cli / print-transcode-command.ts
... / ...
CommitLineData
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2
3import 'mocha'
4import * as chai from 'chai'
5import { buildAbsoluteFixturePath } from '@shared/core-utils'
6import { CLICommand } from '@shared/server-commands'
7import { VideoResolution } from '../../../shared/models/videos'
8
9const expect = chai.expect
10
11describe('Test print transcode jobs', function () {
12
13 it('Should print the correct command for each resolution', async function () {
14 const fixturePath = buildAbsoluteFixturePath('video_short.webm')
15
16 for (const resolution of [
17 VideoResolution.H_720P,
18 VideoResolution.H_1080P
19 ]) {
20 const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`)
21
22 expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`)
23 expect(command).to.includes(`-y -acodec aac -vcodec libx264`)
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')
30 expect(command).to.includes(`-maxrate `)
31 expect(command).to.includes(`-bufsize `)
32 }
33 })
34})