]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/tests/cli/print-transcode-command.ts
Fix comments SQL pagination
[github/Chocobozzz/PeerTube.git] / server / tests / cli / print-transcode-command.ts
CommitLineData
7185dab3
RK
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2
86347717 3import { expect } from 'chai'
c55e3d72
C
4import { buildAbsoluteFixturePath } from '@shared/core-utils'
5import { CLICommand } from '@shared/server-commands'
679c12e6 6import { VideoResolution } from '../../../shared/models/videos'
7185dab3 7
9f430a53 8describe('Test print transcode jobs', function () {
329619b3 9
7185dab3 10 it('Should print the correct command for each resolution', async function () {
679c12e6 11 const fixturePath = buildAbsoluteFixturePath('video_short.webm')
7185dab3
RK
12
13 for (const resolution of [
14 VideoResolution.H_720P,
15 VideoResolution.H_1080P
16 ]) {
329619b3 17 const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`)
7185dab3 18
21c917b3
C
19 expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`)
20 expect(command).to.includes(`-y -acodec aac -vcodec libx264`)
7185dab3
RK
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')
06ac1289
C
27 expect(command).to.includes(`-maxrate:v `)
28 expect(command).to.includes(`-bufsize:v `)
7185dab3
RK
29 }
30 })
31})