You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
21 lines
524 B
JavaScript
21 lines
524 B
JavaScript
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;
|