webrtc-rs / webrtc

A pure Rust implementation of WebRTC
https://webrtc.rs
Apache License 2.0
4.04k stars 359 forks source link

[WebRTC/Media] full webrtc client stack. #94

Open cloudwebrtc opened 2 years ago

cloudwebrtc commented 2 years ago

The feasibility of replacing google libwebrtc with webrtc-rs, We need to port several key modules of libwebrtc, NetEQ, audio 3A(AEC, AGC, NS), audio/video codec, and other parts that can be replaced by the rust library. rust has a good audio and video library, audio: cpal camera: eye-rs screen capture: scrap

We will get a webrtc full-platform stack with less code, memory safety, and embedded friendly.

cloudwebrtc commented 2 years ago

I am trying to investigate the packaging difficulty of several core modules, we need to try to depend on as few CPP modules as possible.

daniel-abramov commented 2 years ago

The feasibility of replacing google libwebrtc with webrtc-rs,

These are big ambitions, I like it 🙂 I think it would be really cool to have a "native Rust" replacement of the libwebrtc.

But would it be enough to use the crates specified in the issue description to really replace the libwebrtc fully?

I might be wrong, but so far I did find a possibility to encode the video using the webrtc-rs. I stumbled across the crate while trying to bring the WebRTC support to the application that is capable of capturing screen content and that needs to properly encode and send them to the WebRTC media server, but I noticed that it's not quite possible unless I use an external recorder (some other crate) to encode the image::RgbaImage using some sort of a vp8/vp9 encoder that I could then use to pass to the webrtc-rs.

I think probably libvpx with some of the Rust bindings could be used (there are a couple available).

screen capture: scrap

Two cents from my side: I'm also not sure it would be the optimal choice as it seems like the crate has not been updated for a while. In addition, [unlike browser implementation] does not support capturing individual windows. Perhaps writing another crate that could do it based on the available crates would be an option.

morajabi commented 2 years ago

Two cents from my side: I'm also not sure it would be the optimal choice as it seems like the crate has not been updated for a while.

There's an up-to-date in production fork here: https://github.com/rustdesk/rustdesk/tree/master/libs/scrap

morajabi commented 1 year ago

Camera: nokhwa — updated very recently