Expand description
Virtual camera: the browser’s webcam, delivered to applications as a V4L2 capture device.
The client encodes its camera (H.264/VP8/… over the WebRTC media track or WebCodecs over the
WebSocket, MJPEG as the last-resort canvas path) and Selkies hands each encoded frame to
VirtualCamera::push, which returns at once. A worker thread decodes, fits the picture into the
device’s fixed raw format and publishes it to every sink at once:
- the shared-memory ring served over a Unix socket to the Selkies V4L2 interposer
(
LD_PRELOAD, no privileges, no kernel module), seeringandserver; - a v4l2loopback output device where one is configured or found, see
v4l2out— the kernel path for hosts and privileged containers, as/dev/uinputis for gamepads; - a PipeWire
Video/Sourcenode where a daemon is reachable, seepipewire— for PipeWire-native consumers and thepipewire-v4l2wrapper.
Nothing on the hot path holds the GIL beyond copying the encoded bytes out of the Python buffer, and no worker thread ever calls back into Python.
Modules§
- convert
- Normalization of decoded frames into the virtual device’s fixed format.
- decode
- Decoders for the client camera uplink.
- pipewire
- PipeWire sink: the camera as a
Video/Sourcenode. - ring
- Shared-memory frame ring consumed by the Selkies V4L2 interposer.
- server
- Control socket for the Selkies V4L2 interposer.
- v4l2out
- Kernel-device sink: writes frames into a v4l2loopback output device.
Structs§
- Virtual
Camera - A virtual camera fed with encoded frames from Python.
- Virtual
Camera Settings - Configuration for
VirtualCamera::start.