Node-Media-Server
Node-Media-Server copied to clipboard
Is it possible to restream to Youtube?
Please check the readme .
Thanks, I can't do it, although I tried many configuration options in relay mode. And how would you do it?
Where do I have to specify the "stream name / key" that Google broadcasts authenticates?
Here is how I did it:
- My Node-Media-Server config: const config = { logType: 3,
rtmp: { port: 1935, chunk_size: 60000, gop_cache: true, ping: 30, ping_timeout: 60 }, http: { port: 8000, mediaroot: './media', allow_origin: '*' },
relay: { ffmpeg: '/usr/local/bin/ffmpeg', tasks: [ { app: 'live', mode: 'push', edge: 'rtmp://a.rtmp.youtube.com/live2', name: '{secret stream name/key from Youtube Stream Now}', } ] } };
-
Lanched a video stream: ffmpeg -re -i ~/Downloads/temp/Ma\ Long\ Forehand\ and\ Backhand\ Technique.mp4 -c copy -f flv rtmp://192.168.31.230/live/
-
Console output: 5/1/2019 11:06:48 31572 [INFO] Node Media Server v2.1.0 5/1/2019 11:06:49 31572 [INFO] Node Media Rtmp Server started on port: 1935 5/1/2019 11:06:49 31572 [INFO] Node Media Http Server started on port: 8000 5/1/2019 11:06:49 31572 [INFO] Node Media WebSocket Server started on port: 8000 5/1/2019 11:06:49 31572 [INFO] Node Media Relay Server started 5/1/2019 11:13:20 31572 [INFO] [rtmp connect] id=BHTK17JL ip=::ffff:192.168.31.216 app=live args={"app":"live","type":"nonprivate","tcUrl":"rtmp://192.168.31.230/live"} 5/1/2019 11:13:20 31572 [INFO] [rtmp publish] New stream. id=BHTK17JL streamPath=/live/ streamId=1 5/1/2019 11:13:20 31572 [FFDEBUG] -fflags,nobuffer,-i,rtmp://127.0.0.1:1935/live/,-c,copy,-f,flv,rtmp://a.rtmp.youtube.com/live2/ 5/1/2019 11:13:20 31572 [INFO] [Relay dynamic push] start BHTK17JL rtmp://127.0.0.1:1935/live/ to rtmp://a.rtmp.youtube.com/live2/ 5/1/2019 11:13:20 31572 [INFO] [rtmp publish] Handle video. id=BHTK17JL streamPath=/live/ frame_type=1 codec_id=7 codec_name=H264 1280x720 5/1/2019 11:13:20 31572 [INFO] [rtmp publish] Handle audio. id=BHTK17JL streamPath=/live/ sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 2ch 5/1/2019 11:13:20 31572 [FFDEBUG] FF输出:ffmpeg version N-91148-g8557a0940e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: 5/1/2019 11:13:20 31572 [FFDEBUG] FF输出: libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 19.102 / 58. 19.102 libavformat 58. 16.100 / 58. 16.100 libavdevice 58. 4.100 / 58. 4.100 libavfilter 7. 24.100 / 7. 24.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 5/1/2019 11:13:20 31572 [INFO] [rtmp connect] id=GS4LBHCY ip=::ffff:127.0.0.1 app=live args={"app":"live","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:1935/live","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1} 5/1/2019 11:13:21 31572 [INFO] [rtmp play] Join stream. id=GS4LBHCY streamPath=/live/ streamId=1 5/1/2019 11:13:23 31572 [FFDEBUG] FF输出:Input #0, flv, from 'rtmp://127.0.0.1:1935/live/': Metadata: major_brand : mp42 5/1/2019 11:13:23 31572 [FFDEBUG] FF输出: minor_version : 0 compatible_brands: isommp42 encoder : Lavf58.20.100 Duration: 00:00:00.00, start: 0.040000, bitrate: N/A Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 125 kb/s Stream #0:1: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 815 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc 5/1/2019 11:13:23 31572 [FFDEBUG] FF输出:rtmp://a.rtmp.youtube.com/live2/: Input/output error 5/1/2019 11:13:23 31572 [INFO] [rtmp play] Close stream. id=GS4LBHCY streamPath=/live/ streamId=1 5/1/2019 11:13:23 31572 [INFO] [rtmp disconnect] id=GS4LBHCY 5/1/2019 11:13:23 31572 [INFO] [Relay end] id= BHTK17JL
Can you please format the console output ?
Can you try the config like this
relay: {
ffmpeg: '/usr/local/bin/ffmpeg',
tasks: [
{
app: 'live',
mode: 'push',
edge: 'rtmp://a.rtmp.youtube.com/live2/<stream_key>',
}
]
}
without the <>
Because in rtmp://a.rtmp.youtube.com/live2/: Input/output error
the stream key is missing . So please try out my solution and let me know if it works .
Maybe we should add one more key in the relay config to substitute for the stream key ? Can you make a pull request with this feature ?
Thanks for the help, but for some reason, the NMS inserts the symbol "/" at the end of the URL, and perhaps because of this, Youtube does not accept the content:
5/2/2019 08:13:00 5238 [INFO] Node Media Server v2.1.0 5/2/2019 08:13:00 5238 [INFO] Node Media Rtmp Server started on port: 1935 5/2/2019 08:13:00 5238 [INFO] Node Media Http Server started on port: 8000 5/2/2019 08:13:00 5238 [INFO] Node Media WebSocket Server started on port: 8000 5/2/2019 08:13:00 5238 [INFO] Node Media Relay Server started 5/2/2019 08:13:21 5238 [INFO] [rtmp connect] id=1S8T3UZU ip=::ffff:192.168.31.216 app=youtube args={"app":"youtube","type":"nonprivate","tcUrl":"rtmp://192.168.31.230/youtube"} 5/2/2019 08:13:21 5238 [INFO] [rtmp publish] New stream. id=1S8T3UZU streamPath=/youtube/ streamId=1 5/2/2019 08:13:21 5238 [FFDEBUG] -fflags,nobuffer,-i,rtmp://127.0.0.1:1935/youtube/,-c,copy,-f,flv,rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/ 5/2/2019 08:13:21 5238 [INFO] [Relay dynamic push] start 1S8T3UZU rtmp://127.0.0.1:1935/youtube/ to rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/ 5/2/2019 08:13:21 5238 [INFO] [rtmp publish] Handle video. id=1S8T3UZU streamPath=/youtube/ frame_type=1 codec_id=7 codec_name=H264 1280x720 5/2/2019 08:13:21 5238 [INFO] [rtmp publish] Handle audio. id=1S8T3UZU streamPath=/youtube/ sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 2ch 5/2/2019 08:13:21 5238 [FFDEBUG] FF输出:ffmpeg version N-91148-g8557a0940e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration:
5/2/2019 08:13:21 5238 [FFDEBUG] FF输出: libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 19.102 / 58. 19.102 libavformat 58. 16.100 / 58. 16.100 libavdevice 58. 4.100 / 58. 4.100 libavfilter 7. 24.100 / 7. 24.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100
5/2/2019 08:13:21 5238 [INFO] [rtmp connect] id=65ADIACS ip=::ffff:127.0.0.1 app=youtube args={"app":"youtube","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:1935/youtube","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1} 5/2/2019 08:13:21 5238 [INFO] [rtmp play] Join stream. id=65ADIACS streamPath=/youtube/ streamId=1 5/2/2019 08:13:23 5238 [FFDEBUG] FF输出:Input #0, flv, from 'rtmp://127.0.0.1:1935/youtube/': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 encoder : Lavf58.20.100 Duration: 00:00:00.00, start: 0.033000, bitrate: N/A Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s Stream #0:1: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 1813 kb/s, 30 fps, 30 tbr, 1k tbn, 60 tbc
5/2/2019 08:13:24 5238 [FFDEBUG] FF输出:rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/: Input/output error
5/2/2019 08:13:24 5238 [INFO] [rtmp play] Close stream. id=65ADIACS streamPath=/youtube/ streamId=1 5/2/2019 08:13:24 5238 [INFO] [rtmp disconnect] id=65ADIACS 5/2/2019 08:13:24 5238 [INFO] [Relay end] id= 1S8T3UZU
Tell me, please, how I can format the console output more readable?
ffmpeg has one option -loglevel
. It must be set to make ffmpeg spit out more readable info .
Thanks for the help, but for some reason, the NMS inserts the symbol "/" at the end of the URL, and perhaps because of this, Youtube does not accept the content:
5/2/2019 08:13:00 5238 [INFO] Node Media Server v2.1.0 5/2/2019 08:13:00 5238 [INFO] Node Media Rtmp Server started on port: 1935 5/2/2019 08:13:00 5238 [INFO] Node Media Http Server started on port: 8000 5/2/2019 08:13:00 5238 [INFO] Node Media WebSocket Server started on port: 8000 5/2/2019 08:13:00 5238 [INFO] Node Media Relay Server started 5/2/2019 08:13:21 5238 [INFO] [rtmp connect] id=1S8T3UZU ip=::ffff:192.168.31.216 app=youtube args={"app":"youtube","type":"nonprivate","tcUrl":"rtmp://192.168.31.230/youtube"} 5/2/2019 08:13:21 5238 [INFO] [rtmp publish] New stream. id=1S8T3UZU streamPath=/youtube/ streamId=1 5/2/2019 08:13:21 5238 [FFDEBUG] -fflags,nobuffer,-i,rtmp://127.0.0.1:1935/youtube/,-c,copy,-f,flv,rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/ 5/2/2019 08:13:21 5238 [INFO] [Relay dynamic push] start 1S8T3UZU rtmp://127.0.0.1:1935/youtube/ to rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/ 5/2/2019 08:13:21 5238 [INFO] [rtmp publish] Handle video. id=1S8T3UZU streamPath=/youtube/ frame_type=1 codec_id=7 codec_name=H264 1280x720 5/2/2019 08:13:21 5238 [INFO] [rtmp publish] Handle audio. id=1S8T3UZU streamPath=/youtube/ sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 2ch 5/2/2019 08:13:21 5238 [FFDEBUG] FF输出:ffmpeg version N-91148-g8557a0940e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration:
5/2/2019 08:13:21 5238 [FFDEBUG] FF输出: libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 19.102 / 58. 19.102 libavformat 58. 16.100 / 58. 16.100 libavdevice 58. 4.100 / 58. 4.100 libavfilter 7. 24.100 / 7. 24.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100
5/2/2019 08:13:21 5238 [INFO] [rtmp connect] id=65ADIACS ip=::ffff:127.0.0.1 app=youtube args={"app":"youtube","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:1935/youtube","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1} 5/2/2019 08:13:21 5238 [INFO] [rtmp play] Join stream. id=65ADIACS streamPath=/youtube/ streamId=1 5/2/2019 08:13:23 5238 [FFDEBUG] FF输出:Input #0, flv, from 'rtmp://127.0.0.1:1935/youtube/': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 encoder : Lavf58.20.100 Duration: 00:00:00.00, start: 0.033000, bitrate: N/A Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s Stream #0:1: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 1813 kb/s, 30 fps, 30 tbr, 1k tbn, 60 tbc
5/2/2019 08:13:24 5238 [FFDEBUG] FF输出:rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/: Input/output error
5/2/2019 08:13:24 5238 [INFO] [rtmp play] Close stream. id=65ADIACS streamPath=/youtube/ streamId=1 5/2/2019 08:13:24 5238 [INFO] [rtmp disconnect] id=65ADIACS 5/2/2019 08:13:24 5238 [INFO] [Relay end] id= 1S8T3UZU
Tell me, please, how I can format the console output more readable?
No thats not the reason . The reason is that the stream key is missing
5/2/2019 08:13:00 5238 [INFO] Node Media Server v2.1.0
5/2/2019 08:13:00 5238 [INFO] Node Media Rtmp Server started on port: 1935
5/2/2019 08:13:00 5238 [INFO] Node Media Http Server started on port: 8000
5/2/2019 08:13:00 5238 [INFO] Node Media WebSocket Server started on port: 8000
5/2/2019 08:13:00 5238 [INFO] Node Media Relay Server started
5/2/2019 08:13:21 5238 [INFO] [rtmp connect] id=1S8T3UZU ip=::ffff:192.168.31.216 app=youtube args={"app":"youtube","type":"nonprivate","tcUrl":"rtmp://192.168.31.230/youtube"}
5/2/2019 08:13:21 5238 [INFO] [rtmp publish] New stream. id=1S8T3UZU streamPath=/youtube/ streamId=1
5/2/2019 08:13:21 5238 [FFDEBUG] -fflags,nobuffer,-i,rtmp://127.0.0.1:1935/youtube/,-c,copy,-f,flv,rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/
5/2/2019 08:13:21 5238 [INFO] [Relay dynamic push] start 1S8T3UZU rtmp://127.0.0.1:1935/youtube/ to rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/
5/2/2019 08:13:21 5238 [INFO] [rtmp publish] Handle video. id=1S8T3UZU streamPath=/youtube/ frame_type=1 codec_id=7 codec_name=H264 1280x720
5/2/2019 08:13:21 5238 [INFO] [rtmp publish] Handle audio. id=1S8T3UZU streamPath=/youtube/ sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 2ch
5/2/2019 08:13:21 5238 [FFDEBUG] FF输出:ffmpeg version N-91148-g8557a0940e Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration:
5/2/2019 08:13:21 5238 [FFDEBUG] FF输出: libavutil 56. 18.102 / 56. 18.102
libavcodec 58. 19.102 / 58. 19.102
libavformat 58. 16.100 / 58. 16.100
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 24.100 / 7. 24.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
5/2/2019 08:13:21 5238 [INFO] [rtmp connect] id=65ADIACS ip=::ffff:127.0.0.1 app=youtube args={"app":"youtube","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:1935/youtube","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
5/2/2019 08:13:21 5238 [INFO] [rtmp play] Join stream. id=65ADIACS streamPath=/youtube/ streamId=1
5/2/2019 08:13:23 5238 [FFDEBUG] FF输出:Input #0, flv, from 'rtmp://127.0.0.1:1935/youtube/':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf58.20.100
Duration: 00:00:00.00, start: 0.033000, bitrate: N/A
Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 1813 kb/s, 30 fps, 30 tbr, 1k tbn, 60 tbc
5/2/2019 08:13:24 5238 [FFDEBUG] FF输出:rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/: Input/output error
5/2/2019 08:13:24 5238 [INFO] [rtmp play] Close stream. id=65ADIACS streamPath=/youtube/ streamId=1
5/2/2019 08:13:24 5238 [INFO] [rtmp disconnect] id=65ADIACS
5/2/2019 08:13:24 5238 [INFO] [Relay end] id= 1S8T3UZU
Okay . The stream key is there . Can you give me the output of this
ffmpeg -loglevel debug -re -i <input> -f flv rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/
Here you are streaming a file as input to simulate a livestream .
A very large log will get with the "-loglevel debug" key. Let's make it easier:
-
With the symbol "/" at the end of the URL video broadcast does not work: MacBook-Pro:/ Vadim$ ffmpeg -re -i ~/Downloads/temp/Ma\ Long\ Forehand\ and\ Backhand\ Technique.mp4 -c copy -f flv rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/ -loglevel error RTMP_ReadPacket, failed to read RTMP packet header rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46/: Unknown error occurred
-
Without the "/" symbol at the end of the URL, the video broadcast really works: MacBook-Pro:/ Vadim$ ffmpeg -re -i ~/Downloads/temp/Ma\ Long\ Forehand\ and\ Backhand\ Technique.mp4 -c copy -f flv rtmp://a.rtmp.youtube.com/live2/9qtz-mu76-7htf-ej46 -loglevel error
My qualification is not enough to correct the error in the code: "Do not put the character "/" if it is not in the edge URL in the config."
Okay . That sounds great . Can you make a pull request to fix this ?
It seems ffmpeg is not normalizing the urls . But thats fine . I'll make a pull request fixing this ASAP .
Thank you so much!
You're welcome . :)
@parthibd, is it ASAP time to come soon? :)
@VadimGuslistov - I have a work around for this, if you still need a fix ?
Yes, I need it. Thank you very much!
@VadimGuslistov - I have a work around for this, if you still need a fix ?
Hello do you mind sharing with me as well, I been trying to it on Facebook Live but I'm unable to do it, and I'm not sure what I'm doing wrong
Yes, I need it. Thank you very much!
Hello, I've got the same issue could you help me out if you've found the solution?
I think I got a workaround, not sure if it's the correct way of doing it.
in the function onPostPublish in node_relay_server.js add a variable.
let newStream = stream.length ?
/${stream} : stream
and change
conf.ouPath = hasApp ?
${conf.edge}/${stream}:
${conf.edge}${streamPath};
to
conf.ouPath = hasApp ?
${conf.edge}${newStream}:
${conf.edge}${streamPath};
could someone check it out if it's correct, please?
I think I got a workaround, not sure if it's the correct way of doing it.
in the function onPostPublish in node_relay_server.js add a variable.
let newStream = stream.length ?
/${stream}: stream
and changeconf.ouPath = hasApp ?
${conf.edge}/${stream}:
${conf.edge}${streamPath};
toconf.ouPath = hasApp ?
${conf.edge}${newStream}:
${conf.edge}${streamPath};
could someone check it out if it's correct, please?
Its not work. My solution is replace all
hasApp ? ${conf.edge}/${stream}:${conf.edge}${streamPath};
to
'rtmp://a.rtmp.youtube.com/live2/<stream key>'
lol
Hi
Sorry I’ve been away. I will look at my fix later and update the form.
Nick Grant
On 18 Jul 2019, at 10:16, cpanel10x <[email protected]mailto:[email protected]> wrote:
I think I got a workaround, not sure if it's the correct way of doing it.
in the function onPostPublish in node_relay_server.js add a variable. let newStream = stream.length ? /${stream} : stream and change conf.ouPath = hasApp ? ${conf.edge}/${stream}:${conf.edge}${streamPath}; to conf.ouPath = hasApp ? ${conf.edge}${newStream}:${conf.edge}${streamPath};
could someone check it out if it's correct, please?
Its not work. My solution is replace all
hasApp ? ${conf.edge}/${stream}:${conf.edge}${streamPath};
to
rtmp://a.rtmp.youtube.com/live2/
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/illuspas/Node-Media-Server/issues/196?email_source=notifications&email_token=AG4NAQPBDHGXFZGSBIVOQKTQAAYIPA5CNFSM4HJQ3D5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2H3RLI#issuecomment-512735405, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AG4NAQN3ZP3NZ3YARD744J3QAAYIPANCNFSM4HJQ3D5A.
Hi All
To get this to work i removed ${stream} from the onPostPublish function .
onPostPublish(id, streamPath, args) {
if (!this.config.relay.tasks) {
return;
}
let regRes = //(.)/(.)/gi.exec(streamPath);
let [app, stream] = _.slice(regRes, 1);
let i = this.config.relay.tasks.length;
while (i--) {
let conf = this.config.relay.tasks[i];
let isPush = conf.mode === 'push';
if (isPush && app === conf.app) {
let hasApp = conf.edge.match(/rtmp://([^/]+)/([^/]+)/);
conf.ffmpeg = this.config.relay.ffmpeg;
conf.inPath = rtmp://127.0.0.1:${this.config.rtmp.port}${streamPath}
;
conf.ouPath = hasApp ? ${conf.edge}
: ${conf.edge}
;
let session = new NodeRelaySession(conf);
session.id = id;
session.on('end', (id) => {
this.dynamicSessions.delete(id);
});
this.dynamicSessions.set(id, session);
session.run();
Logger.log('[Relay dynamic push] start', id, conf.inPath, ' to ', conf.ouPath);
}
}
}
Then within my relay config this is my setup and it works like a dream. i'm not sure if this is the correct way around but it works.
relay: { ffmpeg: '/usr/local/bin/ffmpeg', tasks: [ { app: 'live', mode: 'push', edge: 'rtmp://a.rtmp.youtube.com/live2/<stream_key>', } ] }
onPostPublish(id, streamPath, args) {
if (!this.config.relay.tasks) {
return;
}
let regRes = /\/(.*)\/(.*)/gi.exec(streamPath);
let [app, stream] = _.slice(regRes, 1);
let i = this.config.relay.tasks.length;
while (i--) {
let conf = this.config.relay.tasks[i];
let isPush = conf.mode === 'push';
if (isPush && app === conf.app) {
let hasApp = conf.edge.match(/rtmp:\/\/([^\/]+)\/([^\/]+)/);
conf.ffmpeg = this.config.relay.ffmpeg;
conf.inPath = `rtmp://127.0.0.1:${this.config.rtmp.port}${streamPath}`;
conf.ouPath = hasApp ? `${conf.edge}` : `${conf.edge}`;
let session = new NodeRelaySession(conf);
session.id = id;
session.on('end', (id) => {
this.dynamicSessions.delete(id);
});
this.dynamicSessions.set(id, session);
session.run();
Logger.log('[Relay dynamic push] start', id, conf.inPath, ' to ', conf.ouPath);
}
}
}
Hi guys. That pull is great solution for fix that problem https://github.com/illuspas/Node-Media-Server/pull/210