aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/videos/videos.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 26597cf7b..0b6b8bfe5 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -646,9 +646,10 @@ export async function isVideoAccepted (
646} 646}
647 647
648async function addDurationToVideo (videoFile: { path: string, duration?: number }) { 648async function addDurationToVideo (videoFile: { path: string, duration?: number }) {
649 const duration: number = await getVideoStreamDuration(videoFile.path) 649 const duration = await getVideoStreamDuration(videoFile.path)
650 650
651 if (isNaN(duration)) throw new Error(`Couldn't get video duration`) 651 // FFmpeg may not be able to guess video duration
652 652 // For example with m2v files: https://trac.ffmpeg.org/ticket/9726#comment:2
653 videoFile.duration = duration 653 if (isNaN(duration)) videoFile.duration = 0
654 else videoFile.duration = duration
654} 655}