ensureFfmpeg()
Available from v3.3
Checks if the ffmpeg
binary is installed and if it is not, downloads it and puts it into your node_modules
folder.
ensure.mjsts
import {ensureFfmpeg } from "@remotion/renderer";awaitensureFfmpeg ();
ensure.mjsts
import {ensureFfmpeg } from "@remotion/renderer";awaitensureFfmpeg ();
You might not need to call this function. Remotion will automatically download ffmpeg
if a render is attempted, and no binary was found.
This function is useful if you need FFmpeg to be ready before the first render is started.
Also call ensureFfprobe()
to get both binaries that Remotion requires.
Options
Optionally, you can pass an object and pass the following options:
remotionRoot
string
The directory in which your node_modules
is located.
Return value
A promise which resolves an object with the following properties:
wasAlreadyInstalled
: Boolean whether the binary was downloaded because of this function call.result
: A string, eitherfound-in-path
,found-in-node-modules
orinstalled
.
Exceptions
This function throws if no binary was found, the download fails or no binaries are available for your platform.
See also
- CLI equivalent:
npx remotion install ffmpeg
ensureFfprobe()
- Installing FFmpeg