aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-before-init.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index d32ff9b81..9731a0af9 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -69,13 +69,13 @@ function checkMissedConfig () {
69// Check the available codecs 69// Check the available codecs
70// We get CONFIG by param to not import it in this file (import orders) 70// We get CONFIG by param to not import it in this file (import orders)
71async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) { 71async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) {
72 if (CONFIG.TRANSCODING.ENABLED === false) return undefined
73
72 const Ffmpeg = require('fluent-ffmpeg') 74 const Ffmpeg = require('fluent-ffmpeg')
73 const getAvailableCodecsPromise = promisify0(Ffmpeg.getAvailableCodecs) 75 const getAvailableCodecsPromise = promisify0(Ffmpeg.getAvailableCodecs)
74 const codecs = await getAvailableCodecsPromise() 76 const codecs = await getAvailableCodecsPromise()
75 const canEncode = [ 'libx264' ] 77 const canEncode = [ 'libx264' ]
76 78
77 if (CONFIG.TRANSCODING.ENABLED === false) return undefined
78
79 for (const codec of canEncode) { 79 for (const codec of canEncode) {
80 if (codecs[codec] === undefined) { 80 if (codecs[codec] === undefined) {
81 throw new Error('Unknown codec ' + codec + ' in FFmpeg.') 81 throw new Error('Unknown codec ' + codec + ' in FFmpeg.')