Avoid circular error in logger
This commit is contained in:
parent
5d9e4eaabe
commit
959dbbd7bf
2 changed files with 22 additions and 12 deletions
|
@ -69,13 +69,13 @@ function checkMissedConfig () {
|
|||
// Check the available codecs
|
||||
// We get CONFIG by param to not import it in this file (import orders)
|
||||
async function checkFFmpeg (CONFIG: { TRANSCODING: { ENABLED: boolean } }) {
|
||||
if (CONFIG.TRANSCODING.ENABLED === false) return undefined
|
||||
|
||||
const Ffmpeg = require('fluent-ffmpeg')
|
||||
const getAvailableCodecsPromise = promisify0(Ffmpeg.getAvailableCodecs)
|
||||
const codecs = await getAvailableCodecsPromise()
|
||||
const canEncode = [ 'libx264' ]
|
||||
|
||||
if (CONFIG.TRANSCODING.ENABLED === false) return undefined
|
||||
|
||||
for (const codec of canEncode) {
|
||||
if (codecs[codec] === undefined) {
|
||||
throw new Error('Unknown codec ' + codec + ' in FFmpeg.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue