aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-03 16:04:14 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-03 17:16:47 +0200
commitecb455b6c42bd75c9d87294c2479fa53b739d0a8 (patch)
tree1d9ea1864e3877e1b48bf520e95cdc337d391311 /server/models/video/video.ts
parent40298b02546e8225dd21bf6048fe7f224aefc32a (diff)
downloadPeerTube-ecb455b6c42bd75c9d87294c2479fa53b739d0a8.tar.gz
PeerTube-ecb455b6c42bd75c9d87294c2479fa53b739d0a8.tar.zst
PeerTube-ecb455b6c42bd75c9d87294c2479fa53b739d0a8.zip
Add migration script
Diffstat (limited to 'server/models/video/video.ts')
-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)