]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/ffprobe-utils.ts
Support progress for ffmpeg tasks
[github/Chocobozzz/PeerTube.git] / server / helpers / ffprobe-utils.ts
index 1cf397767e807a2ce06947ecdca5b793524afeb3..adb459ed39042b67e13c0f8b8af8a0e9fb6b1bd4 100644 (file)
@@ -164,7 +164,7 @@ async function getVideoFileBitrate (path: string, existingProbe?: ffmpeg.Ffprobe
 async function getDurationFromVideoFile (path: string, existingProbe?: ffmpeg.FfprobeData) {
   const metadata = await getMetadataFromFile(path, existingProbe)
 
-  return Math.floor(metadata.format.duration)
+  return Math.round(metadata.format.duration)
 }
 
 async function getVideoStreamFromFile (path: string, existingProbe?: ffmpeg.FfprobeData) {
@@ -188,6 +188,7 @@ function computeResolutionsToTranscode (videoFileResolution: number, type: 'vod'
     VideoResolution.H_720P,
     VideoResolution.H_240P,
     VideoResolution.H_1080P,
+    VideoResolution.H_1440P,
     VideoResolution.H_4K
   ]