WebRTC
WebRTC copied to clipboard
FR: Merge multiple RTSP cameras into one WebRTC stream
Hi,
A lot of people, including myself, are bumping up against the limits of how many WebRTC sessions we can have going in a single browser window. One thing that would really make this the "ultimate" camera option for hass would be if we could somehow merge those camera stream into one WebRTC stream. I think this would alleviate most of the issues people have about displaying multiple cameras. A google search returned this as a starting point: https://stackoverflow.com/questions/59320085/record-multiple-rtsp-streams-into-a-single-file#59324096 What do you think?
I think it may be big CPU overhead on server. I prefer to make an online video on demand. But if someone makes an addon that merges together the video and outputs RTSP - it can be connected to WebRTC component.
Problem with 1 WebRTC stream per camera is that there will always be a hard limit to how many you can display on an endpoint (for me it's 3-4). A single stream would solve that. Unfortunately I've found nothing that can easily merge streams yet.
If there's no chance to implement it, you can close it.
I'm facing with the same problem. Have you found the way to merge multi merge multi webrtc stream into one from server? @scstraus
No not really. Nothing easy enough for me to implement quickly at least.
I'm extremely interested in this as well. I actually have no issue streaming 4 at once but when doing so to a Chromecast Ultimate, the frame rate drops into the single digits and sometimes the hardware overheats and locks up. Heh.
I'm trying to find a docker-based solution to combining 4 RTSP streams into 1. If I come up with something I'll report back. Please do the same.
Hi, I found the same concept on this docker project https://hub.docker.com/r/migoller/live555proxyserverdocker I think we can do like what it implement
Hi, I found the same concept on this docker project https://hub.docker.com/r/migoller/live555proxyserverdocker I think we can do like what it implement
This won't merge the streams into a single stream, it just proxies them so that multiple endpoints can access the stream without opening individual streams to the original source. I actually use it in my camera setup.
https://github.com/aler9/rtsp-simple-server This is used by frigate to proxy streams out and it has an HTTP api to switch the streams. This may be what is needed
Check my new project. It has integration with ffmpeg: https://github.com/AlexxIT/go2rtc
And ffmpeg can join multiple streams to one output: https://trac.ffmpeg.org/wiki/Create%20a%20mosaic%20out%20of%20several%20input%20videos%20using%20xstack
Unfortunately, I don't have the time to make the right command myself.
I think the goal is less mosaic and more a switchable output but only 1 stream
Well. You may create different Hass tabs and switch them. So only one stream will be simultaneously.
Thanks AlexIT. The FFMPEG option may work for me. It is indeed a mosaic I need as I want to watch 4 streams on my Fire tablets around the house but they aren't strong enough to open 4 WebRTC cards at once. I think one big one with all 4 streams will be better. I don't want to switch between them, that would be worse than the FFMPEG streams that already work. Thanks
Could you provide working command when you get it? I'll add it to docs :)
I'll be honest, it's a bit of a big job so I'm not sure I will get to it very soon as I'm still working okay with my ffmpeg camera approach, despite acknowledging that this solution is likely superior in many ways.