Skip to content

amoshydra/web-remote-desktop-xr

Repository files navigation

Web Remote Desktop XR

A proof of concept for a WebXR remote desktop environment utilizing WebRTC (with WHIP) and WebSockets.

Web Remote Desktop XR

Getting started

This project is primarily created to provide a VR remote desktop environment for Linux environment.

It requires:

  • NodeJS
  • Docker / podman-compose
  • Open Broadcaster Software (OBS)
docker compose up -d # starts nginx and OvenMediaEngine
npm start # start the NodeJS backend and frontend server

OvenMediaEngine

OvenMediaEngine will be started as part of the docker-compose services

docker compose logs -f ome

We use OvenMediaEngine's WHIP (WebRTC-HTTP Ingestion Protocol) for WebRTC ingest.

This will expose the following endpoints:

Broadcasting

This guide uses OBS to capture the Desktop environment and stream it to the WHIP WebRTC ingest endpoint.

Dependencies:

Sources

You can configure any source you want here.

For remote desktop experience:

  1. Configure a Screen Capture source.
  2. Select the source, right click and choose: "Resize output (source size)"

Output size is currently limited to 4096x4096 due to the usage of H264 encoder. AV1 and H265 is likely unsupported when used with OvenMediaEngine WebRTC ingest.

Broadcast settings

Reference:

Open Settings > Stream:

OBS stream settings

Configure your audio / video and video encoding as followed:

OBS output settings

The following encoder are tested working on Arch Linux on Wayland with a NVIDIA RTX graphic card:

  • x264 (CPU)
  • NVIDIA NVENC H.264 (GPU)

CPU Encoding

Sample encoder settings

  • Video Encoder: x264
  • Encoder Settings:
    • Keyframe Interval: 1s
    • CPU Usage Preset: ultrafast
    • Profile: baseline / high
    • Tune: zerolatency

GPU Encoding

Sample encoder settings for NVIDIA graphic card

  • Video Encoder: NVIDIA NVENC H.264
  • Encoder Settings:
    • Keyframe Interval: 1s
    • Preset: P1: Fastest (Lowest Quality)
    • Tuning: Ultra Low Latency
    • Profile: baseline / high

Start Streaming

  1. Confirm / Apply the settings,
  2. "Start Streaming"

Additianal reading for OME:

OBS WebSocket Integration

WRDXR_OBS_WEBSOCKET=http://localhost:4455
WRDXR_OBS_WEBSOCKET_PASSWORD=check-your-obs-setting

Usage

Standalone Headset

⚠️ Note - Secure Context (HTTPS)

Usage of WebXR Device API outside of localhost requires a secure context.
If you are loading this onto a standalone headset such as Oculus Quest, you will to:

  • Option 1: provision SSL certs for the NodeJS frontend client and for the OvenMediaEngine
  • Option 2: provide a local DNS server that resolve your application IP address to a *.localhost URL.

The guide below shows usage example using option 1.

Option 1:

This project generate a self-signed TLS certificate when you run docker-compose up -d

The following ports are running in secure protocols:

Type URL
Frontend https://127.0.0.1:10081
OvenMediaEngine https://127.0.0.1:10083
OBS WebSocket https://127.0.0.1:10085

Assuming both client and server are on the same network:

  • server: 192.168.1.234 (This server)
  • client: 192.168.1.100 (Your VR standalone headset)

You can find out your server ip using ip a | grep "inet "

Your SSL endpoints should look like this:

  • Frontend - https://192.168.1.234:10081
  • OvenMediaEngine - wss://192.168.1.234:10083/app/stream

You may create a .env.local with the following content:

VITE_WRDXR_DEFAULT_FILE=wss://192.168.1.234:10083/app/stream

On your standalone headset, open a WebXR capable web browser and go to:
https://192.168.1.234:10081/?file=wss://192.168.1.234:10083/app/stream

Accept the warning about the SSL self-signed certificate

You should see your broadcasted source on the video player.

Click "Open VR" to enter VR mode.

usage-quest-browser.mp4

PC VR

Using a WebXR capable browser, browse to:

You should see your broadcasted source on the video player.

Click "Open VR" to enter VR mode.

Releases

No releases published

Packages

No packages published