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
bkram ffmpeg removal implementation
This commit is contained in:
committed by
GitHub
parent
ea3b0d8ced
commit
64f41b93ae
23
server/stream/checkFFmpeg.js
Normal file
23
server/stream/checkFFmpeg.js
Normal 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;
|
||||
Reference in New Issue
Block a user