pikvm / ustreamer

µStreamer - Lightweight and fast MJPEG-HTTP streamer
https://pikvm.org
GNU General Public License v3.0
1.67k stars 226 forks source link

WebRTC streaming for H.264 memory sink #102

Closed engelant closed 3 years ago

engelant commented 3 years ago

I don't know if this already came up, but you may want to have a look at this Rpi WebRTC Streamer Demo Video, more precice the link to the github repo in the description.

I don't know if/how well it works on a PI4, but it leverages the hardware h264 encoder and gives 1080p@30fps without a problem. I tried it out in my octoprint, running on an older pi2 or 3 (can't remember which one it was), disabeling the "normal" mjpeg. And it's like really nice.

But as always with a grain of salt, at least when I tested it:

Although, this doesn't seem too hard of an issue, as the underlying tech (webrtc, I use it a lot with meet.jit.si) seems quiet mature and in the worst case it needs a reconnect button in the ui and in the best case some js logic will catch the broken connection.

mdevaev commented 3 years ago

In fact, ustreamer can compress an h264 stream with minimal latency, and it can be routed somewhere using ustreamer-dump. Or read from shared memory. I am currently writing a plugin for janus-gateway. In the first approach, it works very well. With many clients also.

mdevaev commented 3 years ago

It is done and works perfectly. Unfortunately, I don't have much time to document this, I can only offer links to an example configuration from Janus. I hope this helps.