kyriesent / node-rtsp-stream

Stream any RTSP stream and output to websocket for consumption by jsmpeg (https://github.com/phoboslab/jsmpeg). HTML5 streaming video! Requires ffmpeg.
MIT License
451 stars 166 forks source link

Stream Multi Channel #13

Closed abdkaviani closed 6 years ago

abdkaviani commented 6 years ago

Hello

This project is very interesting and useful for me But can I stream multi channel by this way?

Thanks a lot

kyriesent commented 6 years ago

Hi @abdkaviani, I'm not sure what you're referring to by multichannel. Can you elaborate or link to a description of what you mean? Thanks!

abdkaviani commented 6 years ago

Hi

In your project and server side... StreamUrl is equal to 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov' and wsPort is 9999,

I want to "server.js" streaming two or more RTSP URL in the same port & client displays two or more video, for example:

On server: stream = new Stream({ name: ['name','name2'], streamUrl: ['rtsp://184.72.239.149/1.mov','rtsp://184.72.239.149/2.mov'], wsPort: 9999 });

On client: `

& ....` Thanks Kyriesent
kyriesent commented 6 years ago

@abdkaviani I see. What you'll want to do is create two new Streams. Each of them will need to utilize a separate ws port, and there will be two JSMpeg clients on the frontend.

abdkaviani commented 6 years ago

Thanks my friend,

And can you tell me, How I can change child_process.spawn values in server side programmatically, for example

stream = new Stream({ name: 'cam2', streamUrl: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov', wsPort: 9998, stream: 30k (instead of 800k) });

kyriesent commented 6 years ago

Unfortunately, those are hardcoded in. https://github.com/kyriesent/node-rtsp-stream/blob/master/src/mpeg1muxer.coffee#L10 is where you would want to fork and change the code. If you are going to be changing these values a lot, then I would just pass in a "mpeg1options" key to the Stream and pass it down to the Mpeg1Muxer. Hope that helps!

abdkaviani commented 6 years ago

Thank you very much I hope I can do this