diff options
Diffstat (limited to 'server/models/video/video.ts')
-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 () { |