Skip to content

Commit

Permalink
Improve format
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored Jul 9, 2024
1 parent 4fc716b commit d7a647f
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

**Moonlight, Google Stadia, or GeForce NOW in noVNC form factor for Linux X11, in any HTML5 web interface you wish to embed inside, with at least 60 frames per second on Full HD resolution.**

**We are in need of maintainers and community contributors. Please consider stepping up, as we can never have too much help!**

Selkies-GStreamer is an open-source low-latency high-performance Linux-native GPU/CPU-accelerated WebRTC HTML5 remote desktop streaming platform, for self-hosting, containers, Kubernetes, or Cloud/HPC platforms, [started out first by Google engineers](https://web.archive.org/web/20210310083658/https://cloud.google.com/solutions/gpu-accelerated-streaming-using-webrtc), then expanded by academic researchers.

Selkies-GStreamer is designed for researchers including people in the graphical AI/robotics/autonomous driving/drug discovery field, SLURM supercomputer/HPC system administrators, Jupyter/Kubernetes/Docker®/Coder infrastructure administrators, and Linux cloud gaming enthusiasts.
Expand All @@ -16,7 +18,7 @@ While designed for clustered or unprivileged containerized environments, Selkies

## Citations in Academic Publications

**NOTE that this section is also applicable for developers applying, embedding, forking, deriving, or taking influence from this project.**
> **NOTE: This section is also applicable for developers applying, embedding, forking, deriving, or taking influence from this project.**
**Citations are the currency of scientific research. Citing in your publications is the main driver of keeping this project alive.**

Expand Down
10 changes: 6 additions & 4 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You may create a self-hosted version of your favorite cloud gaming platform, run

There are several strengths of Selkies-GStreamer compared to other game streaming or remote desktop platforms.

First, Selkies-GStreamer is much more flexible to be used across various types of environments compared to other services or projects.
**First, Selkies-GStreamer is much more flexible to be used across various types of environments compared to other services or projects.**

Its focus on a single web interface instead of multiple native client implementations allow any operating system with a recent web browser to work as a client.

Expand All @@ -36,19 +36,21 @@ Compared to many remote desktop or game streaming applications requiring multipl

A dedicated TURN server for actual traffic relaying can be flexibly configured within any location at or between the server and the client.

Second, Selkies-GStreamer can utilize H.264 hardware acceleration of GPUs, as well as falling back to software acceleration with the H.264, H.265, VP8, VP9, and AV1 codecs. Audio streaming from the server is supported using the Opus codec. Check the [GStreamer Components](component.md#gstreamer-components) section for current codec and interface support.
**Second, Selkies-GStreamer can utilize H.264 hardware acceleration of GPUs, as well as falling back to software acceleration with the H.264, H.265, VP8, VP9, and AV1 codecs.**

Audio streaming from the server is supported using the Opus codec. Check the [GStreamer Components](component.md#gstreamer-components) section for current codec and interface support.

WebRTC ensures minimum latency from the server to the HTML5 web client interface. Any other video encoder, video converter, screen capturing interface, or protocol may be contributed from the community easily. NVIDIA GPUs are currently fully supported with NVENC, and Intel and AMD GPUs supported with VA-API, with progress on supporting other GPU hardware.

Third, Selkies-GStreamer was designed not only for desktops and bare metal servers, but also for unprivileged Docker® and Kubernetes containers.
**Third, Selkies-GStreamer was designed not only for desktops and bare metal servers, but also for unprivileged Docker® and Kubernetes containers.**

Unlike other similar Linux solutions, there are no dependencies that require access to special devices not available inside containers by default, and is also not dependent on `systemd`.

This enables virtual desktop infrastructure (VDI) using containers instead of virtual machines (VMs) which tend to have high overhead.

Root permissions are also not required at all, and all components can be installed completely to the userspace in a portable way.

Fourth, Selkies-GStreamer is easy to use and expand to various usage cases, attracting users and developers from diverse backgrounds, as it uses [GStreamer](https://gstreamer.freedesktop.org).
**Fourth, Selkies-GStreamer is easy to use and expand to various usage cases, attracting users and developers from diverse backgrounds, as it uses [GStreamer](https://gstreamer.freedesktop.org).**

GStreamer allows pluggable components to be mixed and matched like LEGO blocks to form arbitrary pipelines, providing an easier interface with more comprehensive documentation compared to [FFmpeg](https://ffmpeg.org).

Expand Down
2 changes: 2 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Development and Contributions

**We are in need of maintainers and community contributors. Please consider stepping up, as we can never have too much help!**

This project was meant to be built upon community contributions from people without any prior media networking experience.

[GStreamer](https://gstreamer.freedesktop.org) is much easier to develop without prior experience on multimedia application development, and this project is a perfect starting point for anyone who wants to get started.
Expand Down
6 changes: 3 additions & 3 deletions docs/firewall.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ The Selkies-GStreamer [coTURN](component.md#coturn) image [`ghcr.io/selkies-proj

It is possible to install [coTURN](https://github.com/coturn/coturn) on your own server or PC from a package repository, as long as the listening port and the relay ports may be opened.

1. Installation for Ubuntu or Debian-based distributions (available in EPEL for CentOS/RHEL):
**1. Installation for Ubuntu or Debian-based distributions (available in EPEL for CentOS/RHEL):**

```bash
sudo apt-get update && sudo apt-get install --no-install-recommends -y coturn
```

2. For self-hosted standalone coTURN servers, a minimal barebones configuration for `/etc/turnserver.conf` is available below, where options are also all available as command-line options (check the [coTURN Example Configuration](https://github.com/coturn/coturn/blob/master/examples/etc/turnserver.conf) for more information):
**2. For self-hosted standalone coTURN servers, a minimal barebones configuration for `/etc/turnserver.conf` is available below**, where options are also all available as command-line options (check the [coTURN Example Configuration](https://github.com/coturn/coturn/blob/master/examples/etc/turnserver.conf) for more information)**:**

```conf
listening-ip=0.0.0.0
Expand Down Expand Up @@ -147,7 +147,7 @@ It is strongly recommended to set the `min-port=` and `max-port=` parameters whi

The `cert=` and `pkey=` options are required for using TURN over TLS/DTLS, but are otherwise optional. They should lead to the certificate and the private key from a legitimate certificate authority such as [ZeroSSL](https://zerossl.com/features/acme/) or [Let's Encrypt](https://letsencrypt.org/getting-started/) with a valid hostname which resolves to the TURN server.

3. Enable the coTURN service:
**3. Enable the coTURN service:**

Modify the file `/etc/default/coturn`:

Expand Down
40 changes: 18 additions & 22 deletions docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ This **Quick Start** uses a portable tarball distribution with most (but not all

Read [Conda Toolchain](component.md#conda-toolchain) for more details of this step and procedures for installing from the latest commit in the `main` branch.

1. Install required dependencies, for Ubuntu or Debian-based distributions run this command:
**1. Install required dependencies, for Ubuntu or Debian-based distributions, run this command:**

```bash
sudo apt-get update && sudo apt-get install --no-install-recommends -y jq tar gzip ca-certificates curl libpulse0 libegl1 libgl1 libopengl0 libgles1 libgles2 libglvnd0 libglx0 wayland-protocols libwayland-dev libwayland-egl1 x11-utils x11-xkb-utils x11-xserver-utils xserver-xorg-core libx11-xcb1 libxcb-dri3-0 libxkbcommon0 libxdamage1 libxfixes3 libxv1 libxtst6 libxext6 xvfb
```

In the future, this host dependency requirement may be completely eliminated if relevant [conda-forge](https://conda-forge.org) feedstocks are available.

2. Download and unpack the latest stable release of the Selkies-GStreamer portable distribution inside a directory of your choice:
**2. Download and unpack the latest stable release of the Selkies-GStreamer portable distribution inside a directory of your choice:**

```bash
export SELKIES_VERSION="$(curl -fsSL "https://api.github.com/repos/selkies-project/selkies-gstreamer/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')"
cd ~ && curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies-gstreamer-portable-v${SELKIES_VERSION}_amd64.tar.gz" | tar -xzf -
```

3. Set your `DISPLAY` and `PULSE_SERVER` environment variables for the X.Org X11 display server or PulseAudio audio server.
**3. Set your `DISPLAY` and `PULSE_SERVER` environment variables for the X.Org X11 display server or PulseAudio audio server.**

**Check that you are using X.Org instead of Wayland (which is the default in many distributions but not supported) when using an existing display. You also need to be logged in from the login screen or autologin should be enabled.**

Expand All @@ -40,7 +40,7 @@ export PULSE_RUNTIME_PATH="${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}
export PULSE_SERVER="${PULSE_SERVER:-unix:${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}/native}"
```

4. Run Selkies-GStreamer (change `--encoder=` to another value such as `nvh264enc`, `vah264enc`, `vp9enc`, or `vp8enc`, if you want to [use different codecs or GPU acceleration](component.md#encoders)):
**4. Run Selkies-GStreamer** (change `--encoder=` to another value such as `nvh264enc`, `vah264enc`, `vp9enc`, or `vp8enc`, if you want to [use different codecs or GPU acceleration](component.md#encoders))**:**

```bash
./selkies-gstreamer/selkies-gstreamer-run --addr=0.0.0.0 --port=8080 --enable_https=false --https_cert=/etc/ssl/certs/ssl-cert-snakeoil.pem --https_key=/etc/ssl/private/ssl-cert-snakeoil.key --basic_auth_user=user --basic_auth_password=mypasswd --encoder=x264enc --enable_resize=false
Expand All @@ -50,25 +50,23 @@ The default username (set with `--basic_auth_user=` or `SELKIES_BASIC_AUTH_USER`

Use `--enable_resize=true` if you want to fit the remove resolution to the client window and skip the next section. You **must NOT** enable this option when streaming a physical monitor.

5. Resize to your intended resolution (**DO NOT resize when streaming a physical monitor**):
**5. Resize to your intended resolution (DO NOT resize when streaming a physical monitor):**

```bash
./selkies-gstreamer/selkies-gstreamer-resize-run 1920x1080
```

6. Check the [Joystick Interposer](component.md#joystick-interposer) section if you need to use joystick/gamepad devices from your web browser client.
**6. Check the [**Joystick Interposer**](component.md#joystick-interposer) section if you need to use joystick/gamepad devices from your web browser client.**

You can replace `/usr/$LIB/selkies_joystick_interposer.so` with any non-root path of your choice if using the `.tar.gz` tarball.

7. **(MANDATORY) If the HTML5 web interface loads and the signaling connection works, but the WebRTC connection fails or the remote desktop does not start**:
**7. (MANDATORY) If the HTML5 web interface loads and the signaling connection works, but the WebRTC connection fails or the remote desktop does not start:**

Depending on your environment, **this step may be mandatory**.

**Moreover, when there is a very high latency or stutter, and the TURN server is shown as `staticauth.openrelay.metered.ca` with a `relay` connection, this section is very important.**
**Depending on your environment, this step may be mandatory. Moreover, when there is a very high latency or stutter, and the TURN server is shown as `staticauth.openrelay.metered.ca` with a `relay` connection, this section is very important.**

Please read [**WebRTC and Firewall Issues**](firewall.md).

8. Check [**Troubleshooting and FAQs**](usage.md#troubleshooting-and-faqs) if something is not as intended and [**Usage**](usage.md#usage) for more information on customizing.
**8. Read [**Troubleshooting and FAQs**](usage.md#troubleshooting-and-faqs) if something is not as intended and [**Usage**](usage.md#usage) for more information on customizing.**

## Desktop Container

Expand Down Expand Up @@ -114,7 +112,7 @@ Example Google Compute Engine/Google Kubernetes Engine deployment configurations

While this instruction assumes that you are installing this project systemwide, it is possible to install and run all components completely within the userspace. Dependencies may also be installed without root permissions if you use the [**Quick Start**](#quick-start) procedures.

1. Install the dependencies, for Ubuntu or Debian-based distributions run this command:
**1. Install the dependencies, for Ubuntu or Debian-based distributions, run this command:**

```bash
sudo apt-get update && sudo apt-get install --no-install-recommends -y jq tar gzip ca-certificates curl build-essential python3-pip python3-dev python3-gi python3-setuptools python3-wheel libaa1 bzip2 libgcrypt20 libcairo-gobject2 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libsoup2.4-1 libsoup-gnome2.4-1 libgirepository-1.0-1 glib-networking libglib2.0-0 libjson-glib-1.0-0 libgudev-1.0-0 alsa-utils jackd2 libjack-jackd2-0 libpulse0 libogg0 libopus0 libvorbis-dev libjpeg-turbo8 libopenjp2-7 libvpx-dev libwebp-dev x264 x265 libdrm2 libegl1 libgl1 libopengl0 libgles1 libgles2 libglvnd0 libglx0 wayland-protocols libwayland-dev libwayland-egl1 wmctrl xsel xdotool x11-utils x11-xkb-utils x11-xserver-utils xserver-xorg-core libx11-xcb1 libxcb-dri3-0 libxkbcommon0 libxdamage1 libxfixes3 libxv1 libxtst6 libxext6
Expand All @@ -138,7 +136,7 @@ export DISTRIB_RELEASE="$(grep VERSION_ID= /etc/os-release | cut -d= -f2 | tr -d
export ARCH="$(dpkg --print-architecture)"
```

2. Unpack the GStreamer components of Selkies-GStreamer (fill in `SELKIES_VERSION`, `DISTRIB_RELEASE`), using your own GStreamer build on any architecture can work **as long as it is the most recent stable version with the required plugins included**:
**2. Unpack the GStreamer components of Selkies-GStreamer** (fill in `SELKIES_VERSION`, `DISTRIB_RELEASE`), using your own GStreamer build on any architecture can work **as long as it is the most recent stable version with the required plugins included:**

Read [GStreamer](component.md#gstreamer) for more details of this step and procedures for installing from the latest commit in the `main` branch.

Expand All @@ -148,15 +146,15 @@ cd /opt && curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/rele

This will install the GStreamer components to the default directory of `/opt/gstreamer`. If you are unpacking to a different directory, make sure to set the the environment variable `GSTREAMER_PATH` to the directory. GStreamer builds for `aarch64` are not provided but can be built following procedures in the [GStreamer Dockerfile](/addons/gstreamer/Dockerfile) or [Conda Dockerfile](/addons/conda/Dockerfile).

3. Install the Python components of Selkies-GStreamer (this component is pure Python and any operating system is compatible, fill in `SELKIES_VERSION`):
**3. Install the Selkies-GStreamer Python components** (this component is pure Python and any operating system is compatible, fill in `SELKIES_VERSION`)**:**

Read [Python Application](component.md#python-application) for more details of this step and procedures for installing from the latest commit in the `main` branch.

```bash
cd /tmp && curl -O -fsSL "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl" && sudo PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install --no-cache-dir --force-reinstall "selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl" && rm -f "selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl"
```

4. Unpack the HTML5 components of Selkies-GStreamer:
**4. Unpack the Selkies-GStreamer HTML5 components:**

Read [Web Application](component.md#web-application) for more details of this step and procedures for installing from the latest commit in the `main` branch.

Expand All @@ -166,7 +164,7 @@ cd /opt && curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/rele

This will install the HTML5 components to the default directory of `/opt/gst-web`. If you are unpacking to a different directory, make sure to set the directory to the environment variable `SELKIES_WEB_ROOT` or add the command-line option `--web_root=` to Selkies-GStreamer. Note that you should change `manifest.json` and `cacheName` in `sw.js` to rebrand the web interface to a different name.

5. Install the Joystick Interposer to process gamepad input if you need to use joystick/gamepad devices from your web browser client (fill in `SELKIES_VERSION`, `DISTRIB_RELEASE`, and `ARCH` of either `amd64` for `x86_64`, and `arm64` for `aarch64`):
**5. Install the Joystick Interposer to process gamepad input**, if you need to use joystick/gamepad devices from your web browser client (fill in `SELKIES_VERSION`, `DISTRIB_RELEASE`, and `ARCH` of either `amd64` for `x86_64`, and `arm64` for `aarch64`)**:**

Read [Joystick Interposer](component.md#joystick-interposer) for more details of this step and procedures for installing from the latest commit in the `main` branch.

Expand All @@ -178,7 +176,7 @@ Alternatively, users may directly place the Joystick Interposer libraries from t

You can replace `/usr/$LIB/selkies_joystick_interposer.so` with any non-root path of your choice if using the `.tar.gz` tarball.

6. Run Selkies-GStreamer after changing the script below appropriately (install `xvfb` and uncomment relevant sections if there is no real display, **DO NOT resize when streaming a physical monitor**):
**6. Run Selkies-GStreamer after changing the below script appropriately** (install `xvfb` and uncomment relevant sections if there is no real display, **DO NOT resize when streaming a physical monitor**)**:**

**Check that you are using X.Org instead of Wayland (which is the default in many distributions but not supported) when using an existing display. You also need to be logged in from the login screen or autologin should be enabled.**

Expand Down Expand Up @@ -237,15 +235,13 @@ selkies-gstreamer --addr=0.0.0.0 --port=8080 --enable_https=false --https_cert=/

The default username (set with `--basic_auth_user=` or `SELKIES_BASIC_AUTH_USER`), when not specified, is the current user environment variable `$USER` (empty username if nonexistent), and the default password (set with `--basic_auth_password=` or `SELKIES_BASIC_AUTH_PASSWORD`), when not specified, is `mypasswd`.

7. **(MANDATORY) If the HTML5 web interface loads and the signaling connection works, but the WebRTC connection fails or the remote desktop does not start**:

Depending on your environment, **this step may be mandatory**.
**7. (MANDATORY) If the HTML5 web interface loads and the signaling connection works, but the WebRTC connection fails or the remote desktop does not start:**

**Moreover, when there is a very high latency or stutter, and the TURN server is shown as `staticauth.openrelay.metered.ca` with a `relay` connection, this section is very important.**
**Depending on your environment, this step may be mandatory. Moreover, when there is a very high latency or stutter, and the TURN server is shown as `staticauth.openrelay.metered.ca` with a `relay` connection, this section is very important.**

Please read [**WebRTC and Firewall Issues**](firewall.md).

8. Check [**Troubleshooting and FAQs**](usage.md#troubleshooting-and-faqs) if something is not as intended and [**Usage**](usage.md#usage) for more information on customizing.
**8. Read [**Troubleshooting and FAQs**](usage.md#troubleshooting-and-faqs) if something is not as intended and [**Usage**](usage.md#usage) for more information on customizing.**

### Install the latest build on self-hosted standalone machines, cloud instances, or virtual machines

Expand Down
Loading

0 comments on commit d7a647f

Please sign in to comment.