diff options
Diffstat (limited to 'shared/extra-utils/ffprobe.ts')
-rw-r--r-- | shared/extra-utils/ffprobe.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/shared/extra-utils/ffprobe.ts b/shared/extra-utils/ffprobe.ts index b95202464..b8e9f4c18 100644 --- a/shared/extra-utils/ffprobe.ts +++ b/shared/extra-utils/ffprobe.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ffprobe, FfprobeData } from 'fluent-ffmpeg' | 1 | import { ffprobe, FfprobeData } from 'fluent-ffmpeg' |
2 | import { VideoFileMetadata } from '@shared/models/videos' | 2 | import { VideoFileMetadata, VideoResolution } from '@shared/models/videos' |
3 | 3 | ||
4 | /** | 4 | /** |
5 | * | 5 | * |
@@ -103,7 +103,15 @@ function getMaxAudioBitrate (type: 'aac' | 'mp3' | string, bitrate: number) { | |||
103 | 103 | ||
104 | async function getVideoStreamDimensionsInfo (path: string, existingProbe?: FfprobeData) { | 104 | async function getVideoStreamDimensionsInfo (path: string, existingProbe?: FfprobeData) { |
105 | const videoStream = await getVideoStream(path, existingProbe) | 105 | const videoStream = await getVideoStream(path, existingProbe) |
106 | if (!videoStream) return undefined | 106 | if (!videoStream) { |
107 | return { | ||
108 | width: 0, | ||
109 | height: 0, | ||
110 | ratio: 0, | ||
111 | resolution: VideoResolution.H_NOVIDEO, | ||
112 | isPortraitMode: false | ||
113 | } | ||
114 | } | ||
107 | 115 | ||
108 | return { | 116 | return { |
109 | width: videoStream.width, | 117 | width: videoStream.width, |