使用 PipeWire 进行简单的应用程序间帧共享
A library to make creating PipeWire video streams easy, using zero-copy DMA-BUF frame sharing. "Spout2 / Syphon, but for Linux".
meson setup build
ninja -C buildThis is still rough around the edges and the API is not considered stable yet.
Features:
Note: Frame sharing between an Nvidia GPU using the proprietary GL driver and a non-Nvidia GPU requires special support code and extra blitting, which will probably not be implemented until much later. Using Vulkan can also have issues due to what look like driver/interop bugs. If you have an Nvidia GPU, please consider using NVK instead, since it implements all the missing features that Nvidia refuses to implement in their proprietary driver, and therefore doesn't require us application and library developers to add Nvidia-specific workaround code.
The library initially targets sending frames to other applications (output). This covers the common use case of apps sending video to OBS for streaming.
Receiving is not implemented yet, but is in scope. Before jumping into this, I'd like to hear from maintainers of applications that receive video via Spout2/Syphon. If you maintain such an app (with existing or planned Linux support), please file an issue and let me know!
Of course, that doesn't make the sending side useless. To receive video streams in OBS, you can use obs-pwvideo, which comes with its own PipeWire code (not using libfunnel itself).
It is also possible to hijack the input of any app using PipeWire screen sharing (such as Firefox, etc.) and redirect a libfunnel input stream into it, though this requires some hacky pw-cli shenanigans. If you have a use case for this, please let me know, as it should be possible to write a tool to do it mostly automatically.
Multiple streams are supported the "obvious" way, but the streams behave completely independently (no synchronization) in the current implementation. For applications that synchronously process video, such as filters (input => output), there are better ways to do it. If you maintain an app that expects to input and/or output multiple video streams with locked frame sync, please file an issue and let me know your needs! The underlying PipeWire API is extremely powerful and complicated, and I need some example use cases to decide what a simplified libfunnel API for this should look like.
TL;DR for EGL
…暂无开放 Issues,或尚未同步最近议题。