From e4fc3697acb27c4192cbbb63eb94272a6cf7ce32 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Sep 2022 09:21:42 +0200 Subject: Fix saved live master playlist bandwidth --- server/lib/transcoding/transcoding.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/lib/transcoding') diff --git a/server/lib/transcoding/transcoding.ts b/server/lib/transcoding/transcoding.ts index 07eee4122..44e26754d 100644 --- a/server/lib/transcoding/transcoding.ts +++ b/server/lib/transcoding/transcoding.ts @@ -342,6 +342,12 @@ async function generateHlsPlaylistCommon (options: { // Move video file await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true }) + // Update video duration if it was not set (in case of a live for example) + if (!video.duration) { + video.duration = await getVideoStreamDuration(videoFilePath) + await video.save() + } + const stats = await stat(videoFilePath) newVideoFile.size = stats.size -- cgit v1.2.3