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