aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-05 10:53:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2023-05-09 08:57:34 +0200
commite7d8e2b245491c0a8e008fb570037506d729ff04 (patch)
treed850a7f82cc02946f2e87b306d0b281cef5eb73d /server/tests/api
parentdd3f99434cc3cb7226d33ffcd888c91d0ce150a9 (diff)
downloadPeerTube-e7d8e2b245491c0a8e008fb570037506d729ff04.tar.gz
PeerTube-e7d8e2b245491c0a8e008fb570037506d729ff04.tar.zst
PeerTube-e7d8e2b245491c0a8e008fb570037506d729ff04.zip
Fix audio transcoding copy
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/transcoding/transcoder.ts6
1 files changed, 3 insertions, 3 deletions
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 @@
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { canDoQuickTranscode } from '@server/lib/transcoding/transcoding-quick-transcode' 4import { canDoQuickTranscode } from '@server/lib/transcoding/transcoding-quick-transcode'
5import { checkWebTorrentWorks, generateHighBitrateVideo, generateVideoWithFramerate } from '@server/tests/shared' 5import { checkWebTorrentWorks, generateHighBitrateVideo, generateVideoWithFramerate } from '@server/tests/shared'
6import { buildAbsoluteFixturePath, getAllFiles, getMaxBitrate, getMinLimitBitrate, omit } from '@shared/core-utils' 6import { buildAbsoluteFixturePath, getAllFiles, getMaxTheoreticalBitrate, getMinTheoreticalBitrate, omit } from '@shared/core-utils'
7import { 7import {
8 ffprobePromise, 8 ffprobePromise,
9 getAudioStream, 9 getAudioStream,
@@ -564,7 +564,7 @@ describe('Test video transcoding', function () {
564 564
565 expect(resolution).to.equal(resolution) 565 expect(resolution).to.equal(resolution)
566 566
567 const maxBitrate = getMaxBitrate({ ...dataResolution, fps }) 567 const maxBitrate = getMaxTheoreticalBitrate({ ...dataResolution, fps })
568 expect(bitrate).to.be.below(maxBitrate) 568 expect(bitrate).to.be.below(maxBitrate)
569 } 569 }
570 } 570 }
@@ -611,7 +611,7 @@ describe('Test video transcoding', function () {
611 const bitrate = await getVideoStreamBitrate(path) 611 const bitrate = await getVideoStreamBitrate(path)
612 612
613 const inputBitrate = 60_000 613 const inputBitrate = 60_000
614 const limit = getMinLimitBitrate({ fps: 10, ratio: 1, resolution: r }) 614 const limit = getMinTheoreticalBitrate({ fps: 10, ratio: 1, resolution: r })
615 let belowValue = Math.max(inputBitrate, limit) 615 let belowValue = Math.max(inputBitrate, limit)
616 belowValue += belowValue * 0.20 // Apply 20% margin because bitrate control is not very precise 616 belowValue += belowValue * 0.20 // Apply 20% margin because bitrate control is not very precise
617 617