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
+23
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;