1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Improve target bitrate calculation

This commit is contained in:
Chocobozzz 2021-08-06 13:35:25 +02:00
parent c826f34a45
commit 679c12e69c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
24 changed files with 263 additions and 204 deletions

View file

@ -136,7 +136,7 @@ async function onVideoFileOptimizer (
if (videoArg === undefined) return undefined
// Outside the transaction (IO on disk)
const { videoFileResolution, isPortraitMode } = await videoArg.getMaxQualityResolution()
const { resolution, isPortraitMode } = await videoArg.getMaxQualityResolution()
// Maybe the video changed in database, refresh it
const videoDatabase = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoArg.uuid)
@ -155,7 +155,7 @@ async function onVideoFileOptimizer (
})
const hasHls = await createHlsJobIfEnabled(user, originalFileHLSPayload)
const hasNewResolutions = await createLowerResolutionsJobs(videoDatabase, user, videoFileResolution, isPortraitMode, 'webtorrent')
const hasNewResolutions = await createLowerResolutionsJobs(videoDatabase, user, resolution, isPortraitMode, 'webtorrent')
if (!hasHls && !hasNewResolutions) {
// No transcoding to do, it's now published