进程因信号 SIGKILL 退出
此错误有多种变体:
🌐 This error comes in multiple variants:
Remotion Rust process killedCompositor quit with signal SIGKILL: [...]
FFmpeg process killedFFmpeg quit with code null (SIGKILL)
发生了什么?
🌐 What is happening?
操作系统要么正在终止 Remotion 进程,要么正在终止 FFmpeg 进程。最可能的原因是它占用的内存过多。
🌐 The operating system is either killing the Remotion process or the FFmpeg process.
Most likely this is due to it taking too much memory.
Remotion中的内存管理
🌐 Memory management in Remotion
Remotion 会打开一个用于提取视频帧的缓存,默认情况下,它允许自己占用渲染开始时可用内存的 50%。 如果 Remotion 发现系统内存不足,它会将缓存大小减半并释放内存。
🌐 Remotion opens a cache for extracting video frames, which by default allows itself to fill up to 50% of the available memory used at the begin of the render.
If Remotion realizes that the system is short on memory, it will halfen the cache size and free up memory.
然而,如果其他进程正在占用内存,Remotion 进程一旦分配了任何内存就可能被终止。
FFmpeg 进程也是同样的情况。
🌐 However, if other processes are filling up memory, the Remotion process can be killed as soon as it allocates any memory.
The same goes for the FFmpeg process.
降低 Remotion 的内存使用
🌐 Lower the memory usage of Remotion
你可以使用 offthreadVideoCacheSizeInBytes 来减小 Remotion 的缓存大小。
🌐 You can decrease the cache size of Remotion using the offthreadVideoCacheSizeInBytes.
确保你的 Remotion 版本是最新的
🌐 Ensure your Remotion version is up to date
我们不断改进 Remotion 的内存管理。
具有改进的最新版本是 v4.0.171。
🌐 We continuously improve the memory management of Remotion.
The last version with improvements is v4.0.171.
降低 Remotion 的并发性
🌐 Lower the concurrency of Remotion
设置较低的 concurrency 以一次打开更少的浏览器标签页,从而占用更少的内存。
🌐 Set a lower concurrency to open less browser tabs at once and thus less memory.
为你的系统分配更多内存
🌐 Allocate more memory to your system
作为最后的手段,你可以为系统分配更多内存来缓解这个问题。
🌐 As a last resort, you can allocate more memory to your system to alleviate the problem.