Skip to content

WebRTC desktop streamer using Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

JRF63/desktop-streaming

Repository files navigation

WebRTC Desktop Streamer

A Rust lang streaming app in the same vein as Steam Link, Parsec and Moonlight. And has touch/pen passthrough support unlike those three.

Usage

cargo run --release

then use the browser to go to the PC's IP address at port 9090.

Performance

latency

Achievable latency is around 50 ms. The breakdown being:

  • ~16 ms inside the encoder
  • < 1 ms through the network
  • leaving about 33 ms for the browser's decoding?

How it works

The video output is done by capturing the desktop though Windows' IDXGIOutputDuplication API, encodes it using NvEnc, fragments the resulting NAL's, then shoves it through webrtc-rs.

Touch/pen input is simulated through the InjectSyntheticPointerInput API with the data coming from the browser's PointerEvent.

WebRTC signaling is handled through WebSocket's. The plan being to support both browser and native client using the same server implementation.

TODO

  • Make it work on Firefox
  • Native client for lower latency and to have support for HEVC
  • Handle reconnect after disconnection without closing the server
  • Encrypt WebSocket comm. with TLS using a self-signed cert
  • Some type of authentication (JWT maybe?)
  • AMD, Intel encoders
  • Linux server using PipeWire
  • Gamepad support
  • Audio streaming via Opus

About

WebRTC desktop streamer using Rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks