starfold

Platforms

What starfold streams on Linux, macOS and Windows, what each needs and its own flags.

LinuxmacOSWindows
Streamsan X11 display (Xvfb included)this Mac's screenthe desktop of the session it runs in
CaptureMIT-SHM GetImage, or Xvfb's framebuffer in placeScreenCaptureKitDXGI Desktop Duplication
Default --addr0.0.0.0127.0.0.1127.0.0.1
Hardware encodersVA-API, NVENC (experimental)VideoToolboxNVENC, Media Foundation, Quick Sync (experimental)
Microphoneinto a FIFO a PulseAudio pipe source readsinto a loopback deviceinto a virtual audio cable
Unix socket, starfold attachyesnono
Prebuilt binariesx86_64, aarch64 (glibc 2.39+)Apple siliconx86_64

Linux

starfold streams an X11 display; Wayland is not supported yet. The release binaries are built on Ubuntu 24.04 and need glibc 2.39 or newer, libyuv, Opus and PulseAudio's client library:

sudo apt install libyuv0 libopus0 libpulse0
DISPLAY=:1 starfold

starfold captures with MIT-SHM GetImage into a shared-memory segment of its own, which the X server has to attach. It can't over TCP (DISPLAY=host:N; use DISPLAY=:N), from another IPC namespace, or as another user: starfold then stops at start and names these causes.

The repository's xvfb.nix builds a patched Xvfb for pixel-precise scroll input; stock Xvfb scrolls by wheel notches.

Reading Xvfb's framebuffer in place

With STARFOLD_DIRECT_FB=1 in its environment and Xvfb started with -shmem, starfold reads the screen in place from Xvfb's framebuffer instead of with GetImage. On one VM (4 vCPUs, a 1920x1080 full-screen animation at 60 fps) that saved about 1 ms per frame and about a tenth of a core. STARFOLD_NO_DIRECT_FB turns it off and wins. starfold reads a segment only if it can tie it to the X server it is connected to; otherwise it uses GetImage and logs why once.

Xvfb creates its -shmem segments with mode 0777: every local user can read that screen, whether starfold reads it or not. On a host with several users, don't start Xvfb with -shmem.

Linux-only flags: --microphone-fifo, --round-corners, --round-windows, --listen-unix and --listen-unix-mode. On Linux, --audio-device-name names a PulseAudio source (default output.monitor).

macOS

starfold streams the Mac's own screen with ScreenCaptureKit, takes input with CGEvent, and carries the clipboard and system audio. macOS asks starfold (or the terminal that starts it) for the Screen Recording and Accessibility permissions. An archive's binary is not notarized, so clear its download quarantine first:

xattr -d com.apple.quarantine starfold
./starfold --port=6901

For the microphone, install a loopback device (brew install blackhole-2ch) and pick it as the input in the apps that should hear you.

macOS flagDefault
--displaymain displayan index (0 is the main display) or a display ID; logged at startup
--capture-scalenative, within the budgetstreamed pixels per point
--max-capture-pixels4096000 (2560x1600)pixel budget for the automatic scale
--microphone-devicefirst loopback device foundoutput device (name or prefix) to play the browser microphone into
--resize-scalethe capture scaleso a viewer's window maps to the same number of points on the Mac
--show-cursoroff; on with --read-onlyinclude the host cursor in the video stream

--audio-device-name, --microphone-fifo and the rounded-corner flags don't apply.

Windows

starfold streams a Windows desktop (Windows 10 version 1703 or later) with DXGI Desktop Duplication, takes input with SendInput, and carries clipboard text and images and WASAPI system audio. It streams the desktop of the session it runs in, so start it in the user's session, not as a service; Windows hides the lock screen and UAC prompts from it unless it runs as SYSTEM.

For the microphone, install a virtual audio cable such as VB-CABLE: starfold plays into "CABLE Input" and apps record from "CABLE Output".

Windows flagDefault
--displayprimary displayby index (0 is the primary); logged at startup
--audio-device-namedefault output deviceoutput device (name or prefix) whose sound to stream
--microphone-devicefirst virtual cable foundoutput device (name or prefix) to play the browser microphone into
--resize-scalethe display's scalingso a viewer's window maps to the same size on the desktop

Dynamic resolution picks the largest display mode that fits the viewer's window, and Windows restores the original mode when starfold exits. The experimental Quick Sync encoder (--encoder qsv, 64-bit only) needs Windows 10 1607 / Server 2016 or later.

To build on Windows, use Rust, vcpkg, cmake, perl, nasm and esbuild:

vcpkg install libyuv opus --triplet x64-windows-static-md
$env:VCPKGRS_TRIPLET = 'x64-windows-static-md'
npm install -g esbuild
cargo build --release
.\target\release\starfold.exe --port=6901

On this page