Index of Uploads Mp4 Darwin Me
Node-Media-Server
A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH Media Server
中文介绍
If you like this projection yous can support me.
NMSv3
https://github.com/NodeMedia/NodeMediaServer
Web Admin Panel Source
https://github.com/illuspas/Node-Media-Server-Admin
Web Admin Console Screenshot
http://server_ip:8000/admin
Features
- Cross platform back up Windows/Linux/Unix
- Back up H.264/H.265/AAC/MP3/SPEEX/NELLYMOSER/Thousand.711
- Back up GOP enshroud
- Support remux to LIVE-HTTP/WS-FLV,Support NodePlayer.js playback
- Support remux to HLS/Nuance/MP4
- Support xycdn mode authentication
- Support event callback
- Support https/wss
- Support Server Monitor
- Support Rtsp/Rtmp relay
- Support api command relay
- Support real-fourth dimension multi-resolution transcoding
Usage
docker version
docker run --proper name nms -d -p 1935:1935 -p 8000:8000 illuspas/node-media-server git version
mkdir nms cd nms git clone https://github.com/illuspas/Node-Media-Server . npm i node app.js npm version (recommended)
mkdir nms cd nms npm install node-media-server vi app.js const NodeMediaServer = require ( 'node-media-server' ) ; const config = { rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: true , ping: xxx , ping_timeout: threescore } , http: { port: 8000 , allow_origin: '*' } } ; var nms = new NodeMediaServer ( config ) nms . run ( ) ; Publishing live streams
From FFmpeg
If y'all accept a video file with H.264 video and AAC audio:
ffmpeg -re -i INPUT_FILE_NAME -c copy -f flv rtmp://localhost/live/STREAM_NAME Or if you lot accept a video file that is encoded in other audio/video format:
ffmpeg -re -i INPUT_FILE_NAME -c:5 libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/STREAM_NAME From OBS
Settings -> Stream
Stream Type : Custom Streaming Server
URL : rtmp://localhost/live
Stream primal : STREAM_NAME
Accessing the live stream
RTMP
rtmp://localhost/live/STREAM_NAME http-flv
http://localhost:8000/live/STREAM_NAME.flv websocket-flv
ws://localhost:8000/live/STREAM_NAME.flv HLS
http://localhost:8000/live/STREAM_NAME/index.m3u8 DASH
http://localhost:8000/live/STREAM_NAME/index.mpd via flv.js over http-flv
< script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"> </ script > < video id="videoElement"> </ video > < script > if ( flvjs . isSupported ( ) ) { var videoElement = document . getElementById ( 'videoElement' ) ; var flvPlayer = flvjs . createPlayer ( { type: 'flv' , url: 'http://localhost:8000/alive/STREAM_NAME.flv' } ) ; flvPlayer . attachMediaElement ( videoElement ) ; flvPlayer . load ( ) ; flvPlayer . play ( ) ; } </ script > via flv.js over websocket-flv
< script src="https://cdn.bootcss.com/flv.js/ane.5.0/flv.min.js"> </ script > < video id="videoElement"> </ video > < script > if ( flvjs . isSupported ( ) ) { var videoElement = document . getElementById ( 'videoElement' ) ; var flvPlayer = flvjs . createPlayer ( { type: 'flv' , url: 'ws://localhost:8000/live/STREAM_NAME.flv' } ) ; flvPlayer . attachMediaElement ( videoElement ) ; flvPlayer . load ( ) ; flvPlayer . play ( ) ; } </ script > Logging
Change the logging type
It is now possible to modify the logging type which determines which panel outputs are shown.
In that location are a total of 4 possible options:
- 0 - Don't log anything
- 1 - Log errors
- 2 - Log errors and generic info
- 3 - Log everything (debug)
Modifying the logging type is easy - but add a new value logType in the config and ready it to a value between 0 and iv. By default, this is ready to bear witness errors and generic info internally (setting 2).
const NodeMediaServer = require ( 'node-media-server' ) ; const config = { logType: 3 , rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: true , ping: 30 , ping_timeout: 60 } , http: { port: 8000 , allow_origin: '*' } } ; var nms = new NodeMediaServer ( config ) nms . run ( ) ; Authentication
Encryption URL consists of:
rtmp://hostname:port/appname/stream?sign=expires-HashValue
http://hostname:port/appname/stream.flv?sign=expires-HashValue
ws://hostname:port/appname/stream.flv?sign=expires-HashValue
1.Publish or play accost:
rtmp://192.168.0.10/alive/stream
two.Config set auth->clandestine: 'nodemedia2017privatekey'
const config = { rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: true , ping: 30 , ping_timeout: sixty } , http: { port: 8000 , allow_origin: '*' } , auth: { play: true , publish: true , secret: 'nodemedia2017privatekey' } } iii.expiration time: 2017/8/23 11:25:21 ,The calculated expiration timestamp is
1503458721
4.The combination HashValue is:
HashValue = md5("/alive/stream-1503458721-nodemedia2017privatekey")
HashValue = 80c1d1ad2e0c2ab63eebb50eed64201a
5.Concluding asking address
rtmp://192.168.0.10/alive/stream?sign=1503458721-80c1d1ad2e0c2ab63eebb50eed64201a
The 'sign' keyword can not be modified
H.265 over RTMP
H.265 does not appear in Adobe's official specification. Id 12 is the standard for well-nigh deject services in China.
Publish or Transcode: ffmpeg-hw-win32
Play:NodeMediaClient-Android and NodeMediaClient-iOS
Pure JavaScrip live stream player: NodePlayer.js
Issue callback
...... nms . run ( ) ; nms . on ( 'preConnect' , ( id , args ) => { console . log ( '[NodeEvent on preConnect]' , `id= ${ id } args= ${ JSON . stringify ( args ) } ` ) ; // allow session = nms.getSession(id); // session.reject(); } ) ; nms . on ( 'postConnect' , ( id , args ) => { panel . log ( '[NodeEvent on postConnect]' , `id= ${ id } args= ${ JSON . stringify ( args ) } ` ) ; } ) ; nms . on ( 'doneConnect' , ( id , args ) => { console . log ( '[NodeEvent on doneConnect]' , `id= ${ id } args= ${ JSON . stringify ( args ) } ` ) ; } ) ; nms . on ( 'prePublish' , ( id , StreamPath , args ) => { console . log ( '[NodeEvent on prePublish]' , `id= ${ id } StreamPath= ${ StreamPath } args= ${ JSON . stringify ( args ) } ` ) ; // permit session = nms.getSession(id); // session.reject(); } ) ; nms . on ( 'postPublish' , ( id , StreamPath , args ) => { panel . log ( '[NodeEvent on postPublish]' , `id= ${ id } StreamPath= ${ StreamPath } args= ${ JSON . stringify ( args ) } ` ) ; } ) ; nms . on ( 'donePublish' , ( id , StreamPath , args ) => { console . log ( '[NodeEvent on donePublish]' , `id= ${ id } StreamPath= ${ StreamPath } args= ${ JSON . stringify ( args ) } ` ) ; } ) ; nms . on ( 'prePlay' , ( id , StreamPath , args ) => { console . log ( '[NodeEvent on prePlay]' , `id= ${ id } StreamPath= ${ StreamPath } args= ${ JSON . stringify ( args ) } ` ) ; // allow session = nms.getSession(id); // session.reject(); } ) ; nms . on ( 'postPlay' , ( id , StreamPath , args ) => { console . log ( '[NodeEvent on postPlay]' , `id= ${ id } StreamPath= ${ StreamPath } args= ${ JSON . stringify ( args ) } ` ) ; } ) ; nms . on ( 'donePlay' , ( id , StreamPath , args ) => { panel . log ( '[NodeEvent on donePlay]' , `id= ${ id } StreamPath= ${ StreamPath } args= ${ JSON . stringify ( args ) } ` ) ; } ) ; Https/Wss
Generate document
openssl genrsa -out privatekey.pem 1024 openssl req -new -primal privatekey.pem -out certrequest.csr openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out document.pem Config https
const NodeMediaServer = require ( 'node-media-server' ) ; const config = { rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: true , ping: 30 , ping_timeout: lx } , http: { port: 8000 , allow_origin: '*' } , https: { port: 8443 , key:'./privatekey.pem' , cert:'./document.pem' , } } ; var nms = new NodeMediaServer ( config ) nms . run ( ) ; Accessing
https://localhost:8443/alive/STREAM_NAME.flv wss://localhost:8443/live/STREAM_NAME.flv In the browser environment, Self-signed certificates need to be added with trust earlier they can be accessed.
API
Protected API
const config = { ....... auth: { api : truthful, api_user: 'admin', api_pass: 'nms2018', }, ...... } Based on the basic auth,Delight change your password. The default is not turned on
Server stats
http://localhost:8000/api/server
{ "bone": { "arch": "x64" , "platform": "darwin" , "release": "sixteen.7.0" }, "cpu": { "num": 8, "load": 12, "model": "Intel(R) Core(TM) i7-4790 CPU @ three.60GHz" , "speed": 3592 }, "mem": { "totle": 8589934592, "free": 754126848 }, "net": { "inbytes": 6402345, "outbytes": 6901489 }, "nodejs": { "uptime": 109, "version": "v8.9.0" , "mem": { "rss": 59998208, "heapTotal": 23478272, "heapUsed": 15818096, "external": 3556366 } }, "clients": { "accustomed": 207, "agile": 204, "idle": 0, "rtmp": 203, "http": i, "ws": 0 } } Streams stats
http://localhost:8000/api/streams
{ "live": { "s": { "publisher": { "app": "live" , "stream": "s" , "clientId": "U3UYQ02P" , "connectCreated": "2017-12-21T02:29:thirteen.594Z" , "bytes": 190279524, "ip": "::1" , "audio": { "codec": "AAC" , "contour": "LC" , "samplerate": 48000, "channels": 6 }, "video": { "codec": "H264" , "width": 1920, "pinnacle": 1080, "profile": "Main" , "level": 4.1, "fps": 24 } }, "subscribers": [ { "app": "live" , "stream": "s" , "clientId": "H227P4IR" , "connectCreated": "2017-12-21T02:31:35.278Z" , "bytes": 18591846, "ip": "::ffff:127.0.0.1" , "protocol": "http" }, { "app": "live" , "stream": "south" , "clientId": "ZNULPE9K" , "connectCreated": "2017-12-21T02:31:45.394Z" , "bytes": 8744478, "ip": "::ffff:127.0.0.i" , "protocol": "ws" }, { "app": "live" , "stream": "s" , "clientId": "C5G8NJ30" , "connectCreated": "2017-12-21T02:31:51.736Z" , "bytes": 2046073, "ip": "::ffff:192.168.0.91" , "protocol": "rtmp" } ] }, "stream": { "publisher": zippo, "subscribers": [ { "app": "live" , "stream": "stream" , "clientId": "KBH4PCWB" , "connectCreated": "2017-12-21T02:31:30.245Z" , "bytes": 0, "ip": "::ffff:127.0.0.1" , "protocol": "http" } ] } } } Remux to HLS/DASH live stream
const NodeMediaServer = require ( 'node-media-server' ) ; const config = { rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: true , ping: 30 , ping_timeout: lx } , http: { port: 8000 , mediaroot: './media' , allow_origin: '*' } , trans: { ffmpeg: '/usr/local/bin/ffmpeg' , tasks: [ { app: 'live' , hls: true , hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]' , nuance: true , dashFlags: '[f=dash:window_size=3:extra_window_size=5]' } ] } } ; var nms = new NodeMediaServer ( config ) nms . run ( ) ; Remux to RTMP/HLS/Nuance live stream with audio transcode
const NodeMediaServer = require ( 'node-media-server' ) ; const config = { rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: truthful , ping: 30 , ping_timeout: 60 } , http: { port: 8000 , mediaroot: './media' , allow_origin: '*' } , trans: { ffmpeg: '/usr/local/bin/ffmpeg' , tasks: [ { app: 'live' , vc: "re-create" , vcParam: [ ] , air-conditioning: "aac" , acParam: [ '-ab' , '64k' , '-ac' , 'i' , '-ar' , '44100' ] , rtmp:true , rtmpApp:'live2' , hls: truthful , hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]' , dash: true , dashFlags: '[f=dash:window_size=iii:extra_window_size=five]' } ] } } ; var nms = new NodeMediaServer ( config ) nms . run ( ) ; Remux to RTMP cannot use the same app name
Record to MP4
const NodeMediaServer = crave ( 'node-media-server' ) ; const config = { rtmp: { port: 1935 , chunk_size: 60000 , gop_cache: true , ping: thirty , ping_timeout: 60 } , http: { port: 8000 , mediaroot: './media' , allow_origin: '*' } , trans: { ffmpeg: '/usr/local/bin/ffmpeg' , tasks: [ { app: 'live' , mp4: true , mp4Flags: '[movflags=frag_keyframe+empty_moov]' , } ] } } ; var nms = new NodeMediaServer ( config ) nms . run ( ) ; Rtsp/Rtmp Relay
NodeMediaServer implement RTSP and RTMP relay with ffmpeg.
Static pull
The static pull mode is executed at service startup and reconnect later failure. It could be a alive stream or a file. In theory, it is not limited to RTSP or RTMP protocol.
relay: { ffmpeg: '/usr/local/bin/ffmpeg', tasks: [ { app: 'cctv', manner: 'static', edge: 'rtsp://admin:admin888@192.168.0.149:554/ISAPI/streaming/channels/101', proper name: '0_149_101', rtsp_transport : 'tcp' //['udp', 'tcp', 'udp_multicast', 'http'] }, { app: 'iptv', mode: 'static', border: 'rtmp://live.hkstv.hk.lxdns.com/live/hks', name: 'hks' }, { app: 'mv', style: 'static', edge: '/Volumes/ExtData/Movies/Dancing.Queen-SD.mp4', proper name: 'dq' } ] } Dynamic pull
When the local server receives a play request. If the stream does not be, pull the stream from the configured border server to local. When the stream is not played by the client, it automatically disconnects.
relay: { ffmpeg: '/usr/local/bin/ffmpeg', tasks: [ { app: 'alive', way: 'pull', edge: 'rtmp://192.168.0.xx', } ] } Dynamic button
When the local server receives a publish request. Automatically button the stream to the edge server.
relay: { ffmpeg: '/usr/local/bin/ffmpeg', tasks: [ { app: 'alive', manner: 'push', edge: 'rtmp://192.168.0.10', } ] } Fission
Real-time transcoding multi-resolution output
fission: { ffmpeg: '/usr/local/bin/ffmpeg', tasks: [ { rule: "game/*", model: [ { ab: "128k", vb: "1500k", vs: "1280x720", vf: "30", }, { ab: "96k", vb: "1000k", vs: "854x480", vf: "24", }, { ab: "96k", vb: "600k", vs: "640x360", vf: "twenty", }, ] }, { rule: "testify/*", model: [ { ab: "128k", vb: "1500k", vs: "720x1280", vf: "30", }, { ab: "96k", vb: "1000k", vs: "480x854", vf: "24", }, { ab: "64k", vb: "600k", vs: "360x640", vf: "20", }, ] }, ] } Publisher and Player App/SDK
Android Livestream App
https://play.google.com/shop/apps/details?id=cn.nodemedia.qlive
http://www.nodemedia.cn/uploads/qlive-release.apk
Android SDK
https://github.com/NodeMedia/NodeMediaClient-Android
iOS SDK
https://github.com/NodeMedia/NodeMediaClient-iOS
React-Native SDK
https://github.com/NodeMedia/react-native-nodemediaclient
NodePlayer.js HTML5 live player
- Implemented with asm.js / wasm
- http-flv/ws-flv
- H.264/H.265 + AAC/Nellymoser/G.711 decoder
- Ultra depression latency (Support for iOS safari browser)
http://www.nodemedia.cn/products/node-media-player
Windows browser plugin(ActiveX/NPAPI)
- H.264/H.265+AAC rtmp publisher
- Camera/Desktop + Microphone capture
- Nvidia/AMD/Intel Hardware acceleration Encoder/Decoder
- Ultra low latency rtmp/rtsp/http live histrion
- Only 6MB installation package
http://www.nodemedia.cn/products/node-media-client/win
Thank you
Sorng Sothearith, standifer1023, floatflower, Christopher Thomas, strive, jaysonF, 匿名, 李勇, 巴草根, ZQL, 陈勇至, -Y, 高山流水, 老郭, 孙建, 不说本可以, Jacky, 人走茶凉,树根, 疯狂的台灯, 枫叶, lzq, 番茄, smicroz , kasra.shahram, 熊科辉, Ken Lee , Erik Herz, Javier Gomez, trustfarm, leeoxiang, Aaron Turner, Bearding
Thank you for your back up.
Source: https://www.npmjs.com/package/@sergiocruz/node-media-server?activeTab=dependents
0 Response to "Index of Uploads Mp4 Darwin Me"
Post a Comment