aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-27 15:57:28 +0100
committerChocobozzz <me@florianbigard.com>2018-02-27 15:57:43 +0100
commit056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1 (patch)
treebf59c7f52be7da2d6bfd7ee18814b9c7f8463966 /server/models/video/video.ts
parent6fdc553adb23db216b44e425a85ea76bdf0a2a40 (diff)
downloadPeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.gz
PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.zst
PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.zip
Fix resolution for portrait videos
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts11
1 files changed, 6 insertions, 5 deletions
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 {
42 isVideoNameValid, 42 isVideoNameValid,
43 isVideoPrivacyValid, isVideoSupportValid 43 isVideoPrivacyValid, isVideoSupportValid
44} from '../../helpers/custom-validators/videos' 44} from '../../helpers/custom-validators/videos'
45import { generateImageFromVideoFile, getVideoFileHeight, transcode } from '../../helpers/ffmpeg-utils' 45import { generateImageFromVideoFile, getVideoFileResolution, transcode } from '../../helpers/ffmpeg-utils'
46import { logger } from '../../helpers/logger' 46import { logger } from '../../helpers/logger'
47import { getServerActor } from '../../helpers/utils' 47import { getServerActor } from '../../helpers/utils'
48import { 48import {
@@ -1140,7 +1140,7 @@ export class VideoModel extends Model<VideoModel> {
1140 } 1140 }
1141 } 1141 }
1142 1142
1143 transcodeOriginalVideofile = async function (resolution: VideoResolution) { 1143 transcodeOriginalVideofile = async function (resolution: VideoResolution, isPortraitMode: boolean) {
1144 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR 1144 const videosDirectory = CONFIG.STORAGE.VIDEOS_DIR
1145 const extname = '.mp4' 1145 const extname = '.mp4'
1146 1146
@@ -1158,7 +1158,8 @@ export class VideoModel extends Model<VideoModel> {
1158 const transcodeOptions = { 1158 const transcodeOptions = {
1159 inputPath: videoInputPath, 1159 inputPath: videoInputPath,
1160 outputPath: videoOutputPath, 1160 outputPath: videoOutputPath,
1161 resolution 1161 resolution,
1162 isPortraitMode
1162 } 1163 }
1163 1164
1164 await transcode(transcodeOptions) 1165 await transcode(transcodeOptions)
@@ -1174,10 +1175,10 @@ export class VideoModel extends Model<VideoModel> {
1174 this.VideoFiles.push(newVideoFile) 1175 this.VideoFiles.push(newVideoFile)
1175 } 1176 }
1176 1177
1177 getOriginalFileHeight () { 1178 getOriginalFileResolution () {
1178 const originalFilePath = this.getVideoFilePath(this.getOriginalFile()) 1179 const originalFilePath = this.getVideoFilePath(this.getOriginalFile())
1179 1180
1180 return getVideoFileHeight(originalFilePath) 1181 return getVideoFileResolution(originalFilePath)
1181 } 1182 }
1182 1183
1183 getDescriptionPath () { 1184 getDescriptionPath () {