mafintosh / hypervision

P2P Television
MIT License
449 stars 59 forks source link

Streaming a vlc stream #6

Open nicopace opened 7 years ago

nicopace commented 7 years ago

Would be really powerful if we can stream a vlc stream (or any http video stream) through here. BTW: awesome project!

louiscenter commented 7 years ago

@nicopace this is a really good idea. I also want to figure out a way to broadcast from tools like vlc, ffmpeg, and Open Broadcaster Software to viewers on hypervision.

There was also a suggestion on the #dat IRC chatroom that we could mux external streams together via hypervision, so this could be another way to achieve that. I'll figure something out and post more updates soon.

nicopace commented 7 years ago

@louiscenter there are tools (like Open Broadcaster and VLC) that allow you to mix different streams. I feel that the chance to use at least one stream is an enougth feature already! :)

louiscenter commented 7 years ago

@nicopace I'd love to figure out a way to pipe OBS into hypervision. Will keep you posted!

nicopace commented 7 years ago

@louiscenter for that you need an rtmp streaming server to receive the stream OBS pushes. There is a very lightweight RTMP streaming server called rtmpd (http://www.rtmpd.com/) (https://github.com/ElfSundae/crtmpserver).

t-mullen commented 7 years ago

Here's a good Node RTMP server implementation too: rtmp-server. It works with OBS just fine (the more popular fork doesn't) and I've had success serving the streams through HLS.

The next issue would be how to change the RTMP streams into the webm clusters that MediaRecorder provides, or finding a decent RTMP player and switching hypervision to that (which likely means Flash, yuck).

louiscenter commented 7 years ago

thanks for linking to rtmp-server. this looks super useful ^__^ if we eventually embed ffmpeg inside the electron app, I wonder if it could somehow handle the conversion between the two?

t-mullen commented 7 years ago

ffmpeg will probably work if we can find the right options, but building it from source takes quite awhile...

Another less conventional option is to use OBS's buffering capture feature and just read the capture files from disk. But then other RTMP clients would be out. :/

Compy commented 7 years ago

I've done similar things by using OBS -> NGINX-RTMP -> FFMPEG -> Janus WebRTC Gateway -> Browser. The total delay is ~3s. The key would be making sure the streams still use the peer mesh rather than having the webrtc gateway always in the media path.

t-mullen commented 7 years ago

Was FFMPEG converting the RTMP stream to WebRTC in that system @Compy ? Or did Janus handle that.