From 056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 27 Feb 2018 15:57:28 +0100 Subject: Fix resolution for portrait videos --- server/models/video/video.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'server/models/video') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 4e065e377..80ca513bf 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -42,7 +42,7 @@ import { isVideoNameValid, isVideoPrivacyValid, isVideoSupportValid } from '../../helpers/custom-validators/videos' -import { generateImageFromVideoFile, getVideoFileHeight, transcode } from '../../helpers/ffmpeg-utils' +import { generateImageFromVideoFile, getVideoFileResolution, transcode } from '../../helpers/ffmpeg-utils' import { logger } from '../../helpers/logger' import { getServerActor } from '../../helpers/utils' import { @@ -1140,7 +1140,7 @@ export class VideoModel extends Model { } } - transcodeOriginalVideofile = async function (resolution: VideoResolution) { + transcodeOriginalVideofile = async function (resolution: VideoResolution, isPortraitMode: boolean) { const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR const extname = '.mp4' @@ -1158,7 +1158,8 @@ export class VideoModel extends Model { const transcodeOptions = { inputPath: videoInputPath, outputPath: videoOutputPath, - resolution + resolution, + isPortraitMode } await transcode(transcodeOptions) @@ -1174,10 +1175,10 @@ export class VideoModel extends Model { this.VideoFiles.push(newVideoFile) } - getOriginalFileHeight () { + getOriginalFileResolution () { const originalFilePath = this.getVideoFilePath(this.getOriginalFile()) - return getVideoFileHeight(originalFilePath) + return getVideoFileResolution(originalFilePath) } getDescriptionPath () { -- cgit v1.2.3