webrtc module - #144
webrtc module#144spajder16 wants to merge 4 commits into
Conversation
|
Hey, nice work! I've just gotten it running on my end and it should be a good example of the client side setup. In terms actually getting this integrated, it would need to actually take an image topic as an input, wiht usb_cam in between (supposedly doable with a custom MediaStreamTrack from what I can find so far), and would be rolled into the existing flask server where requesting some specific url scheme, e.g. /image_stream/topicname would return a stream of that topic. Getting just a hardcoded topic to stream would be the first thing of course, I might give it a try this weekend if I have any extra time. |
|
Curious to know if there was any headway into implementing this feature. A few people have asked me about WebRTC video support when I've talked about Vizanti. I'm doing fine with the current implementation, but seems like a good upgrade to have. Happy to help however I can with this, though I'd have to first familiarize myself with the process of using WebRTC and the steps mentioned in your last comment. |
|
Well there was this one idea I looked into a while back that would replace rosbridge entirely with just webrtc streaming, and in theory that would be the best option if one were to optimize for low network throughput, and it would also include image streaming from ROS or elsewhere. I was kinda hoping we could push point clouds through it too. The test implementation does function, but the serverside CPU overhead is comically massive (cores pinned to 100% on an x86 workstation kind of deal), since everything needs to be transcoded. Turns out you can't really make use of any hardware h264 accelerators for data channels and arbitrary data, because the image based encodings are completely different. So yeah we're back to this more specialized approach. There's lots of practical sources that provide h264 from the get-go, like IP and some high end webcams, and if not, most platforms do have those built in video accelerators these days (except the Pi 5 for some reason lmao). So with that available and continued demand for it, it would make sense to integrate something along those lines. There are a few ways that we could go about it I think:
The parts I'd generally love to avoid is requiring aiortc by default (in the name of reducing bloat and I'm not sure how good the platform availability is, though it generally seems decent), and the whole arbitrary URL input since it's hard to do well in terms of UX. What might be interesting is to set up an encoder node this way:
Then in the client you'd have nicely named streams, selectable on the topic dropdown and each is just a video target underneath. Would be a bit of a tradeoff when debugging raw sources, but more practical in daily use? Idk. Doing it properly would be pretty convoluted, so maybe it would really make the most sense to start with the lite approach like originally implemented in this PR, of just having client support for it and an optional demo streamer node. |
Hi,
I have developed a module for receiving WebRTC video streams. This allows real-time video transmission from a robot’s camera. Below is a Python example that demonstrates how to create a WebRTC server and stream video from a webcam.
Unfortunately, it is not currently integrated with ROS, but it shows promise and is worth further development.
Webrtc examples: aiortc