重写导出管道,Rust 拯救 Mac 屏幕录制器 TinyRec

#Tech

开发者为解决 Mac 屏幕录制器 TinyRec 导出速度慢的问题,对其导出流程进行了重写。

最初的实现使用 PixiJS 进行渲染预览和 WebCodecs 进行视频编码,但由于 PixiJS 将所有操作绑定到主线程,导致导出 720p 视频需要 15 分钟,且界面卡顿。

为了解决这个问题,开发者将导出管道重写为独立的 Rust 二进制文件,通过标准输入/输出与 Electron 应用通信,并采用 Metal 渲染和 Apple Silicon 的 VideoToolbox 硬件编码加速。

最终,导出时间从 15 分钟缩短到 1 分钟,显著提升了用户体验。

查看原文开头(英文 · 仅前 3 段)

← All posts

Nam Tran · May 3, 2026 I’m building a Mac screen recorder called TinyRec. Standard Electron stack — PixiJS for the editor preview, WebCodecs for the export. And it was slow.

A five-minute 720p clip took fifteen minutes to export. Not 4K. Not some pathological case. Plain 720p — the resolution everyone records at. Three times the source duration, just to render it out.

※ 出于版权考虑,仅引用前 3 段。完整内容请阅读原文。

阅读原文 ↗