diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-27 15:57:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-27 15:57:43 +0100 |
commit | 056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1 (patch) | |
tree | bf59c7f52be7da2d6bfd7ee18814b9c7f8463966 /server/lib/job-queue/handlers/video-file.ts | |
parent | 6fdc553adb23db216b44e425a85ea76bdf0a2a40 (diff) | |
download | PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.gz PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.zst PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.zip |
Fix resolution for portrait videos
Diffstat (limited to 'server/lib/job-queue/handlers/video-file.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-file.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/lib/job-queue/handlers/video-file.ts b/server/lib/job-queue/handlers/video-file.ts index 5294483bd..bd9412290 100644 --- a/server/lib/job-queue/handlers/video-file.ts +++ b/server/lib/job-queue/handlers/video-file.ts | |||
@@ -11,7 +11,8 @@ import { JobQueue } from '../job-queue' | |||
11 | 11 | ||
12 | export type VideoFilePayload = { | 12 | export type VideoFilePayload = { |
13 | videoUUID: string | 13 | videoUUID: string |
14 | resolution?: VideoResolution | 14 | resolution?: VideoResolution, |
15 | isPortraitMode?: boolean | ||
15 | } | 16 | } |
16 | 17 | ||
17 | async function processVideoFile (job: kue.Job) { | 18 | async function processVideoFile (job: kue.Job) { |
@@ -27,7 +28,7 @@ async function processVideoFile (job: kue.Job) { | |||
27 | 28 | ||
28 | // Transcoding in other resolution | 29 | // Transcoding in other resolution |
29 | if (payload.resolution) { | 30 | if (payload.resolution) { |
30 | await video.transcodeOriginalVideofile(payload.resolution) | 31 | await video.transcodeOriginalVideofile(payload.resolution, payload.isPortraitMode) |
31 | await onVideoFileTranscoderSuccess(video) | 32 | await onVideoFileTranscoderSuccess(video) |
32 | } else { | 33 | } else { |
33 | await video.optimizeOriginalVideofile() | 34 | await video.optimizeOriginalVideofile() |
@@ -66,12 +67,12 @@ async function onVideoFileOptimizerSuccess (video: VideoModel) { | |||
66 | await shareVideoByServerAndChannel(video, undefined) | 67 | await shareVideoByServerAndChannel(video, undefined) |
67 | } | 68 | } |
68 | 69 | ||
69 | const originalFileHeight = await videoDatabase.getOriginalFileHeight() | 70 | const { videoFileResolution } = await videoDatabase.getOriginalFileResolution() |
70 | 71 | ||
71 | // Create transcoding jobs if there are enabled resolutions | 72 | // Create transcoding jobs if there are enabled resolutions |
72 | const resolutionsEnabled = computeResolutionsToTranscode(originalFileHeight) | 73 | const resolutionsEnabled = computeResolutionsToTranscode(videoFileResolution) |
73 | logger.info( | 74 | logger.info( |
74 | 'Resolutions computed for video %s and origin file height of %d.', videoDatabase.uuid, originalFileHeight, | 75 | 'Resolutions computed for video %s and origin file height of %d.', videoDatabase.uuid, videoFileResolution, |
75 | { resolutions: resolutionsEnabled } | 76 | { resolutions: resolutionsEnabled } |
76 | ) | 77 | ) |
77 | 78 | ||