-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
一分钟部署一个流媒体服务
Mingliang Chen edited this page Mar 27, 2018
·
3 revisions
Node-Media-Server依赖Node.js运行环境,因此请确保已安装好。
npm install node-media-server
code app.js
const NodeMediaServer = require('node-media-server');
const config = {
rtmp: {
port: 1935,
chunk_size: 60000,
gop_cache: true,
ping: 60,
ping_timeout: 30
},
http: {
port: 8000,
allow_origin: '*'
}
};
var nms = new NodeMediaServer(config)
nms.run();
node app.js
到这里,你已经拥有了一个具备RTMP/HTTP-FLV/WebSocket-FLV的高性能流媒体服务器~~ 鹅妹子嘤!