1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +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

@ -47,13 +47,13 @@ async function run () {
if (!video) throw new Error('Video not found.')
const dataInput: VideoTranscodingPayload[] = []
const { videoFileResolution } = await video.getMaxQualityResolution()
const { resolution } = await video.getMaxQualityResolution()
// Generate HLS files
if (options.generateHls || CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false) {
const resolutionsEnabled = options.resolution
? [ options.resolution ]
: computeResolutionsToTranscode(videoFileResolution, 'vod').concat([ videoFileResolution ])
: computeResolutionsToTranscode(resolution, 'vod').concat([ resolution ])
for (const resolution of resolutionsEnabled) {
dataInput.push({