Piik can now let one invited Viewer control the Host's shared desktop or window, using the existing media route and explicit source-scoped consent. This phase also finishes Viewer playback settings, the combined interaction window, the shared control/theme/icon polish, and concrete forwarding-feedback recovery fixes. Remote input stays off by default, uses one controller and releases held input on revocation, retirement or loss. Existing 2.x sharing remains compatible; new capabilities are negotiated with supporting App/Site/relay peers. No virtual input driver, new media listener or route planner is added. Validation: full Web check (97 files / 1,677 tests), Windows Go/native checks; seven real Browser/App lifecycle scenarios covering P2P, SFU and fallback-to-direct continuity; existing cross-version and physical Windows routed-input evidence; native macOS/Linux packaging, Go race/security and container checks through the publishing pipeline. Physical macOS/Linux permissions, mobile devices, mixed DPI and commercial games retain their documented limits. README/wiki keep deployment under the optional self-hosted Server chapters. Refs #472, #477, #479, #480. Issue follow-up happens after publication; unmatched field reports remain open. ## Release notes ### 中文 这是一次功能更新:一起看屏幕时,可以把键鼠交给一位朋友操作,聊天和表情也整合进了同一个互动窗口。本次还整理了分享与播放设置,并修复部分连接恢复和中转画质停滞的问题。 #### 新功能与体验 - **可选键鼠远控**:房主可以让一位朋友操作当前分享的桌面或窗口,随时撤回授权;换源或停播后关闭远控。提供手机触控、缩放和小键盘。当前实机验证覆盖 Windows App。 - **观众播放设置**:新增完整显示、等比铺满、拉伸铺满,以及自动/仅 P2P/仅 SFU 线路选择;站点和房主的线路限制仍然生效。 - **互动窗口**:聊天、参与者和表情放在同一窗口;可以从聊天头像选择接收者,新增点赞、倒彩等表情。支持的浏览器可以独立置顶,继续查看聊天和互动。全屏保留弹幕开关。 - **分享与播放设置更清楚**:暂停与停止相邻,画面、声音、连接和远控各有对应入口。观众播控在移动鼠标时显现,远控时收进画面边缘的小抽屉;点击画面不再意外暂停。没有声音输入时播控给出明确反馈,恢复输入后保留观众的音量设置。 #### 修复 - **连接与播放修复**:修正部分中转路径的媒体时钟、往返时间与重复反馈统计,改善这些错误导致的画质恢复停滞;重新进入房间后,SFU 连接仍可继续尝试直连。同步底层握手恢复修复。 - **界面修复**:修复浮窗返回后遮挡全屏、无法操作,窄屏控件错位、菜单超出边界等问题。虚拟键盘长按不会选中文字,拖出、取消或失焦后释放按键。页面和选源面板统一中性底色;App 图标与 favicon 保留小电视轮廓,精修对比度与底板层次。 - **兼容性修复**:新表情按站点支持情况显示,避免旧站点拒收后断开连接。补齐旧浏览器的浮层支持;修正 macOS `.app` 对包外启动文件的依赖。macOS 的 Finder、权限和远控仍需实机验证。 #### 更新说明 沿用 2.x 兼容边界。使用远控需要更新房主 App 和所连接的站点;要获得完整的中转修复,请同时更新 App 与自部署 Server。 ### English This feature update lets a Host hand keyboard and mouse control to one friend while sharing a screen. Chat and reactions now share one interaction window. It also clarifies sharing and playback settings and fixes specific connection-recovery and server-forwarding quality stalls. #### Features and experience - **Optional keyboard and mouse control:** the Host can let one friend control the shared desktop or window and revoke access at any time. Changing sources or stopping sharing disables control. Touch controls, zoom and an on-screen keyboard are included. Physical validation currently covers the Windows App. - **Viewer playback settings:** choose fit, crop or stretch, and Auto, P2P-only or SFU-only routing. Site and Host restrictions still apply. - **One interaction window:** chat, participants and reactions stay together. Choose a recipient from their chat avatar and use new reactions, including thumbs up and down. Supported browsers can detach the window and keep chat and reactions visible on top. Fullscreen retains the chat-overlay toggle. - **Clearer sharing and playback controls:** pause and stop stay together, with separate picture, sound, connection and remote-control settings. Pointer movement reveals the playback bar during viewing; remote control uses a small drawer at the picture edge. Clicking the picture no longer pauses it accidentally. Sound controls reflect missing input and retain the Viewer's volume when it returns. #### Fixes - **Connection and playback fixes:** correct media clocks, round-trip-time updates and duplicate feedback accounting on affected forwarding paths, improving recovery from the quality stalls caused by those errors. Rejoining a room restores direct-connection attempts while SFU playback continues. Incorporate upstream handshake-recovery fixes. - **Interface fixes:** returning a detached tool during fullscreen no longer leaves an inaccessible panel over the picture. Fix compact-layout shifts and overflowing menus. Holding a virtual key no longer selects its label; release, cancellation and focus loss clear held keys. Pages and the source picker use shared neutral surfaces. Refine App icons and favicons while retaining the familiar television outline. - **Compatibility fixes:** show new reactions only when the site supports them, preventing disconnects on older sites. Support popovers on older browsers and remove the macOS `.app` launcher's dependency on files outside the bundle. Finder, permissions and remote input still need physical macOS validation. #### Updating The existing 2.x compatibility boundary is retained. Remote control needs an updated Host App and site; update both App and self-hosted Server for the complete forwarding fix.
162 lines
8.2 KiB
Markdown
162 lines
8.2 KiB
Markdown
# Native Sender And Shared-Encode Evidence
|
|
|
|
- Reviewed: 2026-08-27
|
|
- Scope: Windows capture, one hardware H.264 encoder, bounded WebRTC fanout
|
|
- Status: historical evidence; obsolete sender implementation deleted
|
|
|
|
Current product scope is owned by [media quality](../standards/media-quality.md).
|
|
[ADR-0006](../adr/0006-fixed-high-native-sender-canary.md) owns the stop line.
|
|
|
|
## Conclusion
|
|
|
|
A native sender can plausibly capture and encode once while serving bounded
|
|
independent WebRTC transports. Shared encoding can reduce capture/encode work;
|
|
it cannot remove each child's RTP, congestion, retransmission, encryption, and
|
|
network copy.
|
|
|
|
The retained measurements prove:
|
|
|
|
- Pion can fan one encoded source into two independent transport bindings;
|
|
- one WebCodecs encoder object fed two Browser sessions in a bounded fixture;
|
|
- one Windows Graphics Capture/Media Foundation H.264 path used an adapter-
|
|
bound hardware MFT with matching process/LUID `VideoEncode` activity; and
|
|
- the product helper delivered H.264 video and process-tree audio to one Chrome
|
|
Viewer.
|
|
|
|
It does not prove two-Viewer product fanout, heterogeneous congestion feedback,
|
|
loss/retransmission correctness, audio synchronization, reconnect isolation,
|
|
public networks, endurance, packaging, update/signing, cross-platform behavior,
|
|
or distribution licensing. Native remains outside the current release.
|
|
|
|
## Candidate Shape
|
|
|
|
The smallest measured Windows pipeline was:
|
|
|
|
```text
|
|
opaque window target
|
|
-> Windows Graphics Capture BGRA surface
|
|
-> one D3D11 conversion to NV12
|
|
-> one adapter-bound hardware Media Foundation H.264 encoder
|
|
-> one generation-bound Go/Pion RTP source
|
|
-> at most two independent PeerConnections
|
|
```
|
|
|
|
Each PeerConnection must keep independent ICE, DTLS-SRTP, SSRC/sequence/TWCC,
|
|
pacing, RTCP, congestion, and retransmission state. PLI/FIR from any child may be
|
|
coalesced into one shared SPS/PPS/IDR request, but a weak child's bitrate request
|
|
cannot silently become a room-wide minimum policy. A third Viewer must wait
|
|
under the same endpoint capacity as Web Hosts.
|
|
|
|
Local target identity, HWND/PID, process creation time, adapter/MFT identity,
|
|
PCM, and hardware diagnostics never enter signaling. The helper revalidates the
|
|
selected window/process before capture. There is no software, codec, monitor, or
|
|
audio fallback hidden behind a hardware-only source choice.
|
|
|
|
## Browser And Pion Fixtures
|
|
|
|
A stack of bounded fixtures established progressively narrower facts:
|
|
|
|
| Gate | Retained result | Missing proof |
|
|
| --- | --- | --- |
|
|
| One Pion RTP source, two bindings | Equivalent payload reached two transport-local SSRCs. | No encoder or Browser. |
|
|
| WebCodecs VP8, two Chrome receivers | One encoder object produced 120 outputs; both decoded. | Physical/hardware encoder identity. |
|
|
| 12-second live bridge | 360 inputs/outputs; both Viewers rendered 331 frames; queues remained bounded. | Product rooms/capture/audio. |
|
|
| Pion GCC plus negotiated RTX | Failed with unknown RTX SSRC. | Valid shared congestion/retransmission composition. |
|
|
| No-RTX replay | One leg recovered without disturbing the other. | Accurate retransmission-specific loss accounting. |
|
|
| Two-leg stock GCC | Both estimates happened to be 600 kbps; one shared reconfiguration and keyframe recovery succeeded. | Heterogeneous estimates and product policy. |
|
|
|
|
The stock-GCC/RTX composition remains no-go. Do not replace it with a custom
|
|
pacer, congestion controller, interceptor fork, SRTP, or private transport.
|
|
No-RTX replay remains research-only because it can distort RTP/RTCP loss
|
|
accounting.
|
|
|
|
## Hardware Encoder Evidence
|
|
|
|
### WebCodecs
|
|
|
|
Chrome accepted H.264 Annex-B 1280x720@30 with `prefer-hardware` and produced
|
|
360/360 frames, but Browser-process GPU samples showed no attributed
|
|
`VideoEncode` activity. The emitted SPS was `42041f`, not the requested codec
|
|
string. This proves usable chunks and in-band recovery units, not hardware
|
|
selection or exact WebRTC fmtp compatibility. VP8 `prefer-hardware` was rejected
|
|
on the same Windows system.
|
|
|
|
### Media Foundation Fixture
|
|
|
|
One MSVC/D3D11 fixture selected the NVIDIA H.264 Encoder MFT on an RTX 4070
|
|
SUPER by exact DXGI LUID, required hardware enumeration, D3D11 awareness,
|
|
low-latency mode, CBR readback, 3 Mbps, a 60-frame GOP, and forced keyframes.
|
|
|
|
| Measure | Retained result |
|
|
| --- | --- |
|
|
| Inputs / outputs | 360 / 360 |
|
|
| Recovery units | 6 / 6 with Annex-B SPS, PPS, and IDR |
|
|
| Maximum in flight | 1 |
|
|
| Wall time | 12.106 s |
|
|
| Input-to-output p95 | 11.575 ms |
|
|
| Process+adapter VideoEncode | 45 samples; mean 2.949%, max 4.863% |
|
|
| Emitted profile | `42c01f` |
|
|
|
|
The MFT was physically attributed by hardware-only activation, accepted device
|
|
manager, exact process/LUID GPU engine, and output progress. Its `42c01f`
|
|
Constrained Baseline profile was absent from Pion's default exact mode-1 list,
|
|
so the fixture correctly stopped before claiming transport interoperability.
|
|
The later opt-in fixture registered that exact profile and proved one Browser
|
|
loopback; it did not alter the wider stop line.
|
|
|
|
### Product Helper Smoke
|
|
|
|
The Windows helper reuses the same encoder source with WGC capture and
|
|
process-tree WASAPI loopback. One bounded run delivered 203 rendered 1280x720
|
|
frames and 500 Opus packets to a Chrome Viewer. The exact helper PID and adapter
|
|
LUID matched nonzero `VideoEncode`. This is a one-Viewer functional proof, not a
|
|
resource or product release claim.
|
|
|
|
## Remaining Gates
|
|
|
|
Before native product consideration, one current-wire candidate must prove:
|
|
|
|
1. current room/Host authorization and source-generation cleanup;
|
|
2. exact emitted H.264 profile negotiation and unmodified Chrome, Edge, Firefox,
|
|
and Safari decode/render;
|
|
3. two independent transports with one physical encoder and compatible source,
|
|
codec, cadence, and rate requests;
|
|
4. correct PLI/FIR, NACK/RTX, TWCC, burst/sustained loss, and reconnect isolation;
|
|
5. process audio, A/V synchronization, source switch, pause, and failure;
|
|
6. bounded CPU/GPU, memory, latency, quality, upload, queues, and thermals under
|
|
real games and public networks;
|
|
7. evaluation packaging followed by installer, signing, update, and recovery;
|
|
and
|
|
8. project, dependency, H.264 patent, and distribution license decisions.
|
|
|
|
No native experiment may preserve an obsolete Piik wire, create another
|
|
room/topology model, loosen endpoint capacity, or become production merely to
|
|
make a diagnostic gate pass.
|
|
|
|
## License Boundary
|
|
|
|
Pion is MIT and coder/websocket is ISC. The Windows APIs use installed hardware
|
|
MFTs; vendor codec binaries are not redistributed. Direct NVENC would require a
|
|
separate NVIDIA Video Codec SDK and redistribution review. H.264 patent and
|
|
project licensing remain unresolved before executable distribution. No
|
|
proprietary or GPL/AGPL implementation code was copied.
|
|
|
|
## Primary Sources
|
|
|
|
- [Windows Graphics Capture](https://learn.microsoft.com/en-us/windows/apps/develop/media-authoring-processing/screen-capture)
|
|
- [Microsoft hardware MFTs](https://learn.microsoft.com/en-us/windows/win32/medfound/hardware-mfts)
|
|
- [Microsoft H.264 encoder](https://learn.microsoft.com/en-us/windows/win32/medfound/h-264-video-encoder)
|
|
- [Microsoft `MFTEnum2`](https://learn.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mftenum2)
|
|
- [Microsoft low-latency mode](https://learn.microsoft.com/en-us/windows/win32/medfound/codecapi-avlowlatencymode)
|
|
- [Microsoft force keyframe](https://learn.microsoft.com/en-us/windows/win32/medfound/codecapi-avencvideoforcekeyframe)
|
|
- [WebCodecs](https://www.w3.org/TR/webcodecs/)
|
|
- [WebRTC codec requirements, RFC 7742](https://www.rfc-editor.org/rfc/rfc7742.html)
|
|
- [H.264 RTP payload, RFC 6184](https://www.rfc-editor.org/rfc/rfc6184.html)
|
|
- [WebRTC congestion control, RFC 8836](https://www.rfc-editor.org/rfc/rfc8836.html)
|
|
- [RTP feedback, RFC 4585](https://www.rfc-editor.org/rfc/rfc4585.html)
|
|
- [RTP retransmission, RFC 4588](https://www.rfc-editor.org/rfc/rfc4588.html)
|
|
- [Pion static track fanout](https://github.com/pion/webrtc/blob/v4.2.18/track_local_static.go)
|
|
- [Pion H.264 payloader](https://github.com/pion/rtp/blob/v1.10.5/codecs/h264_packet.go)
|
|
- [libwebrtc `VideoEncoderFactory`](https://webrtc.googlesource.com/src/+/refs/heads/main/api/video_codecs/video_encoder_factory.h)
|
|
- [NVIDIA NVENC guide](https://docs.nvidia.com/video-technologies/video-codec-sdk/13.0/nvenc-video-encoder-api-prog-guide/index.html)
|