[mirotalksfu] - autodetect default ffmpegPath for Rtmp streaming
هذا الالتزام موجود في:
@@ -1,7 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const ffmpegPath = config.server.rtmp && config.server.rtmp.ffmpeg ? config.server.rtmp.ffmpeg : '/usr/bin/ffmpeg';
|
const ffmpegPath =
|
||||||
|
config.server.rtmp && config.server.rtmp.ffmpegPath ? config.server.rtmp.ffmpegPath : '/usr/bin/ffmpeg';
|
||||||
const ffmpeg = require('fluent-ffmpeg');
|
const ffmpeg = require('fluent-ffmpeg');
|
||||||
ffmpeg.setFfmpegPath(ffmpegPath);
|
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const { PassThrough } = require('stream');
|
const { PassThrough } = require('stream');
|
||||||
const ffmpeg = require('fluent-ffmpeg');
|
const ffmpeg = require('fluent-ffmpeg');
|
||||||
const ffmpegPath = config.server.rtmp && config.server.rtmp.ffmpeg ? config.server.rtmp.ffmpeg : '/usr/bin/ffmpeg';
|
const ffmpegPath =
|
||||||
|
config.server.rtmp && config.server.rtmp.ffmpegPath ? config.server.rtmp.ffmpegPath : '/usr/bin/ffmpeg';
|
||||||
ffmpeg.setFfmpegPath(ffmpegPath);
|
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||||
|
|
||||||
const Logger = require('./Logger');
|
const Logger = require('./Logger');
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const ffmpegPath = config.server.rtmp && config.server.rtmp.ffmpeg ? config.server.rtmp.ffmpeg : '/usr/bin/ffmpeg';
|
const ffmpegPath =
|
||||||
|
config.server.rtmp && config.server.rtmp.ffmpegPath ? config.server.rtmp.ffmpegPath : '/usr/bin/ffmpeg';
|
||||||
const ffmpeg = require('fluent-ffmpeg');
|
const ffmpeg = require('fluent-ffmpeg');
|
||||||
ffmpeg.setFfmpegPath(ffmpegPath);
|
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ dev dependencies: {
|
|||||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.7.03
|
* @version 1.7.04
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,28 @@
|
|||||||
|
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
|
||||||
|
// #############################
|
||||||
|
// HELPERS
|
||||||
|
// #############################
|
||||||
|
|
||||||
|
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...
|
||||||
|
}
|
||||||
|
|
||||||
// https://api.ipify.org
|
// https://api.ipify.org
|
||||||
|
|
||||||
function getIPv4() {
|
function getIPv4() {
|
||||||
@@ -99,7 +121,8 @@ module.exports = {
|
|||||||
- apiSecret: The API secret for streaming WebRTC to RTMP through the MiroTalk API.
|
- apiSecret: The API secret for streaming WebRTC to RTMP through the MiroTalk API.
|
||||||
- expirationHours: The number of hours before the RTMP URL expires. Default is 4 hours.
|
- expirationHours: The number of hours before the RTMP URL expires. Default is 4 hours.
|
||||||
- dir: Directory where your video files are stored to be streamed via RTMP.
|
- dir: Directory where your video files are stored to be streamed via RTMP.
|
||||||
- ffmpeg: Path of the ffmpeg installation on the system (which ffmpeg)
|
- ffmpegPath: Path of the ffmpeg installation on the system (which ffmpeg)
|
||||||
|
- platform: OS es darwin, linux, win32....
|
||||||
|
|
||||||
Important: Before proceeding, make sure your RTMP server is up and running.
|
Important: Before proceeding, make sure your RTMP server is up and running.
|
||||||
For more information, refer to the documentation here: https://docs.mirotalk.com/mirotalk-sfu/rtmp/.
|
For more information, refer to the documentation here: https://docs.mirotalk.com/mirotalk-sfu/rtmp/.
|
||||||
@@ -120,7 +143,8 @@ module.exports = {
|
|||||||
apiSecret: 'mirotalkRtmpApiSecret',
|
apiSecret: 'mirotalkRtmpApiSecret',
|
||||||
expirationHours: 4,
|
expirationHours: 4,
|
||||||
dir: 'rtmp',
|
dir: 'rtmp',
|
||||||
ffmpeg: '/usr/bin/ffmpeg',
|
ffmpegPath: ffmpegPath,
|
||||||
|
platform: platform,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
middleware: {
|
middleware: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.7.03",
|
"version": "1.7.04",
|
||||||
"description": "WebRTC SFU browser-based video calls",
|
"description": "WebRTC SFU browser-based video calls",
|
||||||
"main": "Server.js",
|
"main": "Server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
|
|||||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.7.03
|
* @version 1.7.04
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -4904,7 +4904,7 @@ function showAbout() {
|
|||||||
imageUrl: image.about,
|
imageUrl: image.about,
|
||||||
customClass: { image: 'img-about' },
|
customClass: { image: 'img-about' },
|
||||||
position: 'center',
|
position: 'center',
|
||||||
title: 'WebRTC SFU v1.7.03',
|
title: 'WebRTC SFU v1.7.04',
|
||||||
html: `
|
html: `
|
||||||
<br />
|
<br />
|
||||||
<div id="about">
|
<div id="about">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.7.03
|
* @version 1.7.04
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,30 @@
|
|||||||
|
|
||||||
const { PassThrough } = require('stream');
|
const { PassThrough } = require('stream');
|
||||||
const ffmpeg = require('fluent-ffmpeg');
|
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);
|
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||||
|
|
||||||
|
console.log('FFmpeg', { platform, ffmpegPath });
|
||||||
|
|
||||||
class RtmpStreamer {
|
class RtmpStreamer {
|
||||||
constructor(rtmpUrl, rtmpKey) {
|
constructor(rtmpUrl, rtmpKey) {
|
||||||
this.rtmpUrl = rtmpUrl;
|
this.rtmpUrl = rtmpUrl;
|
||||||
|
|||||||
@@ -2,9 +2,30 @@
|
|||||||
|
|
||||||
const { PassThrough } = require('stream');
|
const { PassThrough } = require('stream');
|
||||||
const ffmpeg = require('fluent-ffmpeg');
|
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);
|
ffmpeg.setFfmpegPath(ffmpegPath);
|
||||||
|
|
||||||
|
console.log('FFmpeg', { platform, ffmpegPath });
|
||||||
|
|
||||||
class RtmpStreamer {
|
class RtmpStreamer {
|
||||||
constructor(rtmpUrl, rtmpKey, socket) {
|
constructor(rtmpUrl, rtmpKey, socket) {
|
||||||
(this.socket = socket), (this.rtmpUrl = rtmpUrl);
|
(this.socket = socket), (this.rtmpUrl = rtmpUrl);
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم