diff options
Diffstat (limited to 'server/initializers/checker-before-init.ts')
-rw-r--r-- | server/initializers/checker-before-init.ts | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index 7945e8586..9c4e0048a 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -97,34 +97,6 @@ async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) { | |||
97 | throw new Error('Unavailable encode codec ' + codec + ' in FFmpeg') | 97 | throw new Error('Unavailable encode codec ' + codec + ' in FFmpeg') |
98 | } | 98 | } |
99 | } | 99 | } |
100 | |||
101 | return checkFFmpegEncoders() | ||
102 | } | ||
103 | |||
104 | // Detect supported encoders by ffmpeg | ||
105 | let supportedEncoders: Map<string, boolean> | ||
106 | async function checkFFmpegEncoders (): Promise<Map<string, boolean>> { | ||
107 | if (supportedEncoders !== undefined) { | ||
108 | return supportedEncoders | ||
109 | } | ||
110 | |||
111 | const Ffmpeg = require('fluent-ffmpeg') | ||
112 | const getAvailableEncodersPromise = promisify0(Ffmpeg.getAvailableEncoders) | ||
113 | const availableEncoders = await getAvailableEncodersPromise() | ||
114 | |||
115 | const searchEncoders = [ | ||
116 | 'aac', | ||
117 | 'libfdk_aac', | ||
118 | 'libx264' | ||
119 | ] | ||
120 | |||
121 | supportedEncoders = new Map<string, boolean>() | ||
122 | |||
123 | for (const searchEncoder of searchEncoders) { | ||
124 | supportedEncoders.set(searchEncoder, availableEncoders[searchEncoder] !== undefined) | ||
125 | } | ||
126 | |||
127 | return supportedEncoders | ||
128 | } | 100 | } |
129 | 101 | ||
130 | function checkNodeVersion () { | 102 | function checkNodeVersion () { |
@@ -143,7 +115,6 @@ function checkNodeVersion () { | |||
143 | 115 | ||
144 | export { | 116 | export { |
145 | checkFFmpeg, | 117 | checkFFmpeg, |
146 | checkFFmpegEncoders, | ||
147 | checkMissedConfig, | 118 | checkMissedConfig, |
148 | checkNodeVersion | 119 | checkNodeVersion |
149 | } | 120 | } |