waleedahmad/node-stream

How to add dinamic relay

Opened this issue · 0 comments

I tested it and it is amazing works pretty well

But There is a question:

how can users relay their own stream for other server live facebook or youtube individually without restart the server.

I noticed if I put relay on settings it will set same relay to all user and when I change relay it restart the server. Is there a way to set individual relay to each users without restart server and stop other streams?

SAMPLE CODE:

if I set this way all user will relay for the same but I wanna have one for each.

const config = {
	server: {
		secret: '<SECRET_KEY>',
		port: 3333
	},

	rtmp_server: {
		rtmp: {
			port: 1935,
			chunk_size: 60000,
			gop_cache: true,
			ping: 60,
			ping_timeout: 30
		},
		http: {
			port: 8888,
			mediaroot: './server/media',
			allow_origin: '*'
		},
		relay: {
			ffmpeg: '/usr/bin/ffmpeg',
			tasks: [
				{
					app: 'live',
					mode: 'push',
					edge: 'rtmp://a.rtmp.youtube.com/live2/<YOUTUBE_KEY>',
				},
				{
					app: 'live',
					mode: 'push',
					edge: 'rtmps://rtmp-pc.facebook.com:443/rtmp/<FACEBOOK_KEY>',
				}
			]
		},
		trans: {
			ffmpeg: '/usr/bin/ffmpeg',
			tasks: [{
				app: 'live',
				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]'
			}]
		}
	}
};

module.exports = config;