From e7d8e2b245491c0a8e008fb570037506d729ff04 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 May 2023 10:53:04 +0200 Subject: Fix audio transcoding copy --- server/tests/api/transcoding/transcoder.ts | 6 +++--- server/tests/helpers/core-utils.ts | 6 +++--- server/tests/peertube-runner/live-transcoding.ts | 2 +- server/tests/peertube-runner/studio-transcoding.ts | 2 +- server/tests/shared/generate.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'server/tests') diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.ts index fa78b58bb..8a0a7f6d2 100644 --- a/server/tests/api/transcoding/transcoder.ts +++ b/server/tests/api/transcoding/transcoder.ts @@ -3,7 +3,7 @@ import { expect } from 'chai' import { canDoQuickTranscode } from '@server/lib/transcoding/transcoding-quick-transcode' import { checkWebTorrentWorks, generateHighBitrateVideo, generateVideoWithFramerate } from '@server/tests/shared' -import { buildAbsoluteFixturePath, getAllFiles, getMaxBitrate, getMinLimitBitrate, omit } from '@shared/core-utils' +import { buildAbsoluteFixturePath, getAllFiles, getMaxTheoreticalBitrate, getMinTheoreticalBitrate, omit } from '@shared/core-utils' import { ffprobePromise, getAudioStream, @@ -564,7 +564,7 @@ describe('Test video transcoding', function () { expect(resolution).to.equal(resolution) - const maxBitrate = getMaxBitrate({ ...dataResolution, fps }) + const maxBitrate = getMaxTheoreticalBitrate({ ...dataResolution, fps }) expect(bitrate).to.be.below(maxBitrate) } } @@ -611,7 +611,7 @@ describe('Test video transcoding', function () { const bitrate = await getVideoStreamBitrate(path) const inputBitrate = 60_000 - const limit = getMinLimitBitrate({ fps: 10, ratio: 1, resolution: r }) + const limit = getMinTheoreticalBitrate({ fps: 10, ratio: 1, resolution: r }) let belowValue = Math.max(inputBitrate, limit) belowValue += belowValue * 0.20 // Apply 20% margin because bitrate control is not very precise diff --git a/server/tests/helpers/core-utils.ts b/server/tests/helpers/core-utils.ts index de6ba4f82..cd2f07e4a 100644 --- a/server/tests/helpers/core-utils.ts +++ b/server/tests/helpers/core-utils.ts @@ -3,7 +3,7 @@ import { expect } from 'chai' import { snakeCase } from 'lodash' import validator from 'validator' -import { getAverageBitrate, getMaxBitrate } from '@shared/core-utils' +import { getAverageTheoreticalBitrate, getMaxTheoreticalBitrate } from '@shared/core-utils' import { VideoResolution } from '@shared/models' import { objectConverter, parseBytes, parseDurationToMs } from '../../helpers/core-utils' @@ -128,7 +128,7 @@ describe('Bitrate', function () { ] for (const test of tests) { - expect(getMaxBitrate(test)).to.be.above(test.min * 1000).and.below(test.max * 1000) + expect(getMaxTheoreticalBitrate(test)).to.be.above(test.min * 1000).and.below(test.max * 1000) } }) @@ -144,7 +144,7 @@ describe('Bitrate', function () { ] for (const test of tests) { - expect(getAverageBitrate(test)).to.be.above(test.min * 1000).and.below(test.max * 1000) + expect(getAverageTheoreticalBitrate(test)).to.be.above(test.min * 1000).and.below(test.max * 1000) } }) }) diff --git a/server/tests/peertube-runner/live-transcoding.ts b/server/tests/peertube-runner/live-transcoding.ts index 1e94eabcd..31716d545 100644 --- a/server/tests/peertube-runner/live-transcoding.ts +++ b/server/tests/peertube-runner/live-transcoding.ts @@ -145,7 +145,7 @@ describe('Test Live transcoding in peertube-runner program', function () { const registrationToken = await servers[0].runnerRegistrationTokens.getFirstRegistrationToken() peertubeRunner = new PeerTubeRunnerProcess() - await peertubeRunner.runServer({ hideLogs: false }) + await peertubeRunner.runServer() await peertubeRunner.registerPeerTubeInstance({ server: servers[0], registrationToken, runnerName: 'runner' }) }) diff --git a/server/tests/peertube-runner/studio-transcoding.ts b/server/tests/peertube-runner/studio-transcoding.ts index cca905e2f..204836c4d 100644 --- a/server/tests/peertube-runner/studio-transcoding.ts +++ b/server/tests/peertube-runner/studio-transcoding.ts @@ -75,7 +75,7 @@ describe('Test studio transcoding in peertube-runner program', function () { const registrationToken = await servers[0].runnerRegistrationTokens.getFirstRegistrationToken() peertubeRunner = new PeerTubeRunnerProcess() - await peertubeRunner.runServer({ hideLogs: false }) + await peertubeRunner.runServer() await peertubeRunner.registerPeerTubeInstance({ server: servers[0], registrationToken, runnerName: 'runner' }) }) diff --git a/server/tests/shared/generate.ts b/server/tests/shared/generate.ts index b0c8dba66..3788b049f 100644 --- a/server/tests/shared/generate.ts +++ b/server/tests/shared/generate.ts @@ -2,7 +2,7 @@ import { expect } from 'chai' import ffmpeg from 'fluent-ffmpeg' import { ensureDir, pathExists } from 'fs-extra' import { dirname } from 'path' -import { buildAbsoluteFixturePath, getMaxBitrate } from '@shared/core-utils' +import { buildAbsoluteFixturePath, getMaxTheoreticalBitrate } from '@shared/core-utils' import { getVideoStreamBitrate, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@shared/ffmpeg' async function ensureHasTooBigBitrate (fixturePath: string) { @@ -10,7 +10,7 @@ async function ensureHasTooBigBitrate (fixturePath: string) { const dataResolution = await getVideoStreamDimensionsInfo(fixturePath) const fps = await getVideoStreamFPS(fixturePath) - const maxBitrate = getMaxBitrate({ ...dataResolution, fps }) + const maxBitrate = getMaxTheoreticalBitrate({ ...dataResolution, fps }) expect(bitrate).to.be.above(maxBitrate) } -- cgit v1.2.3