Skip to main content

更改临时目录

在渲染过程中,Remotion 会将项目写入系统的临时目录。这包括渲染的帧、未压缩的音频以及其他产物。

🌐 During rendering, Remotion will write items into the temporary directory of the system. This includes rendered frames, uncompressed audio and other artifacts.

如果默认的临时目录位于可用空间有限的磁盘上,更改临时目录可能会有所帮助。

🌐 Changing the temporary directory may be useful if the default temporary directory is on a disk that has limited space available.

如果你想自定义 Remotion 使用的目录,你可以设置 TMPDIR(Linux、macOS)或 TEMP(Windows)环境变量来指定你喜欢的目录。

🌐 If you want to customize the directory that Remotion uses, you can set the TMPDIR (Linux, macOS) or TEMP (Windows) environment variable to specify a directory to your liking.

TMPDIR=/var/tmp npx remotion render

Remotion 会在你指定的路径中创建一个新的临时目录。 这是因为 Remotion 使用 Node.JS os.tmpdir() API,该 API 会按以下顺序检查环境变量:

🌐 Remotion will make a new temporary directory in the path that you have specified. This is because Remotion uses the the Node.JS os.tmpdir() API, which checks for environment variables in the following order:

  • TMPDIRTMPTEMP 在非 Windows 平台上
  • TEMPTMP 在 Windows 平台上