Skip to content
huonwePublic

About

Stream your device in your browser via WebRTC

Topics

Resources

Stars

80 stars

Watchers

0 watching

Forks

Repository files navigation

📺 Webscreen

A self-hosted screen streaming web application for Android and Linux devices, based on WebRTC.

GitHub release GitHub stars Go Version License: AGPL v3

简体中文 • 日本語


▶️ Watch Demo Video (Android) ▶️ Watch Demo Video (Orangepi5Plus HDMI-in)

screenshot

✨ Features

Webscreen can run on Android Termux, Linux, Windows, and MacOS (both amd64 and arm64). It might support more devices in the future!

📱 Android (via scrcpy)

  • Video, Audio, Control
  • UHID Devices (Mouse, Keyboard, Gamepad)
  • Clipboard Sync
  • Touch (Multi-finger, pressure)
  • H.264 / H.265 Hardware Encoding
  • Multi-Connection

🐧 Linux (Xvfb / Xorg / Sway)

  • Video, Control
  • Touch
  • H.264 / H.265
  • GPU support (Xorg/Sway)

🛹 rk3588-hdmirx (OrangePi 5 Plus tested)

  • HDMI-in video streaming
  • H.264 / H.265 with RKMPP hardware encoding
  • Note: Audio is not supported yet.

Note: For Android apk (rooted) and FnOS fpk, you might see youyoudezhuzhu/webscreen.


🛠️ Prerequisites

Client Side

You need a modern web browser that supports WebRTC (H.264 High Profile, or H.265 Main Profile).

Server / Device Side

For Android devices, please refer to the scrcpy prerequisites.

For Windows, Linux, MacOS, and Termux, you need adb (or android-tools in some distributions, which provides adb) in your PATH at least to stream Android devices. If the program didn't found adb, it will try to download it. Optionally, if you want to use Linux headless virtual desktop, make sure ffmpeg xvfb, xfce4, sway, and wf-recorder are in your PATH:

sudo apt install adb

# If you want to stream the Linux display:
sudo apt install xvfb ffmpeg xfce4 sway wf-recorder seatd

Note: If you want to use Xorg, you might need to run this program as root.

Note: If you want to use Sway, wf-recorder is used.

Note: All of them need uinput and seatd and correct permissions if you want to have keyboard and mouse passthrough.

rk3588 HDMI-in Requirements

  • A vendor kernel with HDMI RX support (rk3588-hdmirx enabled).
  • An FFmpeg build with RKMPP support (e.g., /usr/lib/jellyfin-ffmpeg/ffmpeg).
  • Correct read/write permissions for MPP service: sudo chmod 666 /dev/mpp_service.
  • System package v4l-utils.

🚀 Usage

Option 1: Use Pre-built Binary

Download the latest binary from the Releases page. The default port is 8079. A 6-digit PIN is also required (defaults to no password if omitted).

./webscreen -host 0.0.0.0 -port 8080 -pin 555555

Then open your browser and visit: http://<your-ip>:8080

Option 2: Build from Source

Normally, you can build simply by running make.

Termux Note: If building natively on Termux, you must run go build -ldflags "-checklinkname=0".

git clone https://github.com/huonwe/webscreen.git
cd webscreen
make

Option 3: Docker

services:
  webscreen:
    image: dukihiroi/webscreen:latest
    container_name: webscreen
    network_mode: host
    restart: unless-stopped
    volumes:
      - /dev/bus/usb:/dev/bus/usb
    privileged: true
    environment:
      - GIN_MODE=release
      - PORT=8081
      - PIN=123456

For the desktop embedded version,copy the sample env file first: cp .env.sample .env

services:
  webscreen-full:
    user: appuser
    image: dukihiroi/webscreen-full:latest
    container_name: webscreen-full
    network_mode: host
    restart: unless-stopped
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/input:/dev/input
      - /run/udev:/run/udev:ro
    devices:
      - /dev/uinput:/dev/uinput
      - /dev/dri:/dev/dri
    group_add:
      - ${UINPUT_GID}
    privileged: true
    environment:
      - GIN_MODE=release
      - PORT=8081
      - PIN=123456

💡 Tip: host network mode is highly recommended due to WebRTC UDP traffic and USB device connection stability.

Android Pairing

You might need to pair your Android device via Wireless Debugging first. "Pair device with pairing code" is supported. Once paired, click the Connect button in the web UI. Note: After starting the stream, if the screen is black, simply trigger a UI change (e.g., press the physical volume button) to force a frame update.


📖 Documentation


❓ FAQ

Q: Crash: MediaCodec 0x80001001 Exception on custom Android devices?

  • This is usually due to the H.264 High Profile (profile=8).
  • Fix: Set profile=1 in video_codec_options.

🤝 Acknowledgements

📄 License

This project is licensed under the GNU Affero General Public License v3.0.

Webscreen, streaming your device in Web browser.
Copyright (C) 2026  Hiroi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

About

Stream your device in your browser via WebRTC

Topics

Resources

Stars

80 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages