Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Chen Mingliang
    Hey, wanted to share that some time ago I've made a statistics server for your media server. You can see it in action here - https://stats.klpq.men/streams and source code here https://github.com/rebelvg/stats-node frontend - https://github.com/rebelvg/stats-react Atm it works only with my fork of your media server but these changes could be synced with your master really easily.
    Chen Mingliang
    It looks great.
    The latest version of NMS (1.4.x) has improved performance and stability.
    If your project is compatible with the master release, it will help a lot of people. I will promote it on the homepage of NMS.
    I'll sync the changes and let you know!
    I'm trying to set up a media server to stream 100 MP4 files. Any hints as to how I'd go about this?
    I'm also looking to encrypt the streams, so I guess https should be enough?
    const config = { rtmp: { port: 1935, chunk_size: 60000, gop_cache: true, ping: 60, ping_timeout: 30 }, http: { port: 8000, mediaroot: './files', allow_origin: '*' }, https: { port: 8443, mediaroot: './files', key:'./privatekey.pem', cert:'./certificate.pem', }, // cluster: { // num: numCPUs // }, relay: { ffmpeg: '/usr/bin/ffmpeg', tasks: [ { app: 'streams', mode: 'static', edge: './files/test.mp4', name: 'test' } ] } };
    Aitor Garcia
    I want to use this as a video stream reader / player
    I already have mi streaming app, so I only need this to read a stream from an url, would this work? :D
    Hi, has anyone in here any experience with deploying your media servr
    Hello @illuspas ! I have been streaming RTSP content from a DVR to my Raspberry Pi. Since I am new to this and also because there is very little help on the Internet regarding Node Media Server, could anyone help me with removing audio from my RTSP stream?
    Josiah Bryan
    Anyone online...?
    I am interest in accessing and broadcasting web camera (not camera from web client) ?
    MC MC
    Hi All!!!
    I am very pleased to see your contribution on node-media-server
    I have some questions related to the js code....
    I hope you will be able to help me :)
    First : I found that some systems do not react correctly to session.reject() .... For instance XSplit tries to send frames but all of them are lots....
    On OBS it indicates "issue of authentification" so it is OK... I do not know if it is related to Xsplit or to reject session code...
    (I use RTMP server)
    I am testing nms in order to integrate more adaptive transformations...
    Do you also know if NMSv3 (golang) sources are available rather the docker only?
    Thx @illuspas !!!
    Varun Saini
    anyone online
    I was trying to deploy NMS on Vercel(Zeit), "Node Media Trans Server startup failed. ffmpeg:./server/trans/ffmpeg cannot be executed." my build log gives me this error
    any idea guys? thanks
    howdy all, i got a server up and running in production. I am noticing that during live streaming some people see stuttering and i will get these "moov atom not found" errors showing up in logs. any thoughts?
    are there any recommended production configs for rtmp, hls or dash?
    hey guys
    anyone else hit this error
    9/13/2020 00:42:58 19 [ERROR] uncaughtException TypeError: Cannot read property 'playStreamPath' of undefined
    at NodeRtmpSession.onPublish (/usr/src/app/node_modules/node-media-server/node_rtmp_session.js:1038:24)
    at NodeRtmpSession.rtmpInvokeHandler (/usr/src/app/node_modules/node-media-server/node_rtmp_session.js:824:14)
    at NodeRtmpSession.rtmpHandler (/usr/src/app/node_modules/node-media-server/node_rtmp_session.js:550:21)
    at NodeRtmpSession.rtmpChunkRead (/usr/src/app/node_modules/node-media-server/node_rtmp_session.js:458:18)
    at NodeRtmpSession.onSocketData (/usr/src/app/node_modules/node-media-server/node_rtmp_session.js:283:23)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
    it always throws an uncaught exception
    after which streaming no longer works until I bounce the server
    also if anyone knows how to remove these disconnect log statements
    9/13/2020 00:43:03 19 [INFO] [rtmp disconnect] id=I88KKW01
    9/13/2020 00:43:03 19 [INFO] [rtmp disconnect] id=1Y0Z4KNT
    9/13/2020 00:43:09 19 [INFO] [rtmp disconnect] id=KTTZ37UU

    I am trying to stream from my computer making it act as a server.
    I run the first example on the npm page, which is

    const NodeMediaServer = require('node-media-server');
    const config = {
      rtmp: {
        port: 1935,
        chunk_size: 60000,
        gop_cache: true,
        ping: 30,
        ping_timeout: 60
      http: {
        port: 8000,
        allow_origin: '*'
    var nms = new NodeMediaServer(config)

    which works fine if I open OBS Studio and stream on localhost, but does not if I try to get rtmp://ip_address:port/live/STREAM_NAME on another machine. Can someone help? I was thinking it might be a and not localhost problem, but I can't figure out how to configure it like so

    Hello Everyone, This is my special thank you for the great work you have been doing to keep this project up to date. I am happy to find you and will be making my contribution when necessary. Less you forget, i am a newbie and will ask question where i get stuck.
    Brijender Partap Rana

    Hi Everyone,

    is there any way to stop a stream.

    Tạ Minh Trí
    how to run npm in https ?
    Tạ Minh Trí
    how to count client is join live stream
    Hussain Badusha
    Hello guys
    How to end a single live stream by stream name or stream id
    Hi! i would like to add hls/dash to my NodeMediaServer. But its not working. Im using the Docker version. Is there someone who can take a look at my config?
    #!/usr/bin/env node
    const NodeMediaServer = require('..');
    let argv = require('minimist')(process.argv.slice(2), {
        string: ['rtmp_port', 'http_port', 'https_port'],
        alias: {
            'rtmp_port': 'r',
            'http_port': 'h',
            'https_port': 's',
        default: {
            'rtmp_port': 1935,
            'http_port': 8000,
            'https_port': 8443,
    if (argv.help) {
        console.log('  node-media-server --help // print help information');
        console.log('  node-media-server --rtmp_port 1935 or -r 1935');
        console.log('  node-media-server --http_port 8000 or -h 8000');
        console.log('  node-media-server --https_port 8443 or -s 8443');
    const config = {
        logType: 2,
        rtmp: {
            port: argv.rtmp_port,
            chunk_size: 60000,
            gop_cache: true,
            ping: 30,
            ping_timeout: 60,
        http: {
            port: argv.http_port,
            mediaroot: __dirname + '/media',
            webroot: __dirname + '/www',
            allow_origin: '*',
            api: true
        trans: {
            ffmpeg: '/usr/local/bin/ffmpeg',
            tasks: [{
                app: 'live',
                vc: "copy",
                vcParam: [],
                ac: "aac",
                acParam: ['-ab', '64k', '-ac', '1', '-ar', '44100'],
                rtmp: true,
                rtmpApp: 'live2',
                hls: true,
                hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',
                dash: true,
                dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
        auth: {
            api: true,
            api_user: 'admin',
            api_pass: '<removed>',
            play: false,
            publish: false,
            secret: '<removed>'
    let nms = new NodeMediaServer(config);
    nms.on('preConnect', (id, args) => {
        console.log('[NodeEvent on preConnect]', `id=${id} args=${JSON.stringify(args)}`);
        // let session = nms.getSession(id);
        // session.reject();
    nms.on('postConnect', (id, args) => {
        console.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)}`);
        // let session = nms.getSession(id);
        // session.reject();
    nms.on('postPublish', (id, StreamPath, args) => {
        console.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)}`);
        // let 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) => {
        console.log('[NodeEvent on donePlay]', `id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}`);