[mirotalksfu] - autodetect default ffmpegPath for Rtmp streaming
هذا الالتزام موجود في:
@@ -2,9 +2,30 @@
|
||||
|
||||
const { PassThrough } = require('stream');
|
||||
const ffmpeg = require('fluent-ffmpeg');
|
||||
const ffmpegPath = '/usr/local/bin/ffmpeg'; // /usr/bin/ffmpeg (Linux) | /usr/local/bin/ffmpeg (Mac)
|
||||
|
||||
const os = require('os');
|
||||
|
||||
const platform = os.platform();
|
||||
let ffmpegPath;
|
||||
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
ffmpegPath = '/usr/local/bin/ffmpeg'; // macOS
|
||||
break;
|
||||
case 'linux':
|
||||
ffmpegPath = '/usr/bin/ffmpeg'; // Linux
|
||||
break;
|
||||
case 'win32':
|
||||
ffmpegPath = 'C:\\ffmpeg\\bin\\ffmpeg.exe'; // Windows
|
||||
break;
|
||||
default:
|
||||
ffmpegPath = '/usr/bin/ffmpeg'; // Centos or others...
|
||||
}
|
||||
|
||||
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||
|
||||
console.log('FFmpeg', { platform, ffmpegPath });
|
||||
|
||||
class RtmpStreamer {
|
||||
constructor(rtmpUrl, rtmpKey) {
|
||||
this.rtmpUrl = rtmpUrl;
|
||||
|
||||
@@ -2,9 +2,30 @@
|
||||
|
||||
const { PassThrough } = require('stream');
|
||||
const ffmpeg = require('fluent-ffmpeg');
|
||||
const ffmpegPath = '/usr/local/bin/ffmpeg'; // /usr/bin/ffmpeg (Linux) | /usr/local/bin/ffmpeg (Mac)
|
||||
|
||||
const os = require('os');
|
||||
|
||||
const platform = os.platform();
|
||||
let ffmpegPath;
|
||||
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
ffmpegPath = '/usr/local/bin/ffmpeg'; // macOS
|
||||
break;
|
||||
case 'linux':
|
||||
ffmpegPath = '/usr/bin/ffmpeg'; // Linux
|
||||
break;
|
||||
case 'win32':
|
||||
ffmpegPath = 'C:\\ffmpeg\\bin\\ffmpeg.exe'; // Windows
|
||||
break;
|
||||
default:
|
||||
ffmpegPath = '/usr/bin/ffmpeg'; // Centos or others...
|
||||
}
|
||||
|
||||
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||
|
||||
console.log('FFmpeg', { platform, ffmpegPath });
|
||||
|
||||
class RtmpStreamer {
|
||||
constructor(rtmpUrl, rtmpKey, socket) {
|
||||
(this.socket = socket), (this.rtmpUrl = rtmpUrl);
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم