AAA 383f3656c7 fix(media): stabilize sharing startup and recovery
## Problem and outcome / 问题与结果

Sharing could fail when an optional output or encoder comparison failed, while retired Browser work could block media cleanup. Browser pooling also spent its startup protection before publication and classified its synthetic transport clock as realtime video, delaying recovery after a bandwidth drop. These repairs stay within the existing capture, producer, edge and connection owners.

Self-hosting samples now follow the configured public Origin and permit the site's requested camera/microphone capture. Piik's own Origin rejection has a specific bilingual explanation, distinct from arbitrary proxy 403 responses.

## Release notes

### 中文

这是一次分享稳定性维护更新,重点修复开播、换源与画质恢复,并改善自部署站点的配置和错误说明。

- Windows 自动选择编码器时,如果已验证 H.264 可用,后续软件编码对比失败或超时会保留可用的 H.264,避免因此无法开播。
- 较低画质输出或单条音频发送连接失败时,保留仍然健康的分享和其他连接。
- 修复停止分享、换源和媒体连接退役时,旧异步任务阻塞清理与恢复的问题。
- 改善浏览器共享编码的首播画质与网络波动后的恢复,避免因短时码率变化反复重建编码器。
- 自部署配置示例默认跟随站点网址;创建房间因网址未获允许而返回 403 时,页面会指出需要检查的配置。nginx 示例也修正了对本站摄像头、麦克风的权限限制。

已有自部署站点若遇到 403,请检查 `PUBLIC_BASE_URL` 与 `ALLOWED_ORIGINS`。使用旧 nginx 示例的站点需更新 `Permissions-Policy`;步骤见[自部署教程](https://piik.tv/docs/zh/self-hosting)。本次更新不改变房间、信令或 App 控制协议。

### English

This maintenance update improves sharing startup, source changes and video-quality recovery, with clearer configuration and error guidance for self-hosted sites.

- Windows automatic codec selection retains a verified H.264 encoder if the subsequent software comparison fails or times out, instead of failing to start sharing.
- A failed lower-quality output or individual audio sender no longer interrupts healthy sharing and other connections.
- Fixes retired asynchronous work blocking cleanup and recovery when stopping sharing, changing sources or retiring media connections.
- Improves initial quality and recovery after network fluctuations in Browser pooled encoding, while avoiding unnecessary encoder recreation after short bitrate changes.
- The self-hosting sample follows the configured site address by default. Piik's Origin-related room-creation 403 now identifies the settings to check. The nginx sample also permits camera and microphone requests from the site itself.

If an existing self-hosted site returns 403, check `PUBLIC_BASE_URL` and `ALLOWED_ORIGINS`. Sites using the old nginx sample must update `Permissions-Policy`; see the [self-hosting guide](https://piik.tv/docs/self-hosting). Room, signaling and App control protocols are unchanged.

## Verification / 验证

- `npm run check`: 75 files / 1,106 tests, TypeScript and production Web build passed.
- `npm run check:go`: Go formatting, tests, vet, supported core builds, Windows native compile and regressions passed. Darwin cgo packaging remains owned by its macOS CI runner.
- Repository hygiene, documentation checks and website/documentation build passed.
- Isolated VP8/H.264 Browser checks: constrained-child isolation and recovery, short congestion pulse, live and quiet settings, pause/resume, source replacement and ordinary fallback passed. Controlled bandwidth can still cause temporary low resolution, stalls and A/V jitter.
- Windows native Auto/H.264/VP8 startup, window resize/fullscreen/minimize/restore, Browser-to-App fanout and embedded-SFU checks passed in the bounded local fixtures.
- Old-code negative controls reproduce the repaired failure paths. A real Chromium policy check rejects camera/microphone with the previous nginx header and captures both fake devices with the corrected same-origin policy; geolocation remains denied.
- Independent read-only review covered root ownership, cancellation and the producer/carrier adaptation boundary.

## Impact / 影响

Compatible patch release, planned as v1.6.4. No wire, storage, routing-authority or interaction-model change. Matching Server restart interrupts current process-owned media; package cutover retains the existing bounded rollback procedure. Unknown field reports still require device/network evidence and are not claimed resolved by local fixtures. Raw diagnostics and experiment artifacts remain ignored; accepted constraints and concise evidence live in their existing documentation owners.
2026-09-25 14:42:59 +08:00

Piik mascot

Piik

Share the good stuff.
Private screen sharing for you and up to 20 friends.

Website · Download · Gitee mirror · Use online · Documentation

License: MIT Up to 20 viewers P2P-first media

English · 简体中文

Piik is a free, open-source screen sharing tool for games, movie nights, drawings and photos. Choose what to share and send an invitation. Your friends watch in their browsers.

A little room · Show / hide animation

A host with a gold crown switches between a gamepad, paintbrush, camera and remote as friends watch games, drawings, photos and a film.

Features · Get started · Self-hosting · Contributing

Features

  • Watch without installing. Friends join by invitation in a desktop or mobile browser.
  • Share from Piik App or an existing Piik site. Choose a screen, window, browser tab or camera; available sources and audio depend on the platform.
  • Direct connections first. Media travels between participants where possible (P2P). A self-hosted server can provide automatic media forwarding (SFU) as a fallback.
  • Rooms you control. Invitations, room codes and optional room passwords, for one host and up to 20 viewers.
  • Flexible viewing. Light and dark themes, playback controls, picture-in-picture and a connection topology view.
  • One program to host a site. Web UI, room management and optional media forwarding are packaged together.

Piik room: a shared game, playback controls and friends on a sofa. The host wears a small gold crown.
Interface preview · Sample room with a generated game scene

Get started

To watch: open the invitation your friend sends you. Select Play if the picture does not start automatically.

To share: download Piik App to get started. To share without installing, you can also create a room in the online version.

Start here What you need to do
Use Piik online Share from a desktop browser, or choose Camera on a phone with browser camera support.
Download Piik App Extract and open the App, choose Public invite, then Open Piik to create a temporary room.
Host your own site Advanced: deploy Piik Server on a Linux x64 server with your own domain, then connect through Piik App or a browser.

Choose a screen, send an invitation, watch together.

  1. Select Start sharing, then choose the picture and audio to share.
  2. Select Copy invite link and send it to your friends. Keep the sharing tab open.

Turn on the Microphone for commentary; its settings let you choose the input device and adjust your voice volume.

Piik follows your system language: Chinese or English, with English as the fallback. Use 中 / EN / ✦ in the header to switch language or try the visual mode. The App offers a local room, a temporary public link, or a connection to your own site. Keep the App running while sharing through it.

Download a ZIP beginning with piik-app. The filename also identifies the platform:

Filename contains Platform
windows-amd64 Windows x64
darwin-arm64 Apple silicon; native capture requires macOS 13+
linux-amd64 Linux x64

Full setup guide → · Open online →

Browser capture requires HTTPS or localhost. Windows App and desktop browser sharing are the primary tested paths. The macOS and Linux apps have not yet been tested on physical devices; test results and feedback are welcome. P2P-only modes, including the App's temporary public link and the online version, may not connect on restrictive networks.

Self-hosting

Piik Server is a standalone binary with the web interface built in. Download the Linux x64 Server package (piik-<revision>-runtime.tar.gz), extract it, and run:

./piik-server

Open http://localhost:8787 to try it locally. For a public site, configure your domain, HTTPS reverse proxy and STUN address. Room data is stored in SQLite. For containers, use the Docker Compose setup.

Deploy your own site → · Configuration · Run from source

Contributing

Bug reports, translations, documentation improvements and pull requests are welcome. See ways to contribute or help translate Piik. Use the repository layout to find your way around.

License

Piik-owned code is MIT licensed. Dependencies retain their own licenses and notices.

S
Description
Free, open-source screen sharing for friends. P2P-first, with browser viewing, a desktop app and optional self-hosting.
https://piik.tv
Readme MIT
9.7 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 46.2%
Go 36.5%
C++ 5.9%
JavaScript 5%
CSS 2.5%
Other 3.9%