// the find
pion/mediadevices
Go implementation of the MediaDevices API.
pion/mediadevices is a Go port of the browser MediaDevices API, giving server-side Go code the same `GetUserMedia`/`GetDisplayMedia` surface you'd use in a browser. It wraps camera, microphone, and screen capture into a unified stream abstraction and plugs directly into pion/webrtc for server-side WebRTC pipelines. The target audience is Go developers building bots, recorders, livestream ingestors, or video conferencing backends without a browser in the loop.
The browser-API shape is a good design call — if you've written WebRTC code on the frontend, the constraint model and track abstraction feel immediately familiar. Static linking for openh264 and opus (pre-built `.a` files per platform) means most users never touch pkg-config for those codecs, which is where Go cgo projects usually fall apart on CI. The driver abstraction is clean enough that you can register your own hardware adapter without forking the library. Active maintenance from the broader pion org, with Renovate keeping dependencies current.
Heavy cgo dependency is unavoidable — almost every codec path requires system libraries (x264, vpx, opus, VAAPI), which makes cross-compilation painful and Docker images large. The `nomicrophone` build tag exists precisely because malgo (the microphone backend) regularly breaks cross-compilation, which tells you something about the experience. Screen capture on Linux requires X11 and has no Wayland support, so it silently fails on modern desktop setups. The benchmark numbers (720p/30fps on Raspberry Pi 3) are from 2020 and haven't been updated, making it hard to know current performance on anything more recent.