From 84cae54e7a2595bea0c3ea106a4d111fd11a4ec6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Aug 2022 10:36:19 +0200 Subject: Add option to not transcode original resolution --- server/controllers/api/config.ts | 4 +++- server/controllers/api/videos/transcoding.ts | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index cfb750bc9..ff2fa9d86 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts @@ -227,6 +227,7 @@ function customConfig (): CustomConfig { '1440p': CONFIG.TRANSCODING.RESOLUTIONS['1440p'], '2160p': CONFIG.TRANSCODING.RESOLUTIONS['2160p'] }, + alwaysTranscodeOriginalResolution: CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION, webtorrent: { enabled: CONFIG.TRANSCODING.WEBTORRENT.ENABLED }, @@ -256,7 +257,8 @@ function customConfig (): CustomConfig { '1080p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1080p'], '1440p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['1440p'], '2160p': CONFIG.LIVE.TRANSCODING.RESOLUTIONS['2160p'] - } + }, + alwaysTranscodeOriginalResolution: CONFIG.LIVE.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION } }, videoStudio: { diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts index a360a8b6a..09ab7dc0f 100644 --- a/server/controllers/api/videos/transcoding.ts +++ b/server/controllers/api/videos/transcoding.ts @@ -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 }) } } -- cgit v1.2.3