]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/transcoding/transcoding.ts
Fix saved live master playlist bandwidth
[github/Chocobozzz/PeerTube.git] / server / lib / transcoding / transcoding.ts
index 07eee4122d3ad761eb34b841d51fb328156cb5d0..44e26754d52954e06fab0236ea3f98b8c3fe1a36 100644 (file)
@@ -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