{"_id":"@asurraa-lab/node-media-server","_rev":"4-2ce20fad0fcda71865532b1d7310bef0","name":"@asurraa-lab/node-media-server","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@asurraa-lab/node-media-server","version":"1.0.0","description":"A Node.js implementation of RTMP Server","bin":{"node-media-server":"bin/app.js"},"main":"src/node_media_server.js","scripts":{"start":"node bin/app.js","dev":"nodemon bin/app.js"},"repository":{"type":"git","url":"git+https://github.com/illuspas/Node-Media-Server.git"},"keywords":["rtmp","flv","server"],"author":{"name":"Chen Mingliang"},"license":"MIT","bugs":{"url":"https://github.com/illuspas/Node-Media-Server/issues"},"homepage":"https://github.com/illuspas/Node-Media-Server#readme","dependencies":{"basic-auth-connect":"^1.0.0","chalk":"^2.4.2","dateformat":"^3.0.3","express":"^4.16.4","lodash":">=4.17.13","minimist":"^1.2.5","mkdirp":"1.0.3","ws":"^7.4.6"},"engines":{"node":">=8.0.0"},"devDependencies":{"nodemon":"^2.0.15"},"gitHead":"db7ab456b643611cc44c01e3f5aedcc3f09650b8","_id":"@asurraa-lab/node-media-server@1.0.0","_nodeVersion":"17.4.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-XkHYjnR3IfJaXoRDaSvP0LMh64Pr7ZXfoEUDSjkFNLxVAde98rBEBzPJJG4zFFgYZfq+72aecshj0p6j9r4imA==","shasum":"2cb057e53eb33bbabbfeb8ecd4cf0ab20303bc07","tarball":"https://registry.npmjs.org/@asurraa-lab/node-media-server/-/node-media-server-1.0.0.tgz","fileCount":46,"unpackedSize":2118277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGFKQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrN4w/+LmcU3gE2Lz4eCgAj62sgHRKd2HQdRkfUhOD6bZK5xJzoqkT5\r\noD1SOiJgUA6wHbHzuw1+sfAb+oc+NFXrH3VkztiG7bxRbkLJFbMTEsPCcZPV\r\nponMNw8J2GF41IpA6LCM9Dhq1xr4VQRS6F9bnetY58KwUDUT1ekilzzTjobM\r\nMCzeJJ9pTIWJmyu+d/hx90jXcHt9xAwjY0gySgEaX4xsQqKoBxM5Cg1i+TaW\r\nGOhkisg5XXAVXOMVgoaRoPs20AsBf2HL2HKMeOAoCOH3+PNkvDB6no+qGRuv\r\nBWNSt95daBEzK6MVEA9SUYaUUi/bBvU18z9z8gznbEKo9iKRfSD6DHloea/5\r\nxBx4jeXeVyKBt3oqMT9hsLzRkpY+6CKzHMpxqxSAWva8dQg4HPOi0Lw16Ymg\r\n8puZuEIAt/KxSTOF7xhDusmsnolxCuuvI9KYAOaLRlw5512osdFY5ZKJhQBq\r\nrN0yNHVK4PI/qSgf568I1H0FMAPjVR43ZWp7ASqcebexgqTtKP1ufjkXyAB3\r\n8hondLL+SHh1xpz/aEi4Ks+yz4Jehzg+wxPSirQB/IY4gz5sPpuSMfbjZxzy\r\nX1kRMeE9drCwBdk9KqqUEUoGxPOgz/VDgNRQQjb/ysYsKEcLT/zITsx6lltw\r\nlh6RRs1NWF2VzEZ0oYwObo4Dnh/GDcsrMmE=\r\n=UBfn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICF/4SuLblNytClxqECGyN1mADvoW/56h0uqGSoukixyAiEAogf9Oj/ABRtQRDW1IP+wzG1fa7imzOE9zGg8xcYUUF8="}]},"_npmUser":{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"},"directories":{},"maintainers":[{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-media-server_1.0.0_1645761167832_0.6965501057704928"},"_hasShrinkwrap":false},"1.0.1":{"name":"@asurraa-lab/node-media-server","version":"1.0.1","description":"A Node.js implementation of RTMP Server","bin":{"node-media-server":"bin/app.js"},"main":"src/node_media_server.js","scripts":{"start":"node bin/app.js","dev":"nodemon bin/app.js"},"repository":{"type":"git","url":"git+https://github.com/illuspas/Node-Media-Server.git"},"keywords":["rtmp","flv","server"],"author":{"name":"Chen Mingliang"},"license":"MIT","bugs":{"url":"https://github.com/illuspas/Node-Media-Server/issues"},"homepage":"https://github.com/illuspas/Node-Media-Server#readme","dependencies":{"basic-auth-connect":"^1.0.0","chalk":"^2.4.2","dateformat":"^3.0.3","express":"^4.16.4","lodash":">=4.17.13","minimist":"^1.2.5","mkdirp":"1.0.3","ws":"^7.4.6"},"engines":{"node":">=8.0.0"},"devDependencies":{"nodemon":"^2.0.15"},"gitHead":"db7ab456b643611cc44c01e3f5aedcc3f09650b8","_id":"@asurraa-lab/node-media-server@1.0.1","_nodeVersion":"17.4.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-W+kt8CRVV92/rRK0rCngm+t2KndyeDGdOTn4RXxOwfGgX1Kes5dIElq+t7FUhdiIfrBs8iuy0J64FyRqIx1Dsw==","shasum":"a4854b0c5cee54198f3e05c70af258fb4dce1979","tarball":"https://registry.npmjs.org/@asurraa-lab/node-media-server/-/node-media-server-1.0.1.tgz","fileCount":46,"unpackedSize":2118083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGFZaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQ1g/8D8p5gM/oyBpJIKeHgXNMBGJTbj6MPH+ehkhhipUN4K2D+uVm\r\nWU+fPzHOPQvfUu/AlaX79G7zKphksWtO18gr+7XADO4yGwZGki83gts+/Y79\r\nDY+tmZFjE0P1LsimiFnmV3j36F4voF4iemDV3HAsblCiFrknZA42mkzoO/+z\r\nGUx4mcEZRRaSCE6N48zvIq7Uj+uzx6nd1tgyThmwjNg18aWSWUw1/6KRdVZV\r\nHCmE9Zg2wVGRPXp9/+PwWGaXXuUGwlNjBkKNHMSezNP8T1mOw2G2rEfn3D/r\r\n7hT4Xfz/r1moceh4mWQW6O3YUn7lMV7AxhJkGMeR3W1YLqrJ6MKkOCH4iXt/\r\ndh4DI0XBqiLWszeTuKW1COubIpY2Un+DyqKcCvs8/uR6JA86qpuvV2o4Hs/1\r\nKqmlfPM0mYM3JGeqnvmEm0up038RcL8UMBXkv+wJsmSA437UXCuUgQzivhsZ\r\nZTArOnbaNy4MIPe5SrZESKj/+qx7OkEIIXycw8vLy3CI3WyphM3rKZf77DsF\r\naSUh1UGefeAdoMbYBj2d/MIS2wySnrZ5YbxZaunejurvp2UAjL0MrAkMMpys\r\nx46FhE5AW/RqcYs1Lg9GYeWxg2fLyqy43KK/fpuBpPo8xPxIPpequc9vl4Fu\r\naUrSQWaaSjknBXGRBkq1AcXDVHnLrfAu2vY=\r\n=boUY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsCBNxTadHheX7ct8A6tar5xgsg3GALoBEMTZyj2ZjsAiBQZlNpVvqbpsiXYIdgMWxLbXlFEnRhDcAqh+3ouq68Zg=="}]},"_npmUser":{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"},"directories":{},"maintainers":[{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-media-server_1.0.1_1645762138167_0.4374776824000979"},"_hasShrinkwrap":false},"1.0.2":{"name":"@asurraa-lab/node-media-server","version":"1.0.2","description":"(Fork version to fix obs can't publish) A Node.js implementation of RTMP Server","bin":{"node-media-server":"bin/app.js"},"main":"src/node_media_server.js","scripts":{"start":"node bin/app.js","dev":"nodemon bin/app.js"},"repository":{"type":"git","url":"git+https://github.com/asurraa-lab/Node-Media-Server.git"},"keywords":["rtmp","flv","server"],"author":{"name":"Chen Mingliang"},"license":"MIT","bugs":{"url":"https://github.com/asurraa-lab/Node-Media-Server/issues"},"homepage":"https://github.com/asurraa-lab/Node-Media-Server#readme","dependencies":{"basic-auth-connect":"^1.0.0","chalk":"^2.4.2","dateformat":"^3.0.3","express":"^4.16.4","lodash":">=4.17.13","minimist":"^1.2.5","mkdirp":"1.0.3","ws":"^7.4.6"},"engines":{"node":">=8.0.0"},"devDependencies":{"nodemon":"^2.0.15"},"gitHead":"91f41fda02c24980dc5ea6e3753a637c05f234e7","_id":"@asurraa-lab/node-media-server@1.0.2","_nodeVersion":"17.4.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-X9Yg4K72eq/1D4SZFbbTvenWOQ0lh57ZPegAuLVHYOFoUtpeMHLry9DpyIJcW49MA9t+pbZWwC9DAFXyCHbWAg==","shasum":"8cd5d6ab678cccf617834ca43ae30483446cdac3","tarball":"https://registry.npmjs.org/@asurraa-lab/node-media-server/-/node-media-server-1.0.2.tgz","fileCount":46,"unpackedSize":2118132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGFdHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWFRAAmJh5UkIWRhdHfSte0g/ln9d3m3Tft8s/we6uFQ+iRUQWv89a\r\nWoQ5BcSn7PRyt6x0R6zewOpwyhWyPjbK3qkbcBasFK28f09hXEMjVNT4jK2H\r\nbccypFjciR0XxhpNJOIcUBFKvYd4bp2a2yGY4kDY048Ua/+xZF1Jg6fwYJOF\r\n4Pss9odhRhD/nNoyAKdpN1L7WkfwAL+QZavyXanh0EProHxZjdCgOYoAT6Dg\r\nQnTkSACPbmY1nieSo0mOEMvtTWqhtMUR0R9ygYafo0QBdh1uK2sTGs6tvYjk\r\nsMOHtqmGsAB0LEIkJor8fhydQbsL+ba3G0sTFETPtmVbtdzfjOI4P0VaipsE\r\nX2bJxDpxFVO1lqOQywmQpgyCx0Jj1F+OTcKNUK/1n7MKRPquRuWYTWhgvuXP\r\nY0cLZRXYXenLT6kl26eqWlZ8J01H9s1Qa5b8BRTgUIUHCtKgTUYne0MZqfJ4\r\nPfBFu6BTJBlASdeBYKjrnDXLUltQxkhQr8Cs4yHXaeex+XLiw5jBH6NPBBvy\r\nxMikbFtwbLpR8TJuwvXykhcl9AFnetZIZlh5dgOLqYRtSVz+2+Mdwlrauuc7\r\nYo8oPO1ySrVCRA4ReqRAd+8/8D0SdObG38u3fWc4CnVwb6TGnkp9krJRCdJ3\r\nbvW3HqkoduTvAMr/Hy+RFGr26TXA6wIs228=\r\n=Lh1x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLW37JdLEVC+TfS02Y8UZA9O3KQRI1nhhA0AQDDlJ8GQIhAKW4Q+KjIblgqcBZKG2RZN+zCzu0oDcoGpZTY3qkg3l4"}]},"_npmUser":{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"},"directories":{},"maintainers":[{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-media-server_1.0.2_1645762374902_0.4422686765036232"},"_hasShrinkwrap":false},"1.0.3":{"name":"@asurraa-lab/node-media-server","version":"1.0.3","description":"(Fork version to fix obs can't publish) A Node.js implementation of RTMP Server","bin":{"node-media-server":"bin/app.js"},"main":"src/node_media_server.js","scripts":{"start":"node bin/app.js","dev":"nodemon bin/app.js"},"repository":{"type":"git","url":"git+https://github.com/asurraa-lab/Node-Media-Server.git"},"keywords":["rtmp","flv","server"],"author":{"name":"Chen Mingliang"},"license":"MIT","bugs":{"url":"https://github.com/asurraa-lab/Node-Media-Server/issues"},"homepage":"https://github.com/asurraa-lab/Node-Media-Server#readme","dependencies":{"basic-auth-connect":"^1.0.0","chalk":"^2.4.2","dateformat":"^3.0.3","express":"^4.16.4","lodash":">=4.17.13","minimist":"^1.2.5","mkdirp":"1.0.3","ws":"^7.4.6"},"engines":{"node":">=8.0.0"},"devDependencies":{"nodemon":"^2.0.15"},"gitHead":"91f41fda02c24980dc5ea6e3753a637c05f234e7","_id":"@asurraa-lab/node-media-server@1.0.3","_nodeVersion":"17.4.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-c2jC37smTCTi4uaqgF3lWx3cfsWVvMOmHWBYv6HP1+uMnvPDRoriaub/7xRRw3RA/sRKBboK6lnc9zTY0jrqHg==","shasum":"726e022228215ab6fe18169802719f1596445cb0","tarball":"https://registry.npmjs.org/@asurraa-lab/node-media-server/-/node-media-server-1.0.3.tgz","fileCount":46,"unpackedSize":2118132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGFdSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRqw/+LtKNO3PRycdDkuBJJlHkOiP1VPCfvCTkEo8HP24/y6fwmirJ\r\nLqVXzNB9JbCsxw/sL6esYxtGciOd4laSlZUW+hwX4PKFnMImXKl6vsrm26cE\r\n+nC+Iw7rLWQ5NCPjJk7sXT9plWlYZuXfc8XDObP/aOYHlL9wPQU1crwcql1s\r\n4yUAFScjO4mAYLIioNW6Ua5fgglxPBehhKtNP32gS0y0tIkIBqo4QixVsUYQ\r\nKVFK72Kq9W28zdXwA/ZyHEbxUVewB+/XypmGldmGErwy4TeDeXsTzUXot3an\r\nUNOUUqJkvONTeaTl9s/qOE1HI1zffgp26SbbEEYk7PneY6DnGd2DNyJ5laLo\r\n3GMXUYmF2aLM+xXjBKpMZdVwr0TRlowfd9RkNnGHkwCoAGAs+2HYcjkgxUog\r\nPf4RJSjHOu+LtWDCl81fDDOSAJyLjj6TByGyilJ5j/E7NfPstSrK+gTArz2E\r\njQ91Eow/zLqDka+jy3unfeCdkhZ0//yX47hQgs6Xj5WOlPE60iAB52UmMfu7\r\nYgvG2FRuguzLGgc1OCWul2pwmBRjatJGLcSW1oX5c8lLL2V45jUMoPMtmBph\r\n7nLFGHWMVRz6/nW4NwbnFQXEPhIRExtGj/FdKyUMYGwnyp2bzIpLGsMERI8D\r\nkEaPxEKf8NFPhLsJYaR0+Ruzl8nEBq4+aj0=\r\n=MO1v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDE7uNDcVHaGc1fXc2p5hKxVGeEp1LZWE6hGqYPgxbRKAiEA67fD/KrurgOMvkFTUQD3xBkL3jH/WVxrPrWSMugTW84="}]},"_npmUser":{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"},"directories":{},"maintainers":[{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-media-server_1.0.3_1645762386550_0.6560853257815211"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-25T03:52:47.764Z","1.0.0":"2022-02-25T03:52:48.030Z","modified":"2022-04-04T16:00:17.421Z","1.0.1":"2022-02-25T04:08:58.382Z","1.0.2":"2022-02-25T04:12:55.153Z","1.0.3":"2022-02-25T04:13:06.808Z"},"maintainers":[{"name":"lyhourchhen","email":"chhenlyhour@gmail.com"}],"description":"(Fork version to fix obs can't publish) A Node.js implementation of RTMP Server","homepage":"https://github.com/asurraa-lab/Node-Media-Server#readme","keywords":["rtmp","flv","server"],"repository":{"type":"git","url":"git+https://github.com/asurraa-lab/Node-Media-Server.git"},"author":{"name":"Chen Mingliang"},"bugs":{"url":"https://github.com/asurraa-lab/Node-Media-Server/issues"},"license":"MIT","readme":"# Node-Media-Server\n[![npm](https://img.shields.io/node/v/node-media-server.svg)](https://nodejs.org/en/)\n[![npm](https://img.shields.io/npm/v/node-media-server.svg)](https://npmjs.org/package/node-media-server)\n[![npm](https://img.shields.io/npm/dm/node-media-server.svg)](https://npmjs.org/package/node-media-server)\n[![npm](https://img.shields.io/npm/l/node-media-server.svg)](LICENSE) \n[![Join the chat at https://gitter.im/Illuspas/Node-Media-Server](https://badges.gitter.im/Illuspas/Node-Media-Server.svg)](https://gitter.im/Illuspas/Node-Media-Server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n![logo](https://www.nodemedia.cn/uploads/site_logo.png)\n\nA Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH Media Server  \n[中文介绍](https://github.com/illuspas/Node-Media-Server/blob/master/README_CN.md)  \n\n**If you like this project you can support me.**  \n<a href=\"https://www.buymeacoffee.com/illuspas\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-white.png\" alt=\"Buy Me A Coffee\" style=\"height: 51px !important;width: 217px !important;\" ></a>\n\n# Web Admin Panel Source\n[https://github.com/illuspas/Node-Media-Server-Admin](https://github.com/illuspas/Node-Media-Server-Admin)\n\n# Web Admin Panel Screenshot\n[http://server_ip:8000/admin](http://server_ip:8000/admin)\n\n![admin](https://raw.githubusercontent.com/illuspas/resources/master/img/admin_panel_dashboard.png)\n![preview](https://raw.githubusercontent.com/illuspas/resources/master/img/admin_panel_streams_preview.png)\n\n# Features\n - Cross platform support Windows/Linux/Unix\n - Support H.264/H.265(flv_id=12)/AAC/MP3/SPEEX/NELLYMOSER/G.711/OPUS(flv_id=13)\n - Support GOP cache\n - Support remux to LIVE-HTTP/WS-FLV,Support [NodePlayer.js](https://www.nodemedia.cn/product/nodeplayer-js) playback\n - Support remux to HLS/DASH/MP4\n - Support xycdn style authentication\n - Support event callback\n - Support https/wss\n - Support Server Monitor\n - Support Rtsp/Rtmp relay\n - Support api control relay\n - Support real-time multi-resolution transcoding\n\n# Usage \n\n## npx \n```bash\nnpx node-media-server\n```\n\n## install as a global program\n```bash\nnpm i node-media-server -g\nnode-media-server\n```\n\n## docker version\n```bash\ndocker run --name nms -d -p 1935:1935 -p 8000:8000 -p 8443:8443 illuspas/node-media-server\n```\n\n## npm version (recommended)\n\n```bash\nmkdir nms\ncd nms\nnpm install node-media-server\nvi app.js\n```\n\n```js\nconst NodeMediaServer = require('node-media-server');\n\nconst config = {\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    allow_origin: '*'\n  }\n};\n\nvar nms = new NodeMediaServer(config)\nnms.run();\n```\n\n```bash\nnode app.js\n```\n\n# Publishing live streams\n## From FFmpeg\n>If you have a video file with H.264 video and AAC audio:\n```bash\nffmpeg -re -i INPUT_FILE_NAME -c copy -f flv rtmp://localhost/live/STREAM_NAME\n```\n\nOr if you have a video file that is encoded in other audio/video format:\n```bash\nffmpeg -re -i INPUT_FILE_NAME -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/STREAM_NAME\n```\n\n## From OBS\n>Settings -> Stream\n\nStream Type : Custom Streaming Server\n\nURL : rtmp://localhost/live\n\nStream key : STREAM_NAME\n\n# Accessing the live stream\n## RTMP \n```\nrtmp://localhost/live/STREAM_NAME\n```\n\n## http-flv\n```\nhttp://localhost:8000/live/STREAM_NAME.flv\n```\n\n## websocket-flv\n```\nws://localhost:8000/live/STREAM_NAME.flv\n```\n\n## HLS\n```\nhttp://localhost:8000/live/STREAM_NAME/index.m3u8\n```\n\n## DASH\n```\nhttp://localhost:8000/live/STREAM_NAME/index.mpd\n```\n\n## via flv.js over http-flv\n\n```html\n<script src=\"https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js\"></script>\n<video id=\"videoElement\"></video>\n<script>\n    if (flvjs.isSupported()) {\n        var videoElement = document.getElementById('videoElement');\n        var flvPlayer = flvjs.createPlayer({\n            type: 'flv',\n            url: 'http://localhost:8000/live/STREAM_NAME.flv'\n        });\n        flvPlayer.attachMediaElement(videoElement);\n        flvPlayer.load();\n        flvPlayer.play();\n    }\n</script>\n```\n\n## via flv.js over websocket-flv\n\n```html\n<script src=\"https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js\"></script>\n<video id=\"videoElement\"></video>\n<script>\n    if (flvjs.isSupported()) {\n        var videoElement = document.getElementById('videoElement');\n        var flvPlayer = flvjs.createPlayer({\n            type: 'flv',\n            url: 'ws://localhost:8000/live/STREAM_NAME.flv'\n        });\n        flvPlayer.attachMediaElement(videoElement);\n        flvPlayer.load();\n        flvPlayer.play();\n    }\n</script>\n```\n\n# Logging\n## Modify the logging type\nIt is now possible to modify the logging type which determines which console outputs are shown.\n\nThere are a total of 4 possible options:\n- 0 - Don't log anything\n- 1 - Log errors\n- 2 - Log errors and generic info\n- 3 - Log everything (debug)\n\nModifying the logging type is easy - just add a new value `logType` in the config and set it to a value between 0 and 4.\nBy default, this is set to show errors and generic info internally (setting 2).\n\n```js\nconst NodeMediaServer = require('node-media-server');\n\nconst config = {\n  logType: 3,\n\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    allow_origin: '*'\n  }\n};\n\nvar nms = new NodeMediaServer(config)\nnms.run();\n\n```\n\n# Authentication\n## Encryption URL consists of:\n> rtmp://hostname:port/appname/stream?sign=expires-HashValue  \n> http://hostname:port/appname/stream.flv?sign=expires-HashValue  \n> ws://hostname:port/appname/stream.flv?sign=expires-HashValue  \n\n1.Publish or play address:\n>rtmp://192.168.0.10/live/stream\n\n2.Config set auth->secret: 'nodemedia2017privatekey'\n```js\nconst config = {\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    allow_origin: '*'\n  },\n  auth: {\n    play: true,\n    publish: true,\n    secret: 'nodemedia2017privatekey'\n  }\n}\n```\n3.expiration time: 2017/8/23 11:25:21 ,The calculated expiration timestamp is\n>1503458721\n\n4.The combination HashValue is:\n>HashValue = md5(\"/live/stream-1503458721-nodemedia2017privatekey”)  \n>HashValue = 80c1d1ad2e0c2ab63eebb50eed64201a\n\n5.Final request address\n> rtmp://192.168.0.10/live/stream?sign=1503458721-80c1d1ad2e0c2ab63eebb50eed64201a  \n> The 'sign' keyword can not be modified\n\n# H.265 over RTMP\nH.265 does not appear in Adobe's official specification. Id 12 is the standard for most cloud services in China.  \nPublish or Transcode: [ffmpeg-hw-win32](#ffmpeg-hw-win32)  \nPlay:[NodeMediaClient-Android](#android) and [NodeMediaClient-iOS](#ios)  \nPure JavaScrip live stream player: [NodePlayer.js](https://github.com/illuspas/NodePlayer.js)\n\n# Event callback\n```js\n......\nnms.run();\nnms.on('preConnect', (id, args) => {\n  console.log('[NodeEvent on preConnect]', `id=${id} args=${JSON.stringify(args)}`);\n  // let session = nms.getSession(id);\n  // session.reject();\n});\n\nnms.on('postConnect', (id, args) => {\n  console.log('[NodeEvent on postConnect]', `id=${id} args=${JSON.stringify(args)}`);\n});\n\nnms.on('doneConnect', (id, args) => {\n  console.log('[NodeEvent on doneConnect]', `id=${id} args=${JSON.stringify(args)}`);\n});\n\nnms.on('prePublish', (id, StreamPath, args) => {\n  console.log('[NodeEvent on prePublish]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);\n  // let session = nms.getSession(id);\n  // session.reject();\n});\n\nnms.on('postPublish', (id, StreamPath, args) => {\n  console.log('[NodeEvent on postPublish]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);\n});\n\nnms.on('donePublish', (id, StreamPath, args) => {\n  console.log('[NodeEvent on donePublish]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);\n});\n\nnms.on('prePlay', (id, StreamPath, args) => {\n  console.log('[NodeEvent on prePlay]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);\n  // let session = nms.getSession(id);\n  // session.reject();\n});\n\nnms.on('postPlay', (id, StreamPath, args) => {\n  console.log('[NodeEvent on postPlay]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);\n});\n\nnms.on('donePlay', (id, StreamPath, args) => {\n  console.log('[NodeEvent on donePlay]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);\n});\n```\n# Https/Wss\n\n## Generate certificate\n```bash\nopenssl genrsa -out privatekey.pem 1024\nopenssl req -new -key privatekey.pem -out certrequest.csr \nopenssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem\n```\n\n## Config https\n```js\nconst NodeMediaServer = require('node-media-server');\n\nconst config = {\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    allow_origin: '*'\n  },\n  https: {\n    port: 8443,\n    key:'./privatekey.pem',\n    cert:'./certificate.pem',\n  }\n};\n\n\nvar nms = new NodeMediaServer(config)\nnms.run();\n```\n## Accessing\n```\nhttps://localhost:8443/live/STREAM_NAME.flv\nwss://localhost:8443/live/STREAM_NAME.flv\n```\n>In the browser environment, Self-signed certificates need to be added with trust before they can be accessed.\n\n# API \n## Protected API \n```\nconst config = {\n .......\n   auth: {\n    api : true,\n    api_user: 'admin',\n    api_pass: 'nms2018',\n  },\n \n ......\n}\n```\n>Based on the basic auth，Please change your password.\n>The default is not turned on\n\n## Server stats\nhttp://localhost:8000/api/server\n\n```json\n{\n  \"os\": {\n    \"arch\": \"x64\",\n    \"platform\": \"darwin\",\n    \"release\": \"16.7.0\"\n  },\n  \"cpu\": {\n    \"num\": 8,\n    \"load\": 12,\n    \"model\": \"Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\",\n    \"speed\": 3592\n  },\n  \"mem\": {\n    \"totle\": 8589934592,\n    \"free\": 754126848\n  },\n  \"net\": {\n    \"inbytes\": 6402345,\n    \"outbytes\": 6901489\n  },\n  \"nodejs\": {\n    \"uptime\": 109,\n    \"version\": \"v8.9.0\",\n    \"mem\": {\n      \"rss\": 59998208,\n      \"heapTotal\": 23478272,\n      \"heapUsed\": 15818096,\n      \"external\": 3556366\n    }\n  },\n  \"clients\": {\n    \"accepted\": 207,\n    \"active\": 204,\n    \"idle\": 0,\n    \"rtmp\": 203,\n    \"http\": 1,\n    \"ws\": 0\n  }\n}\n```\n\n## Streams stats\nhttp://localhost:8000/api/streams\n\n```json\n{\n  \"live\": {\n    \"s\": {\n      \"publisher\": {\n        \"app\": \"live\",\n        \"stream\": \"s\",\n        \"clientId\": \"U3UYQ02P\",\n        \"connectCreated\": \"2017-12-21T02:29:13.594Z\",\n        \"bytes\": 190279524,\n        \"ip\": \"::1\",\n        \"audio\": {\n          \"codec\": \"AAC\",\n          \"profile\": \"LC\",\n          \"samplerate\": 48000,\n          \"channels\": 6\n        },\n        \"video\": {\n          \"codec\": \"H264\",\n          \"width\": 1920,\n          \"height\": 1080,\n          \"profile\": \"Main\",\n          \"level\": 4.1,\n          \"fps\": 24\n        }\n      },\n      \"subscribers\": [\n        {\n          \"app\": \"live\",\n          \"stream\": \"s\",\n          \"clientId\": \"H227P4IR\",\n          \"connectCreated\": \"2017-12-21T02:31:35.278Z\",\n          \"bytes\": 18591846,\n          \"ip\": \"::ffff:127.0.0.1\",\n          \"protocol\": \"http\"\n        },\n        {\n          \"app\": \"live\",\n          \"stream\": \"s\",\n          \"clientId\": \"ZNULPE9K\",\n          \"connectCreated\": \"2017-12-21T02:31:45.394Z\",\n          \"bytes\": 8744478,\n          \"ip\": \"::ffff:127.0.0.1\",\n          \"protocol\": \"ws\"\n        },\n        {\n          \"app\": \"live\",\n          \"stream\": \"s\",\n          \"clientId\": \"C5G8NJ30\",\n          \"connectCreated\": \"2017-12-21T02:31:51.736Z\",\n          \"bytes\": 2046073,\n          \"ip\": \"::ffff:192.168.0.91\",\n          \"protocol\": \"rtmp\"\n        }\n      ]\n    },\n    \"stream\": {\n      \"publisher\": null,\n      \"subscribers\": [\n        {\n          \"app\": \"live\",\n          \"stream\": \"stream\",\n          \"clientId\": \"KBH4PCWB\",\n          \"connectCreated\": \"2017-12-21T02:31:30.245Z\",\n          \"bytes\": 0,\n          \"ip\": \"::ffff:127.0.0.1\",\n          \"protocol\": \"http\"\n        }\n      ]\n    }\n  }\n}\n```\n\n# Remux to HLS/DASH live stream\n```js\nconst NodeMediaServer = require('node-media-server');\n\nconst config = {\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    mediaroot: './media',\n    allow_origin: '*'\n  },\n  trans: {\n    ffmpeg: '/usr/local/bin/ffmpeg',\n    tasks: [\n      {\n        app: 'live',\n        hls: true,\n        hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',\n        dash: true,\n        dashFlags: '[f=dash:window_size=3:extra_window_size=5]'\n      }\n    ]\n  }\n};\n\nvar nms = new NodeMediaServer(config)\nnms.run();\n```\n\n# Remux to RTMP/HLS/DASH live stream with audio transcode\n```js\nconst NodeMediaServer = require('node-media-server');\n\nconst config = {\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    mediaroot: './media',\n    allow_origin: '*'\n  },\n  trans: {\n    ffmpeg: '/usr/local/bin/ffmpeg',\n    tasks: [\n      {\n        app: 'live',\n        vc: \"copy\",\n        vcParam: [],\n        ac: \"aac\",\n        acParam: ['-ab', '64k', '-ac', '1', '-ar', '44100'],\n        rtmp:true,\n        rtmpApp:'live2',\n        hls: true,\n        hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',\n        dash: true,\n        dashFlags: '[f=dash:window_size=3:extra_window_size=5]'\n      }\n    ]\n  }\n};\n\nvar nms = new NodeMediaServer(config)\nnms.run();\n```\n>Remux to RTMP cannot use the same app name\n\n\n# Record to MP4\n```JS\nconst NodeMediaServer = require('node-media-server');\n\nconst config = {\n  rtmp: {\n    port: 1935,\n    chunk_size: 60000,\n    gop_cache: true,\n    ping: 30,\n    ping_timeout: 60\n  },\n  http: {\n    port: 8000,\n    mediaroot: './media',\n    allow_origin: '*'\n  },\n  trans: {\n    ffmpeg: '/usr/local/bin/ffmpeg',\n    tasks: [\n      {\n        app: 'live',\n        mp4: true,\n        mp4Flags: '[movflags=frag_keyframe+empty_moov]',\n      }\n    ]\n  }\n};\n\nvar nms = new NodeMediaServer(config)\nnms.run();\n```\n\n# Rtsp/Rtmp Relay\nNodeMediaServer implement RTSP and RTMP relay with ffmpeg.\n\n## Static pull\nThe static pull mode is executed at service startup and reconnect after failure.\nIt could be a live stream or a file. In theory, it is not limited to RTSP or RTMP protocol.\n\n```\nrelay: {\n  ffmpeg: '/usr/local/bin/ffmpeg',\n  tasks: [\n    {\n      app: 'cctv',\n      mode: 'static',\n      edge: 'rtsp://admin:admin888@192.168.0.149:554/ISAPI/streaming/channels/101',\n      name: '0_149_101',\n      rtsp_transport : 'tcp' //['udp', 'tcp', 'udp_multicast', 'http']\n    }, {\n        app: 'iptv',\n        mode: 'static',\n        edge: 'rtmp://live.hkstv.hk.lxdns.com/live/hks',\n        name: 'hks'\n      }, {\n        app: 'mv',\n        mode: 'static',\n        edge: '/Volumes/ExtData/Movies/Dancing.Queen-SD.mp4',\n        name: 'dq'\n      }\n  ]\n}\n```\n\n## Dynamic pull \nWhen the local server receives a play request.\nIf the stream does not exist, pull the stream from the configured edge server to local.\nWhen the stream is not played by the client, it automatically disconnects.\n\n```\nrelay: {\n  ffmpeg: '/usr/local/bin/ffmpeg',\n  tasks: [\n    {\n      app: 'live',\n      mode: 'pull',\n      edge: 'rtmp://192.168.0.20',\n    }\n  ]\n}\n```\n\n## Dynamic push\nWhen the local server receives a publish request.\nAutomatically push the stream to the edge server.\n\n```\nrelay: {\n  ffmpeg: '/usr/local/bin/ffmpeg',\n  tasks: [\n    {\n      app: 'live',\n      mode: 'push',\n      edge: 'rtmp://192.168.0.10',\n    }\n  ]\n}\n```\n\n# Fission\nReal-time transcoding multi-resolution output\n![fission](https://raw.githubusercontent.com/illuspas/resources/master/img/admin_panel_fission.png)\n```\nfission: {\n  ffmpeg: '/usr/local/bin/ffmpeg',\n  tasks: [\n    {\n      rule: \"game/*\",\n      model: [\n        {\n          ab: \"128k\",\n          vb: \"1500k\",\n          vs: \"1280x720\",\n          vf: \"30\",\n        },\n        {\n          ab: \"96k\",\n          vb: \"1000k\",\n          vs: \"854x480\",\n          vf: \"24\",\n        },\n        {\n          ab: \"96k\",\n          vb: \"600k\",\n          vs: \"640x360\",\n          vf: \"20\",\n        },\n      ]\n    },\n    {\n      rule: \"show/*\",\n      model: [\n        {\n          ab: \"128k\",\n          vb: \"1500k\",\n          vs: \"720x1280\",\n          vf: \"30\",\n        },\n        {\n          ab: \"96k\",\n          vb: \"1000k\",\n          vs: \"480x854\",\n          vf: \"24\",\n        },\n        {\n          ab: \"64k\",\n          vb: \"600k\",\n          vs: \"360x640\",\n          vf: \"20\",\n        },\n      ]\n    },\n  ]\n}\n```\n\n# Publisher and Player App/SDK\n\n## Android Livestream App\nhttps://play.google.com/store/apps/details?id=cn.nodemedia.qlive  \nhttp://www.nodemedia.cn/uploads/qlive-release.apk  \n\n## Android SDK\nhttps://github.com/NodeMedia/NodeMediaClient-Android\n\n## iOS SDK\nhttps://github.com/NodeMedia/NodeMediaClient-iOS\n\n## React-Native SDK\nhttps://github.com/NodeMedia/react-native-nodemediaclient\n\n## NodePlayer.js HTML5 live player\n* Implemented with asm.js / wasm\n* http-flv/ws-flv\n* H.264/H.265 + AAC/Nellymoser/G.711 decoder\n* Ultra low latency (Support for iOS safari browser)\n\nhttp://www.nodemedia.cn/products/node-media-player\n\n## Windows browser plugin(ActiveX/NPAPI)\n* H.264/H.265+AAC rtmp publisher\n* Camera/Desktop + Microphone capture\n* Nvidia/AMD/Intel Hardware acceleration Encoder/Decoder\n* Ultra low latency rtmp/rtsp/http live player\n* Only 6MB installation package\n\nhttp://www.nodemedia.cn/products/node-media-client/win\n\n# Thanks\nSorng Sothearith, standifer1023, floatflower, Christopher Thomas, strive, jaysonF, 匿名, 李勇, 巴草根, ZQL, 陈勇至, -Y, 高山流水, 老郭, 孙建, 不说本可以, Jacky, 人走茶凉，树根, 疯狂的台灯, 枫叶, lzq, 番茄, smicroz , kasra.shahram, 熊科辉, Ken Lee , Erik Herz, Javier Gomez, trustfarm, leeoxiang, Aaron Turner， Anonymous  \n\nThank you for your support.\n","readmeFilename":"README.md"}