1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

bkram ffmpeg removal implementation

This commit is contained in:
Amateur Audio Dude
2025-04-20 22:31:14 +10:00
committed by GitHub
parent ea3b0d8ced
commit 64f41b93ae
2 changed files with 156 additions and 58 deletions

View File

@@ -0,0 +1,23 @@
const { spawn } = require('child_process');
function checkFFmpeg() {
return new Promise((resolve, reject) => {
const checkFFmpegProcess = spawn('ffmpeg', ['-version'], {
stdio: ['ignore', 'ignore', 'ignore'],
});
checkFFmpegProcess.on('error', () => {
resolve(require('ffmpeg-static'));
});
checkFFmpegProcess.on('exit', (code) => {
if (code === 0) {
resolve('ffmpeg');
} else {
resolve(require('ffmpeg-static'));
}
});
});
}
module.exports = checkFFmpeg;