调试超时
以下错误:
🌐 The following error:
A delayRender() was called but not cleared after 28000ms. See https://remotion.dev/docs/timeout for help. The delayRender was called通常发生在 delayRender() 句柄已创建但之后未被清除的情况下。Remotion 会等待截图,但默认会在 30 秒后中止,以避免无限挂起。
🌐 generally happens if a delayRender() handle has been created and not been cleared afterwards. Remotion will wait to make a screenshot, but aborts it by default after 30 seconds to not hang forever.
可能的原因
🌐 Possible causes
continueRender() 未被调用
🌐 continueRender() was not called
你的代码可能存在一个问题,即你调用了 delayRender() 但从未清除它。这会导致 Remotion 在开始渲染之前无限等待,并最终出现超时消息。
🌐 Your code might have a problem where you call delayRender() but never clear it. This will cause Remotion to wait forever before it starts rendering and leads to a timeout message.
解决方法:检查你的代码,确保你正在调用 continueRender()。
没有互联网连接或防火墙问题
🌐 No internet connection or firewall issue
如果你依赖网络资源,例如字体、图片、视频或音频,而又没有互联网连接或请求被防火墙阻止,那么需要特别注意。当你在云端进行渲染时,例如,Amazon VPC 可能会阻止外发网络请求,从而导致超时。
🌐 If you rely on network assets such as fonts, images, videos or audio and you don't have internet connection or requests get blocked by a firewall. Special attention has to be given to when you are rendering in the cloud, Amazon VPC could for example block outgoing network requests and lead to a timeout.
解决方案:确保你所需的所有网络资源都可以访问。
内存压力
🌐 Memory pressure
当将并发设置得过高时,Chrome 可能会决定不加载一些 <Html5Video />,这可能导致超时错误。
🌐 When setting the concurrency too high, Chrome might decide to not load some <Html5Video />s which can lead to a timeout error.
我们认为这是 Remotion 的一个错误,并计划在未来修复它。
🌐 We consider this a bug in Remotion and plan to fix it in the future.
解决方法:将 concurrency 降低到 Chrome 可以加载所有视频的水平。
Remotion 旧版本
🌐 Old version of Remotion
旧版本的 Remotion 存在可能导致超时的漏洞。特别是 1.x 版本在导入大型资源时可能会超时。
🌐 Older versions of Remotion had bugs which could lead to timeout. Especially 1.x releases could timeout when importing large assets
解决方案:使用 npm run upgrade 升级到最新的 Remotion 版本。
视频需要下载
🌐 Video needs to be downloaded
如果你使用 <OffthreadVideo> 渲染视频,那么视频需要在可以读取之前下载。如果视频很大并且下载所需时间超过超时设置,则会触发超时。在这种情况下,你应该增加超时设置。
🌐 If you render a video using <OffthreadVideo>, then the video needs to be downloaded before it can be read. If the video is large and takes longer than the timeout to be downloaded, then the timeout will be triggered. In that you should increase the timeout.
没有帮助吗?
🌐 Not helpful?
打开一个问题,并尝试以我们可以重现的方式描述你的问题。我们会尽力帮你解决。
正在加载 <Img>,源为 http://localhost:3000/proxy
🌐 "Loading <Img> with src http://localhost:3000/proxy"
有关此特定的超时消息,请参见这里。
🌐 See here for this specific timeout message.
增加超时时间v2.6.3
🌐 Increase timeoutv2.6.3
有时,你无法避免某一帧渲染时间超过 30 秒。例如:
🌐 Sometimes, you cannot avoid a frame taking longer than 30 seconds to render. For example:
- 昂贵的 WebGL 场景
- 数据的昂贵预处理
- 需要等待视频下载完成
你可以增加默认超时时间:
🌐 You can increase the default timeout:
- 在 Remotion Studio 渲染对话框的“高级”中
- 使用
--timeout命令行标志 - 在
renderStill()、renderFrames()、getCompositions()、renderMedia()、renderMediaOnLambda()、renderStillOnLambda()、renderMediaOnVercel()、renderStillOnVercel()、renderStillOnCloudRun()和renderMediaOnCloudRun()中使用timeoutInMilliseconds选项 - 在配置文件中使用
Config.setDelayRenderTimeoutInMilliseconds()选项,如果你在命令行接口渲染 - 对于使用
timeoutInMilliseconds选项的delayRender()调用,单独进行v4.0.140 <Img>、<Audio>、<Video>、<Html5Audio>、<Html5Video>和<IFrame>标签支持一个delayRenderTimeoutInMilliseconds属性,用于控制这些组件发起的delayRender()调用的timeoutInMilliseconds值v4.0.140
添加一个标签以帮助调试v2.6.13
🌐 Adding a label to help debuggingv2.6.13
如果你遇到超时并且不知道它来自哪里,你可以添加一个标签作为参数:
🌐 If you encounter a timeout and don't know where it came from, you can add a label as a parameter:
delayRender ('Fetching data from API...');如果调用超时,错误消息中将引用该标签:
🌐 If the call times out, the label will be referenced in the error message:
Uncaught Error: A delayRender() "Fetching data from API..." was called but not cleared after 28000ms. See https://remotion.dev/docs/timeout for help. The delayRender was called另请参阅
🌐 See also
- delayRender()
- 数据获取
- 加载根组件超时
- "评估页面功能超时"
- [“加载中 <Img> 附 src http://localhost:3000/proxy ...”](/docs/troubleshooting/delay-render-proxy)