A Node.js implementation of RTMP/HTTP-FLV Media Server
Node-Media-Server v4
Introduction
Node-Media-Server is a high-performance/low-latency/open-source Live Streaming Server developed based on Nodejs. v4 is design to implement enhanced RTMP FLV v1 support for native HEVC, VP9, AV1. v4 is no longer compatible with the cn_cdn extension id flv_265 standard. v4 is no longer compatible with flashplayer's rtmp protocol. v4 is incompatible with v2. Do not upgrade across major versions.
Installation
bash
npm install node-media-server -g
or run directly
bash
npx node-media-server
Cli Options
…
WebAdmin
Features
HTTP/HTTP2-flv Push/Play
WS/WSS-flv Push/Play
RTMP/RTMPS Push/Play
GOP cache
Notification
Authentication
Static file server
Record to flv file
REST API System (New in v4.2.0)
JWT-based Authentication (New in v4.2.0)
Real-time Monitoring & Statistics (New in v4.2.0)
Session Management (New in v4.2.0)
Session Deletion (New in v4.2.0)
Advanced Health Monitoring (New in v4.2.0)
RTSP/RTMP Relay Tasks with persistence and management API (New in v4.3.0)
Web Admin UI with Dashboard, Streams, Records, History, Relay and Settings (New in v4.3.0)
Username/Password Login with scrypt hashing and login rate limiting (New in v4.3.0)
Configuration Management API with validation (New in v4.3.0)
Change Password API (New in v4.3.0)
Record File Download (New in v4.3.0)
Record Session Resume within publish grace period (New in v4.3.0)
History Search by stream path, IP and time range (New in v4.3.0)
Network Bandwidth Statistics (New in v4.3.0)
Graceful Shutdown (New in v4.3.0)
Static file services
Node-Media-Server can provide static file services for a directory.
"static": {
"router": "/",
"root": "./html"
}
Record to flv file
Node-Media-Server can record live streams as FLV files. When the static file server is enabled and recordings are saved in its directory. It can provide video-on-demand services.
Set "auto": false to disable auto-recording of every published stream; streams can then be recorded on demand via the webadmin streams page or POST /api/v1/streams/{app}/{name}/record.
http://server_ip:8000/record/live/stream/unix_time.flv
or
https://server_ip:8443/record/live/stream/unix_time.flv
REST API System (New in v4.2.0)
Node-Media-Server v4.2.0 provides a REST API system for server management and monitoring, featuring:
JWT-based authentication with challenge-response login