]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/ffprobe-utils.ts
Correctlu throws an error on manifestIncompatibleCodecsError
[github/Chocobozzz/PeerTube.git] / server / helpers / ffprobe-utils.ts
index 1cf397767e807a2ce06947ecdca5b793524afeb3..5b1ad9066b215d4b6b975e23ac1bdbbe07d81aee 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
   ]
 
@@ -201,6 +202,8 @@ function computeResolutionsToTranscode (videoFileResolution: number, type: 'vod'
 }
 
 async function canDoQuickTranscode (path: string): Promise<boolean> {
+  if (CONFIG.TRANSCODING.PROFILE !== 'default') return false
+
   const probe = await ffprobePromise(path)
 
   return await canDoQuickVideoTranscode(path, probe) &&