aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts10
1 files changed, 2 insertions, 8 deletions
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
627 videoId: this.id 627 videoId: this.id
628 }) 628 })
629 const videoOutputPath = join(videosDirectory, this.getVideoFilename(newVideoFile)) 629 const videoOutputPath = join(videosDirectory, this.getVideoFilename(newVideoFile))
630 const resolutionWidthSizes = { 630 const resolutionOption = `${resolution}x?` // '720x?' for example
631 1: '240x?',
632 2: '360x?',
633 3: '480x?',
634 4: '720x?',
635 5: '1080x?'
636 }
637 631
638 return new Promise<void>((res, rej) => { 632 return new Promise<void>((res, rej) => {
639 ffmpeg(videoInputPath) 633 ffmpeg(videoInputPath)
640 .output(videoOutputPath) 634 .output(videoOutputPath)
641 .videoCodec('libx264') 635 .videoCodec('libx264')
642 .size(resolutionWidthSizes[resolution]) 636 .size(resolutionOption)
643 .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) 637 .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS)
644 .outputOption('-movflags faststart') 638 .outputOption('-movflags faststart')
645 .on('error', rej) 639 .on('error', rej)