MiroTalk RTMP Servers Guide
Overview
MiroTalk offers two RTMP (Real-Time Messaging Protocol) servers:
- Node Media Server - Node.js-based solution with admin dashboard
- Nginx RTMP - Lightweight Nginx module for RTMP streaming
Both integrate seamlessly with MiroTalk SFU (Selective Forwarding Unit).
🛠 Prerequisites
Before setup, ensure your system has: - docker-engine - docker-compose - ffmpeg
Bash
# Update package lists
sudo apt update
# Install required packages
sudo apt install -y docker.io docker-compose ffmpeg
Option 1: Node Media Server
Features
- Node.js implementation
- Admin dashboard and API endpoints
- Authentication support
- Docker deployment
🚀 Setup Guide
-
Prepare directories
-
Configuration
-
Pull Docker image
-
Management Commands
🔍 Access Points
- Admin Dashboard:
https://your-domain:8043/admin
- Server API:
https://your-domain:8043/api/server
- Streams API:
https://your-domain:8043/api/streams
Option 2: Nginx RTMP
Features
- Lightweight Nginx-based solution
- Simple statistics page
- Easy Docker deployment
🚀 Setup Guide
-
Prepare directories
-
Configuration
-
Pull Docker image
-
Management Commands
📊 Statistics
View stream stats at: https://your-domain:1935/stat
🔌 MiroTalk SFU RTMP Configuration
To integrate with MiroTalk SFU, configure these settings in app/src/config.js
:
JavaScript
/**
* RTMP Streaming Configuration
* ---------------------------
* Settings for Real-Time Messaging Protocol (RTMP) streaming integration
* with MiroTalk SFU. Configure based on your streaming server choice.
*/
rtmp: {
// Enable/disable RTMP functionality completely
enabled: true,
// Choose between NodeMediaServer (true) or Nginx RTMP (false)
useNodeMediaServer: true,
// API secret key for accessing RTMP server APIs
// Keep this secure and change from default
apiSecret: 'mirotalkRtmpApiSecret',
// RTMP server connection details
// Format: rtmp://[host]:[port]
server: 'rtmp://localhost:1935',
// Application name/path on the RTMP server
// This is typically 'live' or 'stream'
appName: 'live',
// Default stream key (can be left empty for dynamic generation)
// In production, generate unique keys per stream
streamKey: '',
/**
* NodeMediaServer Specific Configuration
* -------------------------------------
* Only required when useNodeMediaServer = true
*/
// Secret key for generating signed RTMP URLs
// Must match the secret in NodeMediaServer config
secret: 'mirotalkRtmpSecret',
// Expiration time (in hours) for signed RTMP URLs
// Helps prevent unauthorized long-term access
expirationHours: 4,
/**
* Note: When using Nginx RTMP (useNodeMediaServer = false),
* only the following parameters are needed:
* - enabled
* - useNodeMediaServer
* - server
* - appName
* - streamKey
*/
},
For all available RTMP settings and default values, reference the source configuration:
📄 MiroTalk SFU config.js (RTMP section)
🎥 Streaming with OBS
Configuration Steps:
- Open OBS → Settings → Stream
- Set:
- Service: Custom...
- Server:
rtmp://your-domain:1935/live
- Stream Key: Any unique identifier (e.g.,
my-stream-123
)
Starting Your Stream:
- Click "Start Streaming" in OBS
- Share your stream URL:
rtmp://your-domain:1935/live/your-stream-key
🔐 Authentication Note (Node Media Server)
If authentication is enabled in config.js
:
Generating Signed URLs:
- Run the signing script:
- Use the generated URL format: