Skip to main content

ensureFfprobe()v3.3

@remotion/renderer包的一部分。 从v4.0中移除

🌐 Part of the @remotion/renderer package. Removed from v4.0

warning

此 API 在 v4.0 中已被删除,不再需要调用。本页面保留用于存档目的。

检查是否已安装 ffprobe 二进制文件,如果未安装,下载它并将其放入你的 node_modules 文件夹

🌐 Checks if the ffprobe binary is installed and if it is not, downloads it and puts it into your node_modules folder.

ensure.mjs
import {ensureFfprobe} from '@remotion/renderer'; await ensureFfprobe();

你可能不需要调用此函数。如果尝试渲染且未找到二进制文件,Remotion 将会自动下载 ffprobe

🌐 You might not need to call this function. Remotion will automatically download ffprobe if a render is attempted, and no binary was found.

如果你需要在第一次渲染开始之前准备好 ffprobe,这个函数非常有用。

🌐 This function is useful if you need ffprobe to be ready before the first render is started.

还调用 ensureFfmpeg() 来获取 Remotion 所需的两个二进制文件。

🌐 Also call ensureFfmpeg() to get both binaries that Remotion requires.

选项

🌐 Options

可选地,你可以传入一个对象并传入以下选项:

🌐 Optionally, you can pass an object and pass the following options:

remotionRoot

string

包含你的 node_modules 的目录。

🌐 The directory in which your node_modules is located.

返回值

🌐 Return value

一个返回具有以下属性的对象的承诺:

🌐 A promise which resolves an object with the following properties:

  • wasAlreadyInstalled:布尔值,表示二进制文件是否因该函数调用而被下载。
  • result:一个字符串,可以是 found-in-pathfound-in-node-modulesinstalled

例外

🌐 Exceptions

如果未找到任何二进制文件、下载失败或你的平台没有可用的二进制文件,此函数将抛出异常。

🌐 This function throws if no binary was found, the download fails or no binaries are available for your platform.

另请参阅

🌐 See also