(no title)
quyse | 1 year ago
It works by running a game in Linux (I use NixOS btw) under Wayland (sway), capturing the frames via Pipewire in form of DMAbufs and passing them to ffmpeg's VA-API encoder (so frames don't leave GPU memory and are encoded on GPU right away), and finally sending encoded packets through WebRTC media stream to a web client. Inputs from a client are sent back to the server via WebRTC data channel and injected into Wayland.
Running the prototype over local network displays zero perceivable latency. (Of course when playing on a remote AWS server the latency is visible as expected). Pleased with the result so far, although it's my first experience with Pipewire, VA-API, and WebRTC, so my implementation is probably far from optimal.
Overall, very impressed by WebRTC - such a powerful thing right in every browser. Continued to be amazed by NixOS - my AWS AMI is NixOS-based and can be built and rebuilt with granular caching, with a single `nix build` command. Also Terraform/OpenTofu - just makes it all possible deploy-wise. So much good stuff exists!
not_a_dane|1 year ago
quyse|1 year ago
xyzsparetimexyz|1 year ago
quyse|1 year ago