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/models | |
parent | 6fdc553adb23db216b44e425a85ea76bdf0a2a40 (diff) | |
download | PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.gz PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.tar.zst PeerTube-056aa7f2b4de1ef128a5fd35527de6dd7a9ebad1.zip |
Fix resolution for portrait videos
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 11 |
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' |
45 | import { generateImageFromVideoFile, getVideoFileHeight, transcode } from '../../helpers/ffmpeg-utils' | 45 | import { generateImageFromVideoFile, getVideoFileResolution, transcode } from '../../helpers/ffmpeg-utils' |
46 | import { logger } from '../../helpers/logger' | 46 | import { logger } from '../../helpers/logger' |
47 | import { getServerActor } from '../../helpers/utils' | 47 | import { getServerActor } from '../../helpers/utils' |
48 | import { | 48 | import { |
@@ -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 () { |