]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/checker-after-init.ts
Add option to not transcode original resolution
[github/Chocobozzz/PeerTube.git] / server / initializers / checker-after-init.ts
index 635a32010b66dab45b1130daabff4e5ff0ada095..f0f16d9bd1b3d16323cc19e8ad6787e248f78615 100644 (file)
@@ -4,7 +4,7 @@ import { URL } from 'url'
 import { getFFmpegVersion } from '@server/helpers/ffmpeg'
 import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
 import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
-import { isProdInstance, isTestInstance, parseSemVersion } from '../helpers/core-utils'
+import { isProdInstance, parseSemVersion } from '../helpers/core-utils'
 import { isArray } from '../helpers/custom-validators/misc'
 import { logger } from '../helpers/logger'
 import { ApplicationModel, getServerActor } from '../models/application/application'
@@ -34,6 +34,9 @@ async function checkActivityPubUrls () {
 // Some checks on configuration files or throw if there is an error
 function checkConfig () {
 
+  const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ')
+  logger.info('Using following configuration file hierarchy: %s.', configFiles)
+
   // Moved configuration keys
   if (config.has('services.csp-logger')) {
     logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.')
@@ -49,7 +52,7 @@ function checkConfig () {
   checkSearchConfig()
   checkLiveConfig()
   checkObjectStorageConfig()
-  checkVideoEditorConfig()
+  checkVideoStudioConfig()
 }
 
 // We get db by param to not import it in this file (import orders)
@@ -75,10 +78,14 @@ async function applicationExist () {
 
 async function checkFFmpegVersion () {
   const version = await getFFmpegVersion()
-  const { major, minor } = parseSemVersion(version)
+  const { major, minor, patch } = parseSemVersion(version)
 
   if (major < 4 || (major === 4 && minor < 1)) {
-    logger.warn('Your ffmpeg version (%s) is outdated. PeerTube supports ffmpeg >= 4.1. Please upgrade.', version)
+    logger.warn('Your ffmpeg version (%s) is outdated. PeerTube supports ffmpeg >= 4.1. Please upgrade ffmpeg.', version)
+  }
+
+  if (major === 4 && minor === 4 && patch === 0) {
+    logger.warn('There is a bug in ffmpeg 4.4.0 with HLS videos. Please upgrade ffmpeg.')
   }
 }
 
@@ -128,7 +135,7 @@ function checkLocalRedundancyConfig () {
       }
 
       // Lifetime should not be < 10 hours
-      if (!isTestInstance() && r.minLifetime < 1000 * 3600 * 10) {
+      if (isProdInstance() && r.minLifetime < 1000 * 3600 * 10) {
         throw new Error('Video redundancy minimum lifetime should be >= 10 hours for strategy ' + r.strategy)
       }
     }
@@ -260,8 +267,8 @@ function checkObjectStorageConfig () {
   }
 }
 
-function checkVideoEditorConfig () {
-  if (CONFIG.VIDEO_EDITOR.ENABLED === true && CONFIG.TRANSCODING.ENABLED === false) {
-    throw new Error('Video editor cannot be enabled if transcoding is disabled')
+function checkVideoStudioConfig () {
+  if (CONFIG.VIDEO_STUDIO.ENABLED === true && CONFIG.TRANSCODING.ENABLED === false) {
+    throw new Error('Video studio cannot be enabled if transcoding is disabled')
   }
 }