First, install the NODEJS environment
Go to nodejs official website Download the installation package https://nodejs.org/en/#download
After the installation is complete, test:
lunli-mc1:~ lunli$ node-vv8. 9.1
Second, install Nodejs Rtmp-server plug-in
Https://www.npmjs.com/package/node-media-server
Install Node-media-server
Third, installation FFmpeg
Install FFmpeg
Iv. Testing
Start Rtmp-server
Const NODEMEDIASERVER = require (' node-media-server '= { rtmp: { 1935, 60000 , true , 3030} , http: { 8082, ' * ' varNew nodemediaserver (config) nms.run ();
Push flow testing with FFmpeg
// ffmpeg-re-i sample.h264-c:v libx264-preset superfast-tune zerolatency-c:a aac-ar 44100-f flv rtmp: // localhost/live/rtmp_push_test // ffmpeg-re-i sample.h264-c copy-f flv rtmp: // localhost/live/rtmp_push_test
Effect:
Live stream-Build live Streaming server Nodejs