studio-diagnostics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStudio playback diagnostics
Studio 播放诊断
Use the running Studio for the current worktree. To launch one, follow
studio. Confirm the composition and reproduction range before
recording. Do not modify the composition just to obtain a trace.
使用当前 worktree 中正在运行的 Studio。要启动 Studio,请遵循 studio。开始记录前,确认 composition 和复现范围。不要仅仅为了获取 trace 而修改 composition。
Capture through WebMCP
通过 WebMCP 捕获
- Call with
set_buffering_tracingbefore reproducing. Alternatively, enable Settings → Studio → Debug → Show diagnostics,{"enabled": true}, orConfig.setShowDiagnostics(true). The floating panel enables tracing while mounted. Drag its header to move it; arrow keys also work when the header has keyboard focus.--show-diagnostics - Pause playback and call with
clear_buffering_events. This removes completed history, preserving any active episode. Read{}for a counter baseline. Optionally callget_diagnosticswithreset_buffering_handles_createdto reset that creation count without changing active handles or other counters.{} - Use ,
select_composition,seek_to_frame, andplayto reproduce the reported range. Start early enough to include premounting and loading.pause - Call with
get_buffering_eventsand{"limit": 20}withget_diagnostics. Inspect the recorded frames, durations, handle stacks, media sources, and owner locations.{}runs from the nearest layer through its ancestors.owners - Call with the returned
reveal_buffering_handleandeventId. This pauses, switches to the recorded composition, seeks to the event's start frame, and selects the owner in the timeline and Inspector. CheckhandleIdandget_selectionto confirm. The panel's Reveal button does the same.get_playback_state - When finished, call with
set_buffering_tracing. Tracing remains enabled if the panel is still open. Report the composition, frame, source location, media URL, duration, and evidence for the cause.{"enabled": false}
See the WebMCP tool schemas for exact
inputs, outputs, and availability. These tools work in regular, detached, deployed,
and remotion.new. Reveal requires a selectable composition timeline; it reports
an error if a record, composition, or matching layer no longer exists.
- 在复现前调用 ,并传入
set_buffering_tracing。 也可以启用 Settings → Studio → Debug → Show diagnostics、{"enabled": true}或Config.setShowDiagnostics(true)。浮动面板挂载后会自动启用 tracing。拖动其标题栏可以移动面板;当标题栏获得键盘焦点时,也可以使用方向键。--show-diagnostics - 暂停播放并调用 ,传入
clear_buffering_events。这会移除已完成的历史记录,同时保留任何 active episode。读取{}以获取 counter 基线。也可以选择调用get_diagnostics,传入reset_buffering_handles_created,以重置创建计数,而不影响 active handles 或其他 counters。{} - 使用 、
select_composition、seek_to_frame和play复现所报告的范围。开始位置应足够早,以涵盖 premounting 和 loading。pause - 调用 ,传入
get_buffering_events;再调用{"limit": 20},传入get_diagnostics。检查记录的 frames、durations、handle stacks、media sources 和 owner locations。{}按从最近层到其祖先层的顺序排列。owners - 使用返回的 和
eventId调用handleId。这会暂停播放、切换到记录的 composition、跳转到事件的起始 frame,并在 timeline 和 Inspector 中选择 owner。检查reveal_buffering_handle和get_selection以确认结果。面板中的 Reveal 按钮会执行相同操作。get_playback_state - 完成后,调用 ,传入
set_buffering_tracing。如果面板仍处于打开状态,tracing 会保持启用。报告 composition、frame、source location、media URL、duration,以及导致问题的原因证据。{"enabled": false}
有关各工具的精确输入、输出和可用性,请参阅 WebMCP 工具 schema。这些工具可用于 regular、detached、deployed 和 remotion.new。Reveal 要求存在可选择的 composition timeline;如果 record、composition 或匹配的 layer 已不存在,它会报错。
Interpret the evidence
解读证据
- is cumulative; it is not the number of live iterators.
audioIteratorsCreated - is the current number of registered sinks whose inputs have not been disposed. It is not a cumulative count.
mediabunnySinksOpen - counts calls that create playback blocks. A block can be cleared immediately and never enter buffering. Reset only affects this count.
bufferingHandlesCreated - counts transitions into the internal buffering state. Overlapping handles form one episode. A handle added and removed within the same React batch does not trigger an episode. Short episodes may not display the loading indicator, whose default delay is 300 ms.
bufferingStatesTriggered - identifies handles present when the episode began. Other handles joined an already-buffering episode; they may prolong it or be a result of resynchronization. A recorded handle is evidence of a playback block, not by itself proof of the root cause.
activeAtStart: true - Event is the composition frame at buffering entry. Handle
frameandframedescribe creation and release. Times usereleasedFramemilliseconds.performance.now()means ongoing;endedAt: nullmeans the buffering provider disappeared, not that media finished loading.endReason: 'unmounted'
Capture starts when enabled, not retroactively. Handles created earlier are
included in if still blocking at event start. Detailed history
keeps at most 100 events and 50 handles per event; the panel shows the latest 20.
Check and before treating a trace as complete.
History and counters reset on page reload. Clearing history preserves active
records and does not reset counters. IDs are not reused when history is cleared.
omittedHandlesdroppedEventsomittedHandlesUse only to request newer episodes. To inspect updates or releases in an
existing episode, omit it. Source stacks remain available after layers unmount;
Reveal matches a current layer by identity or captured source information and may
fall back to an ancestor. Check the returned selection rather than assuming the
original layer survived edits or HMR.
afterId- 是累计值,并不是 live iterators 的数量。
audioIteratorsCreated - 是当前已注册且其 inputs 尚未被 disposed 的 sinks 数量,并不是累计值。
mediabunnySinksOpen - 统计创建 playback blocks 的调用次数。一个 block 可以立即被清除,并且从未进入 buffering。重置只会影响这个计数。
bufferingHandlesCreated - 统计进入内部 buffering 状态的转换次数。重叠的 handles 构成一个 episode。在同一个 React batch 中添加并移除的 handle 不会触发 episode。短暂的 episode 可能不会显示 loading indicator,其默认延迟为 300 ms。
bufferingStatesTriggered - 标识 episode 开始时已经存在的 handles。其他 handles 加入了一个已经开始 buffering 的 episode;它们可能延长该 episode,也可能是 resynchronization 导致的结果。记录的 handle 是 playback block 的证据,但其本身并不能证明 root cause。
activeAtStart: true - Event 的 是进入 buffering 时的 composition frame。Handle 的
frame和frame分别描述创建与释放。时间使用releasedFrame毫秒值。performance.now()表示事件仍在持续;endedAt: null表示 buffering provider 已消失,而不是 media 已完成加载。endReason: 'unmounted'
捕获从启用时开始,不会追溯记录此前的内容。如果在 event 开始时仍处于阻塞状态,更早创建的 handles 会包含在 中。详细历史最多保留 100 个 events,每个 event 最多包含 50 个 handles;面板显示最新 20 个。在将 trace 视为完整之前,请检查 和 。页面重新加载时,历史记录和 counters 都会重置。清除历史记录会保留 active records,但不会重置 counters。清除历史记录后,IDs 不会被复用。
omittedHandlesdroppedEventsomittedHandles仅在请求更新的 episodes 时使用 。要检查现有 episode 中的更新或释放,请勿传入它。Layers 卸载后,source stacks 仍然可用;Reveal 根据 identity 或捕获的 source information 匹配 current layer,并且可能回退到 ancestor。请检查返回的 selection,而不要假定原 layer 经 edits 或 HMR 后仍然存在。
afterIdFind the cause and verify a fix
查找原因并验证修复
Read the first blocking handles' source and owning JSX, then trace media waits to
the underlying fetch, decoding, seeking, or synchronization path. Follow
fix-root-cause. Distinguish an initial decoder wait
from audio handles subsequently created to resynchronize playback.
Inspect the relevant Sequence's , its actual mount frame, and source
media properties. Premounting mounts early; it does not guarantee all upcoming
frames are decoded. The preview queue in
canvas-ahead-of-time.ts
holds three ahead-of-time slots; current/peeked frames and browser decoder buffers
are separate. Do not interpret this as decoding a full second during premount.
premountForFor suspected media bottlenecks, verify resolution, codec, file size, bitrate,
and decode timing. Confirm an alternative file contains the same capture before
proposing a replacement. Do not suppress buffering or silently substitute a
different video to hide a stall.
Reproduce the same range after a change and compare event count/durations,
resource counters, and visible output. For React render regressions use
react-scan. Keep traces bounded and local; summarize
relevant handles instead of returning every raw stack. Detailed stack capture is
opt-in; leave it off outside diagnostics work.
Implementation references:
trace store,
buffer transitions,
handle creation, and
reveal and serialization.
读取首批 blocking handles 的 source 和所属 JSX,然后沿着 media waits 追踪至底层的 fetch、decoding、seeking 或 synchronization path。遵循 fix-root-cause。区分初始 decoder wait 与之后为 resynchronize playback 而创建的 audio handles。
检查相关 Sequence 的 、实际 mount frame 和 source media properties。Premounting 会提前 mount;这并不保证所有即将到来的 frames 都已 decoded。canvas-ahead-of-time.ts 中的 preview queue 包含三个 ahead-of-time slots;current/peeked frames 与 browser decoder buffers 彼此独立。不要将其理解为在 premount 期间解码了完整一秒的内容。
premountFor对于疑似 media bottlenecks,请验证 resolution、codec、file size、bitrate 和 decode timing。提出替换方案前,确认替代文件包含相同的 capture。不要 suppress buffering,也不要通过静默替换为其他 video 来掩盖 stall。
变更后重新复现相同范围,并比较 event count/durations、resource counters 和 visible output。对于 React render regressions,请使用 react-scan。限制 traces 的范围并保持局部化;总结相关 handles,而不是返回每一个 raw stack。详细 stack capture 属于 opt-in;在非诊断工作中应保持关闭。
实现参考:
trace store、
buffer transitions、
handle creation,以及
reveal and serialization。