rtmp disconnect, no DASH data is available
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();
Read more here: Source link