From ecb455b6c42bd75c9d87294c2479fa53b739d0a8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 3 Oct 2017 16:04:14 +0200 Subject: Add migration script --- server/models/video/video.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'server/models/video') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 28df91a7b..b4a2b0c95 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -627,19 +627,13 @@ transcodeOriginalVideofile = function (this: VideoInstance, resolution: VideoRes videoId: this.id }) const videoOutputPath = join(videosDirectory, this.getVideoFilename(newVideoFile)) - const resolutionWidthSizes = { - 1: '240x?', - 2: '360x?', - 3: '480x?', - 4: '720x?', - 5: '1080x?' - } + const resolutionOption = `${resolution}x?` // '720x?' for example return new Promise((res, rej) => { ffmpeg(videoInputPath) .output(videoOutputPath) .videoCodec('libx264') - .size(resolutionWidthSizes[resolution]) + .size(resolutionOption) .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) .outputOption('-movflags faststart') .on('error', rej) -- cgit v1.2.3