## Problem and outcome / 问题与结果 Piik's media settings were coupled to a small preset list, and using native App capture on a Site required a separate launcher mode. This release separates numeric media requests from presets and bounded runtime admission, remembers successfully applied settings, and lets a running App serve an explicitly approved Site independently of Local/public room startup. The same phase repairs confirmed capture-retirement, ICE discovery, media-recovery and storage failures. P2P-first routing, one room authority and the existing Browser/Native media owners remain. This phase targets **v2.0.0** with incompatible Web/App contracts. The owner authorized publication after final acceptance; the verified package and deployment records own delivery completion. ## Release notes ### 中文 Piik 2.0 扩展了画质设置,简化了 App 与站点的连接,并集中修复采集和断线恢复问题。**本次升级调整了通信协议,App 与所用站点需要一起升级。** #### 新功能与改进 - **自定义画面设置:** 保留三档推荐预设,支持填写分辨率上限、1–240 帧的帧率上限和 0.1–240 Mbps 的视频码率上限。滑动条沿用常用范围,更高数值可直接填写并显示为“自定义”。帧率范围随画幅变化,可请求 1080p240、1440p144、4K60 和超宽画面;输出保留来源比例。 - **自定义音频质量:** 在原有三档音频预设之外,可填写 6–320 kbps 的来源音频码率上限。 - **双端 App 协同连接:** 启用增强 NAT 穿透后,适用的重试可协调双方 App 准备 UDP 连接;首次连接仍走普通 ICE,不适用时继续现有流程。已通过受控网络验证,实际连通性仍取决于双方网络。 - **记住分享设置:** 下次打开时恢复已应用的画面与音频质量。仅用浏览器时按站点保存;通过新版 App 使用时,更换临时公网邀请网址也能保留设置。 - **更直接地连接 App:** 启动页提供本地房间和公网邀请,首次默认选择公网邀请。使用已有站点时,保持 App 运行,在站点点击 **App** 并确认授权即可。App 打开的本地房主页自动获得授权,站点按钮会显示 App 就绪状态。启动页可查看或取消授权;从另一个站点连接并批准,会替换原授权。 - **置顶聊天窗口:** 支持的桌面浏览器可将聊天移入独立置顶窗口,保留当前消息、草稿和阅读位置;关闭窗口后回到原页面。 #### 修复 - **连接与恢复:** 完善备用 STUN 与 NAT 采样信息的处理;重新收集 ICE 候选时刷新网卡地址。修正观众重连的机会计数、本机媒体连接恢复,以及恢复后遗留的发送队列和带宽统计问题。保留视频编码对应的标准重传能力,改善网络地址变化后的画面恢复。 - **采集稳定性:** 修正 Windows 停止采集或预览时的异步资源释放问题,保留采集边框偏好,更快跳过无法正常输出的编码器。采集与应用音频能力按实际接口探测,不再按 Windows 版本号排除;修正 Linux Portal 来源识别和早期采集失败通知,改善摄像头与原生采集的画面比例处理。 - **状态与清理:** 房间失效时及时释放 App 连接和待完成的选源请求;本地或公网房间启动失败时,App 保持待机并保留其他已授权站点的连接;公网邀请启动失败保留底层错误。修正启动页旧查询覆盖新设置的问题,并限制原生连接准备的待完成任务。SFU 诊断区分房主发布和观众接收状态。 - **其他维护:** 收到尚不支持的表情时跳过该效果;修正 SQLite 写入失败后的事务恢复。Gitee 镜像可独立重试,官网交互、指南和依赖同步更新。App 连接失败时提供重试与下载入口;统一选源设置与自定义数值的反馈。减少重复的随机短语,仅在持续等待时定时轮换。 #### 升级须知 **2.0 与 1.x 不能混用。** 自建站点请更新 Server 和连接该站点的 App,并刷新所有分享与观看页面。本地房间或公网邀请用户请停止分享、关闭旧 App,完整解压新版程序包后重新发送邀请链接。 本次不变更房间数据库结构。重启会中断正在进行的分享;麦克风、采集权限和设备选择不会自动恢复。4K60 等设置是输出上限,实际清晰度与帧率取决于来源、设备和网络。macOS/Linux 采集及部分移动设备仍需更多实机反馈。 ### English Piik 2.0 adds more control over sharing quality, simplifies connecting the App to a Site, and fixes capture and connection-recovery failures. **The communication contracts change in this release: update the App and its Site together.** #### Highlights - **Custom picture settings:** Keep the three recommended presets or enter a resolution ceiling, a 1–240 fps limit and a 0.1–240 Mbps video bitrate limit. Sliders retain their familiar ranges; higher entered values are clearly marked as custom. Frame-rate limits depend on picture size, admitting requests such as 1080p240, 1440p144, 4K60 and ultrawide pictures while preserving source proportions. - **Custom audio quality:** Enter a 6–320 kbps source-audio bitrate limit alongside the three existing audio presets. - **Coordinated App connections:** With enhanced NAT traversal enabled, eligible retries can coordinate UDP preparation between two Apps. The first attempt remains ordinary ICE, and ineligible preparation continues through the existing path. Controlled network checks pass; real-world connectivity still depends on both networks. - **Remember sharing settings:** Restore successfully applied picture and audio quality next time. Browser-only use saves settings per site; an updated App can retain them across changing temporary public-invitation addresses. - **Connect the App from a Site:** The launcher offers Local room and Public invite, with Public invite selected on first use. For an existing Site, keep the App running, click **App** on the Site and confirm its authorization. Host pages opened locally by App are authorized automatically, and the Site button reflects verified App readiness. View or revoke approval in the launcher. Connecting and approving another Site replaces the previous approval. - **Always-on-top chat:** Supported desktop browsers can move chat into a separate always-on-top window while retaining messages, drafts and reading position. Closing the window returns chat to the page. #### Fixes - **Connections and recovery:** Improve fallback STUN discovery and NAT survey handling, and refresh interface addresses during ICE gathering. Fix Viewer recovery-opportunity accounting, local media-connection recovery, stale send queues and bandwidth accounting after recovery. Preserve standard video retransmission when selecting a codec to improve picture recovery after network-address changes. - **Capture stability:** Fix asynchronous Windows resource retirement after capture or preview ends, retain the capture-border preference, and reject non-performing encoder candidates earlier. Detect capture and process-audio support through actual APIs rather than Windows-version gates. Correct Linux Portal target identification and early capture-failure delivery; improve source-aspect handling for camera and native capture. - **State and cleanup:** Release App connections and pending source selection when room authority ends. Keep the App on standby and preserve other authorized Site connections when interactive Local/public room startup fails. Retain underlying public-invitation startup errors. Prevent stale launcher reads from replacing newer settings, bound pending native connection-preparation work, and distinguish Host publication from Viewer reception in SFU diagnostics. - **Maintenance:** Skip unsupported incoming reaction effects, recover SQLite transactions after write failures, and retry Gitee mirroring independently. Update website interactions, guides and dependencies; clarify App connection recovery, source-selection settings and custom-value feedback. Reduce repeated playful captions, with timed rotation reserved for ongoing waits. #### Upgrading **2.0 and 1.x cannot be mixed.** For a hosted Site, update its Server and connected Apps, then refresh every Host and Viewer page. For Local rooms or Public invites, stop sharing, close the old App, extract the complete new package and send a fresh invitation. The room database schema is unchanged. Restarting interrupts active shares; microphone activation, capture permission and device selection are not restored automatically. Settings such as 4K60 are output ceilings: actual resolution and frame rate depend on the source, device and network. macOS/Linux capture and some mobile devices still need more physical-device feedback. ## Verification / 验证 - Product candidate: `24a28738241b9012c0476386356a515aab21f1a5`, built as `v2.0.0`. [Final full candidate CI](https://github.com/TNTcraftHIM/Piik/actions/runs/38555494851) covers core validation, vulnerabilities, races, five App packages and both Server/container targets without publishing. Later commits extend race coverage, correct the capture test fixture's inherited Go race-exit delay, and update documentation/staged website screenshots; shipped product code is unchanged. [Additional control/loopback race checks](https://github.com/TNTcraftHIM/Piik/actions/runs/38561191343) use that updated collector. Product shutdown deadlines and test assertions are unchanged. - Local Web acceptance passes **91 files / 1,612 tests**, type checking and production build. Full Go/native checks, Windows capture compilation, five-repeat control regressions, website/documentation build and repository checks pass. Existing documentation-size and bundle-size warnings remain visible. - The Windows candidate's original descriptor, revision and SHA-256 are checked before extraction and packaged Local/control acceptance. All candidate packages pass the release publisher's read-only identity/checksum verification. - Serial Windows native H.264 Host acceptance passes live/paused/custom/4K settings, background/source recovery and stop/re-share. VP8 two-room SFU and H.264 SFU-only checks pass live quality/audio changes, subscription/page-reload recovery and retirement; stopping one room preserves the other room's media. Browser-to-App fanout and App-exit fallback also pass. Gates clean their processes, profiles and listeners. These checks do not establish sustained game/4K performance. - The final network run passes **37 cases and six negative controls**, with **32 actual media outcomes and five unavailable observations**. It covers all Browser/App pairings, IPv6, remapping, STUN backup, outages, quality recovery, healthy siblings and SFU policies. Sequential-NAT App/App preparation delivers media; a mixed sequential case also connects in this run, without a claim of deterministic benefit. Fault controls reject absent faults/frozen video and verify cancellation/cleanup. No public success percentage is inferred. - Twenty Viewer topology acceptance delivers increasing decoded frames to all Viewers, preserves the two-copy bound and recovers from relay loss. Invitation privacy checks find no grant leakage in requests, cookies, persistent storage or logs. Both are bounded synthetic-source checks, not public-network endurance. - Current UI checks cover Chinese/English/visual, both themes and 320/360/768/1366-pixel layouts, numeric limits, source selection, App approval/revocation, architecture downloads and reader navigation. Chat/PiP retains draft/history/scroll and returns to the page on close; retirement and refused opening clean up. Real Host/Viewer UI chat continues after capture stops and while the Host is absent. Film controls, mute/seek/end/replay, mobile containment and pointer-close unloading pass. README stills and the staged launcher now use current navigation. Scoped axe checks report no violations; contrast and physical assistive-technology coverage are not certified. - Physical macOS/Linux capture, limited decoders, mixed HDR displays, mobile permissions and sustained game/4K use retain their [evidence limits](https://github.com/TNTcraftHIM/Piik/blob/ci/gitee-mirror/docs/verification-status.md). Unmatched field reports remain open. Gitee activation and public-domain checks are publication postflight; original v1.9.2 artifact/mirror recovery already passed without remote writes. ## Boundaries and contributor credit / 边界与贡献 The candidate uses Browser/server v24 and Native control v10; capture v7 and SQLite schema 2 are unchanged. Numeric wire values remain separate from codec/allocation admission. H.264/VP8, framework-owned adaptation and automatic P2P-first routing remain; this candidate adds neither codecs, room voice, end-to-end HDR, surround audio nor Magicsock. Local controls confirm specific repairs, not the causes of unmatched user reports or a measured increase in NAT success rate. The STUN report in #471 remains subject to paired endpoint/network evidence. Gitee's separate workflow activation still needs post-merge verification; its original-artifact and anonymous-download path has passed against v1.9.2. The Linux Portal fix from @AkazaAkali in #470 is incorporated with original commit authorship and the co-author trailer below. #462 and #469 propose higher audio rates and 4K; neither patch is merged. Their preset-expansion implementation is superseded by the independently established numeric-media contract, so overlapping functionality alone does not warrant merging or co-authorship. #475 identifies the Linux desktop entry’s missing terminal controls; that defect is independently corrected without accepting tray or Browser-owned process-exit additions. The settings request in #460 is implemented; issue/PR closure remains part of release follow-up. Co-authored-by: AkazaAkalin <478080766@qq.com>
14 KiB
第一次用 Piik
Piik 支持一位房主分享屏幕,最多 20 位受邀观众通过浏览器观看。 本指南介绍加入房间、使用在线版、使用 Piik App,以及通过已有站点分享的方法。
加入房间 · 在线版 · Piik App · 已有站点 · 聊天与表情 · 问题排查
观众只需要浏览器和邀请链接。 分享画面推荐下载 Piik App,选择 公网邀请。 想免安装,可以打开在线版,直接在浏览器里创建房间并分享。
加入朋友的房间
- 用电脑或手机浏览器打开朋友发来的邀请链接。
- 等待画面出现。如果浏览器没有自动播放,点击 播放。
- 将鼠标移到画面上,或轻点画面,显示播放控制栏。
播放控制栏只改变你自己看到的画面和听到的声音。 电脑上单击画面可暂停或继续,双击可进入或退出全屏(浏览器支持时)。 手机上轻点画面唤出控制栏,再使用其中的按钮。Safari 的视频全屏可能使用系统播控。
播放按钮分别做什么?
| 按钮 | 作用 |
|---|---|
| 剧场模式 | 在浏览器标签页内展开画面。 |
| 全屏观看 | 全屏显示并保持原始比例;画面与屏幕比例不同时会留边。 |
| 悬浮小窗 | 浏览器支持时,把视频放进独立小窗。 |
| 音量 | 支持增强时最高 200%,否则最高 100%;声音失真时调低一些。 |
只有四位房间号时,打开同一个 Piik 站点,选择 加入房间。 你可能需要站点口令和房间密码。能否通过房间号加入由房主决定; 无法加入时,请朋友发邀请链接。
房主可关闭链接旁的 免密邀请,复制普通房间地址。访客打开地址后按站点和房间设置 验证口令或密码;仅限邀请的房间需保留凭证。这个开关不会撤销已发出的邀请。
旧链接失效了,就请房主重新发一份当前邀请。 App 的本地房间和临时公网邀请会随本次 App 退出而结束。
使用在线版
- 在浏览器中打开 demo.piik.tv。
- 点击 开始分享,选择 浏览器 分享屏幕、窗口或标签页;也可在电脑或手机上选择 摄像头(需浏览器支持访问)。如需来源声音且选择器提供该选项,启用音频。
- 确认预览后,点击 复制邀请链接,用另一台设备打开,或发送给朋友。
- 分享结束后,点击 停止分享。
在线版由项目提供,画面仅通过设备间直连(P2P)传输。 在受限网络下,可能出现页面能打开、画面无法连接的情况。
用 Piik App 分享
- 从 GitHub Releases 或
Gitee 镜像下载以
piik-app开头、 对应平台的压缩包,完整解压并保留目录结构。 - Windows 打开
piik-app.exe,macOS 打开Piik App.app,Linux 运行./piik-app。 启动页会在系统浏览器里打开。 - 邀请不在同一局域网的朋友时,选择 公网邀请,再点击 进入 Piik。 其他模式的用途见下表。
- 点击 开始分享,按可用选项选择 浏览器、摄像头、程序 / 窗口 或 屏幕, 然后选定要分享的画面与声音。
- 复制房间邀请发给朋友。分享期间保持 App 和分享标签页打开。
启动页提示更新时,可点击 版本说明 查看 GitHub 或 Gitee 上的详情。 跨大版本更新会显示兼容性提醒;替换 App 前,请先阅读升级说明。
| 文件名包含 | 适用平台 |
|---|---|
windows-amd64 |
Windows x64 |
darwin-arm64 |
Apple 芯片;原生采集需 macOS 13 及以上 |
darwin-amd64 |
Intel Mac;原生采集需 macOS 13 及以上 |
linux-amd64 |
Linux x64 |
linux-arm64 |
Linux ARM64 |
目前主要测试 Windows 版 Piik App 和浏览器分享。macOS 和 Linux 版 Piik App 仍需更多实机测试, 欢迎有设备的朋友试用并反馈问题。 Linux 原生采集还需要系统组件。 程序包与启动参数的细节见 App 指南。
选择 App 模式
| 模式 | 什么时候用 | 需要知道 |
|---|---|---|
| 本地房间 | 朋友和你在同一个局域网。 | 多网卡时展开「局域网邀请地址」,选择与朋友同一网络的网卡和 IP。对方需要能连接到你的电脑,可以设置本地站点口令。 |
| 公网邀请 | 朋友在别处,想临时发个邀请。 | 需要互联网连接;公网地址只在本次 App 运行期间有效。 |
本地房间和公网邀请可展开 站点口令 设置可选的访问口令。
已经有 Piik 站点? 保持 App 运行,打开站点,点击顶部的 App。 在本机确认页核对网址,点击 允许使用。如果站点要求口令,在站点页面输入。 浏览器询问本地网络权限时,请允许访问。启动页无需选择房间模式。 也可以在 开始分享 的选源窗口里点击 连接 Piik App,连接后列表会直接显示 App 来源。 连接失败时,App 按钮旁会提供 重试 和 下载 App;仍可继续使用浏览器分享和观看。
同一浏览器会记住这次连接。之后直接访问站点,点击 开始分享, 选择 程序 / 窗口 或 屏幕,即可使用正在运行的 App。 换浏览器、使用无痕窗口或清除站点数据后,重新连接即可;App 已允许的同一站点无需再次确认。 启动页显示已授权的站点,网址右侧的 × 可取消授权;允许新站点会替换旧站点,并结束旧站点的 App 连接。 如要通过自己的 App 使用朋友的新公网邀请地址,需要重新连接并确认;App 保存的分享画质不受地址变化影响。
网页能打开,不代表视频一定能连通。 公网邀请为房间提供临时网页地址, 画面和声音仍靠参与者之间的连接传输。此模式没有媒体服务器兜底, 临时地址也不保证持续可用。所有模式都需要可用的 UDP 媒体路径。 具体连接方式见 App 指南。
版本升级
Piik 2.0 与 1.x 不能混用。 App 与连接的站点需要使用同一大版本。 升级前,请先查看 GitHub 或 Gitee 上的版本说明。
- 本地房间或公网邀请: 停止分享并关闭旧 App,完整解压新版程序包, 启动后重新发送邀请链接。
- 已有站点: 管理员先按更新指南升级 Server, 然后更新连接该站点的 App,并刷新所有分享与观看页面。
重启 App 或 Server 会中断正在进行的分享。本次升级不变更房间数据库结构。
使用已有站点分享
需要先有一个运行 Piik Server 的 HTTPS 站点,可以使用朋友或管理员提供的地址。 也可以使用项目提供的在线版或 Piik App。 自建站点属于进阶操作,服务器、HTTPS 和网络端口的配置步骤见部署指南。
- 打开 Piik 站点。如果站点设置了口令,先输入口令。
- 点击 开始分享,选择 浏览器 后在浏览器弹窗里选择屏幕、窗口或标签页; 浏览器支持时,电脑和手机也可选择 摄像头。如需来源声音且选择器提供该选项,启用音频。
- 确认预览画面后,点击 复制邀请链接 发给朋友。
- 保持分享标签页打开。需要时使用 暂停分享、切换来源 或 停止分享。
浏览器屏幕采集需要 HTTPS 站点或 localhost。
弹窗里有哪些画面和声音可选,取决于浏览器与操作系统。
拿到邀请链接的人可以进入这个房间,请把它发给你想邀请的人。
想在同一站点使用 App 采集,可按连接站点的步骤操作。 站点负责房间与邀请,App 提供原生采集。 如果管理员已启用 SFU 转发,房主可在开始分享前关闭 隐私模式,允许使用这条兜底线路。 项目提供的在线版仅使用 P2P。
画面与声音设置
在画面下方打开 分享设置,调整画质和音频质量。
- 可选画质预设,也可在 分辨率上限 中填写宽和高。画面在上限内保留来源比例, 包括竖屏和超宽屏。
- 滑块覆盖 15–60 帧(每步 5 帧)、2–12 Mbps(每步 0.5 Mbps)的常用范围;也可直接填写 1–240 帧的 帧率上限 和 0.1–240 Mbps 的 视频码率上限。 不在滑块档位上的数值显示为 自定义;点击 返回常用范围,使用最近的可用档位。 帧率范围随画幅变化,例如可以请求 1080p240、1440p144 或 4K60。
- 音频保留三档预设,也可填写 6–320 kbps 的 音频码率上限。
可选范围会随画幅和连接的 App 变化。实际画质和声音仍会根据来源、设备与可用带宽调整。
Piik 会记住已应用的设置,供下次使用。仅用浏览器时,设置保存在当前站点; 通过新版 App 打开时,更换公网邀请网址也能保留设置。
加上自己的声音
分享时,点击画面下方的 麦克风,并允许访问。 再次点击即可静音。在画面下方的 设置 → 声音 中可以选择麦克风和调节输入音量,默认 100%,最高可调至 200%。 观众会同时听到来源声音和你的解说;房主本机预览保持静音。
摄像头分享不会自动开启麦克风。App 的 程序 / 窗口 和 屏幕 采集也使用同一组控件, 可以保留「默认设备」,也可以指定麦克风。在 摄像头 页签中允许访问后,点击对应的画面卡片开始分享。 设备名称和可用预览取决于浏览器权限;正在分享摄像头时,其他摄像头只显示名称。 建议佩戴耳机,避免扬声器声音被麦克风再次收进去。
通过 浏览器 或 摄像头 分享时,声音设置中的 降噪与回声消除 默认开启, 由浏览器处理回声、杂音和音量。输入音乐或虚拟音频设备的声音时,可关闭它; 设备及系统自身的音效仍由各自设置控制。App 原生采集使用设备及系统的音频设置。
带麦克风的摄像头仍需分别选择画面和音频输入。OBS 虚拟摄像头只提供画面; 如需带上 OBS 的声音,可按 OBS 音频转接教程 设置虚拟音频设备,再在 Piik 的麦克风列表中选择对应输入并开启麦克风。
分享屏幕时排除语音软件的声音
在支持此功能的 Windows App 中,打开 屏幕 页签并开启 系统声音, 在 排除应用声音 中选择语音软件的窗口,再选择要分享的屏幕。 未列出的应用请先打开窗口,再刷新。此功能排除所选进程及其子进程, 其他应用的声音仍会被分享,包括输出到其他播放设备的声音。 它不影响 Piik 麦克风,也不能消除扬声器被麦克风收音产生的回声。
使用虚拟麦克风时,如果关闭 Piik 麦克风后仍能听到你的声音,可暂时关闭 系统声音 对照。 若声音随之消失,请检查混音软件的播放输出与监听,或改为只分享目标应用的窗口音频。 排除语音软件不会同时排除另一个混音软件;后者输出到虚拟播放设备的声音也可能被采集。
开播后,可在 分享设置 → 声音 中调整系统声音和排除的应用,无需停止分享。 所选应用关闭或重启后,来源声音会停止;请刷新应用列表并重新选择。 暂时关闭来源声音会保留排除选择;需要恢复完整的系统声音时,选择 不排除。 此控件需要新版页面和通过进程排除能力检测的 Windows App,不适用于浏览器自带的分享选择器。 Windows 10 是否支持取决于系统更新与实际检测;未显示此选项时,可改为分享单个应用窗口,或将语音软件输出到另一播放设备。
聊天与表情
房主首次开始分享、创建房间后,参与者可以点击沙发下方的 聊天 发送消息。 点击沙发上的人物可打开表情菜单:给自己发的表情出现在头顶,送给朋友的表情会飞向对方。 聊天窗口可以移动和缩放,不会挤动页面。
支持的桌面浏览器会在窗口右上角显示 置顶聊天窗口,方便切到游戏时看消息。 保持 Piik 页面打开;关闭小窗会把聊天收回页面。建议游戏使用窗口或无边框模式, 独占全屏不保证显示置顶窗。小窗目前不支持透出游戏画面或鼠标穿透。
输入框旁和观众播放控制栏中的 弹幕 可以把新消息显示在画面上,默认关闭,只影响自己的观看。 打开聊天窗口中的 聊天设置,可以调整弹幕字号和不透明度。 系统视频全屏和画中画无法显示弹幕。
停止分享后仍可继续聊天;App 的本地房间和公网邀请需要保持 App 运行。 每个页面只保留本页最近收到的消息,刷新后清空,后来加入的人看不到此前的记录。 需要留存时,可通过 聊天设置 → 导出聊天记录 将本页保留的最近消息(最多 1,000 条)保存为文本文件。 聊天消息经过房间所在的服务器,不提供端到端加密。
遇到问题了
声音、采集、启动或播放遇到问题时,先看问题排查。
画面连接不上
出现「没有可用的媒体线路」等提示时,参阅画面连接排查。