[mirotalksfu] - fix rtmp mirotalk/rtmp based docker image

هذا الالتزام موجود في:
Miroslav Pejic
2025-03-30 00:43:34 +01:00
الأصل 2d1ca5f84b
التزام d29c555df6
9 ملفات معدلة مع 40 إضافات و18 حذوفات

عرض الملف

@@ -271,6 +271,7 @@ module.exports = class Room {
// ####################################################
getRTMPUrl(host, port) {
const rtmpUseNodeMediaServer = this.rtmp.useNodeMediaServer ?? true;
const rtmpServer = this.rtmp.server != '' ? this.rtmp.server : false;
const rtmpAppName = this.rtmp.appName != '' ? this.rtmp.appName : 'live';
const rtmpStreamKey = this.rtmp.streamKey != '' ? this.rtmp.streamKey : uuidv4();
@@ -279,7 +280,7 @@ module.exports = class Room {
const rtmpServerURL = rtmpServer ? rtmpServer : `rtmp://${host}:${port}`;
const rtmpServerPath = '/' + rtmpAppName + '/' + rtmpStreamKey;
const rtmpUrl = rtmpServerSecret
const rtmpUrl = rtmpUseNodeMediaServer
? this.generateRTMPUrl(rtmpServerURL, rtmpServerPath, rtmpServerSecret, expirationHours)
: rtmpServerURL + rtmpServerPath;

عرض الملف

@@ -64,7 +64,7 @@ dev dependencies: {
* @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
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.8.01
* @version 1.8.02
*
*/
@@ -982,6 +982,7 @@ function startServer() {
? 'localhost'
: req.headers.host?.split(':')[0] || 'localhost';
const rtmpUseNodeMediaServer = rtmpCfg.useNodeMediaServer ?? true;
const rtmpServer = rtmpCfg.server != '' ? rtmpCfg.server : false;
const rtmpServerAppName = rtmpCfg.appName != '' ? rtmpCfg.appName : 'live';
const rtmpStreamKey = rtmpCfg.streamKey != '' ? rtmpCfg.streamKey : uuidv4();
@@ -990,12 +991,13 @@ function startServer() {
const rtmpServerURL = rtmpServer ? rtmpServer : `rtmp://${domainName}:1935`;
const rtmpServerPath = '/' + rtmpServerAppName + '/' + rtmpStreamKey;
const rtmp = rtmpServerSecret
const rtmp = rtmpUseNodeMediaServer
? generateRTMPUrl(rtmpServerURL, rtmpServerPath, rtmpServerSecret, expirationHours)
: rtmpServerURL + rtmpServerPath;
log.info('initRTMP', {
headers: req.headers,
rtmpUseNodeMediaServer: rtmpUseNodeMediaServer,
rtmpServer,
rtmpServerSecret,
rtmpServerURL,
@@ -1326,8 +1328,8 @@ function startServer() {
server_version: mediasoup?.version,
client_version: mediasoupClient?.version,
},
rtmp_enabled: rtmpCfg?.enabled ? rtmpCfg : false,
videoAI_enabled: config.integrations?.videoAI?.enabled ? config.integrations.videoAI : false,
rtmp: rtmpCfg?.enabled ? rtmpCfg : false,
videoAI: config.integrations?.videoAI?.enabled ? config.integrations.videoAI : false,
server_recording: config?.media?.recording?.enabled ? config.media.recording : false,
},

عرض الملف

@@ -190,20 +190,30 @@ module.exports = {
* - fromUrl: URL streaming [true/false] (default: true)
* - fromStream: Live stream input [true/false] (default: true)
* - maxStreams: Max simultaneous streams (default: 1)
* - useNodeMediaServer: Use node-media-server (mirotalk-nms) instead of ngnix-rtmp (mirotalk-rtmp) [true/false] (default true)
* - server: RTMP server URL
* - appName: Application name for RTMP
* - appName: Application name for RTMP (if using mirotalk-rtmp add it in the nginx.conf if is not present)
* - streamKey: Optional authentication key
* - secret: Must match node-media-server config.js
* - apiSecret: WebRTC → RTMP API secret
* - expirationHours: Stream URL expiry in hours (default: 4)
* - dir: Directory for video files
* - ffmpegPatch: FFmpeg binary path
* - dir: Directory for video files (default app/rtmp)
* - ffmpegPatch: FFmpeg binary path (autodetected)
* - platform: current platform (autodetected)
*
* RTMP Server Management:
* RTMP Node Media Server Management:
* ------------------------
* - Start: npm run nms-start
* - Stop: npm run nms-stop
* - Logs: npm run nms-logs
* - Image: mirotalk/nms:latest
* - Start: npm run nms-start
* - Stop: npm run nms-stop
* - Logs: npm run nms-logs
*
* RTMP Nginx Server Management:
* ------------------------
* - Image: mirotalk/rtmp:latest
* - Start: npm run rtmp-start
* - Stop: npm run rtmp-stop
* - Logs: npm run rtmp-logs
*
* Important:
* ------------------------
@@ -221,6 +231,7 @@ module.exports = {
fromUrl: process.env.RTMP_FROM_URL !== 'false',
fromStream: process.env.RTMP_FROM_STREAM !== 'false',
maxStreams: parseInt(process.env.RTMP_MAX_STREAMS) || 1,
useNodeMediaServer: process.env.RTMP_USE_NODE_MEDIA_SERVER !== 'false',
server: process.env.RTMP_SERVER || 'rtmp://localhost:1935',
appName: process.env.RTMP_APP_NAME || 'mirotalk',
streamKey: process.env.RTMP_STREAM_KEY || '',