hero

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rtmp disconnect, no DASH data is available

See original GitHub issue

Issue Description

As soon as I connect to the server log looks like this:

2018-7-18 01:15:01 5092 [INFO] [rtmp connect] id=IDQQI19K ip=::ffff:127.0.0.1 app=live args={"app":"live","type":"nonprivate","flashVer":"FMLE/3.0 (compatible; FMSc/1.0)","swfUrl":"rtmp://localhost/live","tcUrl":"rtmp://localhost/live"}
2018-7-18 01:15:01 5092 [INFO] [rtmp publish] New stream. id=IDQQI19K streamPath=/live/test streamId=1
2018-7-18 01:15:02 5092 [INFO] [rtmp publish] Handle audio. id=IDQQI19K streamPath=/live/test sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 2ch
2018-7-18 01:15:02 5092 [INFO] [rtmp publish] Handle video. id=IDQQI19K streamPath=/live/test frame_type=1 codec_id=7 codec_name=H264 1920x1080
2018-7-18 01:15:02 5092 [INFO] [Transmuxing HLS] /live/test to ./media/live/test/index.m3u8
2018-7-18 01:15:02 5092 [INFO] [Transmuxing DASH] /live/test to ./media/live/test/index.mpd
2018-7-18 01:15:02 5092 [INFO] [rtmp connect] id=4FEZOYOW ip=::ffff:127.0.0.1 app=live args={"app":"live","tcUrl":"rtmp://127.0.0.1:1935/live","fpad":false,"capabilities":15,"audioCodecs":3191,"videoCodecs":252,"videoFunction":1}
[NodeEvent on prePlay] id=4FEZOYOW StreamPath=/live/test args={}
2018-7-18 01:15:02 5092 [INFO] [rtmp play] Join stream. id=4FEZOYOW streamPath=/live/test  streamId=1
2018-7-18 01:15:06 5092 [INFO] [rtmp play] Close stream. id=4FEZOYOW streamPath=/live/test streamId=1
2018-7-18 01:15:06 5092 [INFO] [rtmp play] Close stream. id=4FEZOYOW streamPath=/live/test streamId=1
2018-7-18 01:15:06 5092 [INFO] [rtmp disconnect] id=4FEZOYOW
2018-7-18 01:15:06 5092 [INFO] [Transmuxing end] /live/test

So both of DASH and HLS become unavailable within 5 seconds after rtmp connect. Here’s my file

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: '*',
        mediaroot: './media',
    },
    trans: {
        ffmpeg: 'C:\\Program Files\\ImageMagick-7.0.5-Q16\\ffmpeg.exe',
        tasks: [
            {
                app: 'live',
                ac: 'aac',
                // mp4: true,
                // mp4Flags: '[movflags=faststart]',
                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]'
            },
        ],
    },
};

const nms = new NodeMediaServer(config); //todo: cluster
nms.run();

Issue Analytics

No results found

github_iconTop GitHub Comments

2reactions
iamcsharpercommented, Jul 25, 2018

@Feras94 Hi, I changed the server and player and now it works perfectly. If you’re struggling with Node-Media-Server which is quite dead, I highly recommend you to take a look at https://github.com/meisterplayer/meisterplayer and https://github.com/arut/nginx-rtmp-module they are both free My ngnix config is:

# RTMP configuration
rtmp {
    server {
        listen 1935; # Listen on standard RTMP port
        chunk_size 4000;

        application live {
            live on;
            hls on;
            hls_path /root/streaming/hls/;
           #never set following two props to high values
            hls_fragment 3; 
			hls_playlist_length 60;
			hls_continuous on;
			hls_nested on;
			
			# clean hls playback files when stream is closed
			# hls_cleanup on;
			
            # disable consuming the stream from nginx as rtmp
            deny play all;
			

        }
    }
}
http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    directio 512;
    default_type application/octet-stream;

    server {
        listen 8000;

        location /hls {
            expires max;
            # Disable cache
            add_header 'Cache-Control' 'no-cache';

            add_header 'Access-Control-Allow-Origin' '*' always;
            add_header 'Access-Control-Expose-Headers' 'Content-Length';

            if ($request_method = 'OPTIONS') {
                add_header 'Access-Control-Allow-Origin' '*';
                add_header 'Access-Control-Max-Age' 1728000;
                add_header 'Content-Type' 'text/plain charset=UTF-8';
                add_header 'Content-Length' 0;
                return 204;
            }

            types {
                application/dash+xml mpd;
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }

            root /root/streaming/;
        }
    }
}

Then I created a folder “/root/streaming” and that’s the place where stream folders are created. Meisterplayer supports that feature, I hope this helps

0reactions
jon-mccormackcommented, Feb 11, 2020

Just coming across this problem myself with the exact same symptoms, I noticed my stream was encoded using “Sorenson-H263”, when I changed that encoding to “H264” node-media-server transmuxed the stream as expected

Read more comments on GitHub >

github_iconTop Results From Across the Web

rtmp disconnect, no DASH data is available - IRZU INSTITUTE
As soon as I connect to the server log looks like this: 2018-7-18 01:15:01 5092 [INFO] [rtmp connect] id=IDQQI19K ip=::ffff:127.0.0.1 ...
| NGINX | FFMPEG not creating DASH manifests or chunks in ...
From here I am trying to serve some MPEG DASH manifests and chunks to an experimental spatial audio/360 web (. js) player.
How To Set Up a Video Streaming Server using Nginx-RTMP ...
There are two protocols that you can use to create HTTP-based video streams: Apple's HLS and MPEG DASH. They both have advantages and ......
Read more >
Problems with HSL or DASH? README. - Google Groups
Hi,. I am not sure how to properly pipe it to ffmpeg to produce mpeg-dash from ffmpeg. Do you think you could post...
Read more >
Nginx-Rtmp-Module命令_xiaojun11-的博客-CSDN博客
rtmp -module版本:1.1.4FeaturesRTMP/HLS/MPEG-DASH live streamingRTMP Video on demand ... There's no time gap between the old data and the new data in file.

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found