1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add option to not transcode original resolution

This commit is contained in:
Chocobozzz 2022-08-05 10:36:19 +02:00
parent 7e0f50d6e0
commit 84cae54e7a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
26 changed files with 303 additions and 87 deletions

View file

@ -1,5 +1,5 @@
import express from 'express'
import { computeLowerResolutionsToTranscode } from '@server/helpers/ffmpeg'
import { computeResolutionsToTranscode } from '@server/helpers/ffmpeg'
import { logger, loggerTagsFactory } from '@server/helpers/logger'
import { addTranscodingJob } from '@server/lib/video'
import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models'
@ -30,9 +30,9 @@ async function createTranscoding (req: express.Request, res: express.Response) {
const body: VideoTranscodingCreate = req.body
const { resolution: maxResolution, isPortraitMode, audioStream } = await video.probeMaxQualityFile()
const { resolution: maxResolution, audioStream } = await video.probeMaxQualityFile()
const resolutions = await Hooks.wrapObject(
computeLowerResolutionsToTranscode(maxResolution, 'vod').concat([ maxResolution ]),
computeResolutionsToTranscode({ inputResolution: maxResolution, type: 'vod', includeInputResolution: true }),
'filter:transcoding.manual.lower-resolutions-to-transcode.result',
body
)
@ -50,7 +50,6 @@ async function createTranscoding (req: express.Request, res: express.Response) {
type: 'new-resolution-to-hls',
videoUUID: video.uuid,
resolution,
isPortraitMode,
hasAudio: !!audioStream,
copyCodecs: false,
isNewVideo: false,
@ -64,8 +63,7 @@ async function createTranscoding (req: express.Request, res: express.Response) {
isNewVideo: false,
resolution,
hasAudio: !!audioStream,
createHLSIfNeeded: false,
isPortraitMode
createHLSIfNeeded: false
})
}
}