diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-03 16:03:52 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-03 16:03:52 +0200 |
commit | dca0fe12ec2e47be51884c4eb05ebe6f358cb9de (patch) | |
tree | 19a9b5d905a6eaccda680b14e1b86b43577ca29d /server/lib/job-queue/handlers | |
parent | 2045b572233d1ee81fb1c14e33fc22b805cd7230 (diff) | |
download | PeerTube-dca0fe12ec2e47be51884c4eb05ebe6f358cb9de.tar.gz PeerTube-dca0fe12ec2e47be51884c4eb05ebe6f358cb9de.tar.zst PeerTube-dca0fe12ec2e47be51884c4eb05ebe6f358cb9de.zip |
Fix resolution for portrait videos
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index ce1c419e7..7ebef46b4 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -75,7 +75,7 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O | |||
75 | if (videoArg === undefined) return undefined | 75 | if (videoArg === undefined) return undefined |
76 | 76 | ||
77 | // Outside the transaction (IO on disk) | 77 | // Outside the transaction (IO on disk) |
78 | const { videoFileResolution } = await videoArg.getMaxQualityResolution() | 78 | const { videoFileResolution, isPortraitMode } = await videoArg.getMaxQualityResolution() |
79 | 79 | ||
80 | const { videoDatabase, videoPublished } = await sequelizeTypescript.transaction(async t => { | 80 | const { videoDatabase, videoPublished } = await sequelizeTypescript.transaction(async t => { |
81 | // Maybe the video changed in database, refresh it | 81 | // Maybe the video changed in database, refresh it |
@@ -86,7 +86,7 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O | |||
86 | // Create transcoding jobs if there are enabled resolutions | 86 | // Create transcoding jobs if there are enabled resolutions |
87 | const resolutionsEnabled = computeResolutionsToTranscode(videoFileResolution) | 87 | const resolutionsEnabled = computeResolutionsToTranscode(videoFileResolution) |
88 | logger.info( | 88 | logger.info( |
89 | 'Resolutions computed for video %s and origin file height of %d.', videoDatabase.uuid, videoFileResolution, | 89 | 'Resolutions computed for video %s and origin file resolution of %d.', videoDatabase.uuid, videoFileResolution, |
90 | { resolutions: resolutionsEnabled } | 90 | { resolutions: resolutionsEnabled } |
91 | ) | 91 | ) |
92 | 92 | ||
@@ -104,14 +104,15 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O | |||
104 | dataInput = { | 104 | dataInput = { |
105 | type: 'new-resolution' as 'new-resolution', | 105 | type: 'new-resolution' as 'new-resolution', |
106 | videoUUID: videoDatabase.uuid, | 106 | videoUUID: videoDatabase.uuid, |
107 | resolution | 107 | resolution, |
108 | isPortraitMode | ||
108 | } | 109 | } |
109 | } else if (CONFIG.TRANSCODING.HLS.ENABLED) { | 110 | } else if (CONFIG.TRANSCODING.HLS.ENABLED) { |
110 | dataInput = { | 111 | dataInput = { |
111 | type: 'hls', | 112 | type: 'hls', |
112 | videoUUID: videoDatabase.uuid, | 113 | videoUUID: videoDatabase.uuid, |
113 | resolution, | 114 | resolution, |
114 | isPortraitMode: false, | 115 | isPortraitMode, |
115 | copyCodecs: false | 116 | copyCodecs: false |
116 | } | 117 | } |
117 | } | 118 | } |