Skip to content

🎥 Make videos programmatically with React

improve help

Jonny Burger3c22d0c1b1c8
diff --git a/packages/cli/src/print-help.ts b/packages/cli/src/print-help.ts
index 31cc7bddf9..0f188ea60c 100644
--- a/packages/cli/src/print-help.ts
+++ b/packages/cli/src/print-help.ts
@@ -19,11 +19,11 @@ export const printHelp = () => {
Log.info();
Log.info('Available commands:');
Log.info('');
- Log.info('remotion preview <index-file.ts>');
+ Log.info('remotion preview <entry-point.ts>');
Log.info(chalk.gray('Start the preview server.'));
printFlags([['--props', 'Pass input props as filename or as JSON']]);
Log.info();
- Log.info('remotion render <index-file.ts> <comp-name> <output-file.mp4>');
+ Log.info('remotion render <entry-point.ts> <comp-name> <output-file.mp4>');
Log.info(chalk.gray('Render video, audio or an image sequence.'));
printFlags([
['--props', 'Pass input props as filename or as JSON'],
@@ -44,7 +44,7 @@ export const printHelp = () => {
['--env-file', 'Specify a location for a dotenv file'],
]);
Log.info();
- Log.info('remotion still <index-file.ts> <comp-name> <still.png>');
+ Log.info('remotion still <entry-point.ts> <comp-name> <still.png>');
Log.info(chalk.gray('Render a still frame and save it as an image.'));
printFlags([
['--frame', 'Which frame to render (default 0)'],
diff --git a/packages/docs/docs/cli/cli.md b/packages/docs/docs/cli/cli.md
index 07c1303aea..02800e289d 100644
--- a/packages/docs/docs/cli/cli.md
+++ b/packages/docs/docs/cli/cli.md
@@ -6,254 +6,22 @@ id: cli
import {AngleChangelog} from '../../components/AngleChangelog';
-## Commands
-
-The following commands are available - you can always run them using `npx remotion` or even without the `npx` prefix if you put the command inside an npm script.
-
-### `npx remotion preview`
-
-Start the server which allows you to preview the Remotion video. The only argument to pass is the entry file:
-
-```bash
-npx remotion preview src/index.tsx
-```
-
-### `npx remotion render`
-
-Render a video based on the entry point, the composition ID and save it to the output location.
-
-```bash
-npx remotion render <entry-file> <composition-id> <output-location>
-```
-
-### `npx remotion still`
-
-_Available from v2.3._
-
-Render a still frame basd on the entry point, the composition ID and save it to the output location.
-
-```bash
-npx remotion still <entry-file> <composition-id> <output-location>
-```
-
-### `npx remotion compositions`
-
-_Available from v2.6.12._
-
-Print list of composition ids from the index file provided separated by line break.
-
-```bash
-npx remotion compositions <entry-file>
-```
-
-### `npx remotion lambda`
-
-_Available from v3.0 and if you install `@remotion/lambda`._
-
-[**See Lambda CLI documentation**](/docs/lambda/cli)
-
-### `npx remotion versions`
-
-Prints and validates versions of all Remotion packages.
-
-### `npx remotion upgrade`
-
-Upgrade all Remotion-related dependencies to the newest version.
-
-### `npx remotion --help`
-
-Prints the list of commands and flags for quick lookup.
-
-## Flags
-
-Besides choosing a video and output location with the command line arguments, the following flags are supported:
-
-### `--props`
-
-_available for `preview`, `render`, `still`, `lambda still`, `lambda render` commands_
-
-[React Props to pass to the root component of your video.](/docs/parametrized-rendering#passing-input-props-in-the-cli) Must be a serialized JSON string (`--props='{"hello": "world"}'`) or a path to a JSON file (`./path/to/props.json`).
-
-:::info
-Inline JSON string isn't supported on Windows because it removes the `"` character, use a temporary file instead.
-:::
-
-### `--concurrency`
-
-_available for `render` command_
-
-[How many CPU threads to use.](/docs/config#setconcurrency) Minimum 1. The maximum is the amount of threads you have (In Node.JS `os.cpus().length`).
-
-### `--pixel-format`
-
-_available for `render`, `lambda render` command_
-
-[Set a custom pixel format. See here for available values.](/docs/config#setpixelformat)
-
-### `--image-format`
-
-_available for `render`, `still`, `lambda render`, `lambda still` commands_
-
-[`jpeg` or `png` - JPEG is faster, but doesn't support transparency.](/docs/config#setimageformat) The default image format is `jpeg` since v1.1. Flag available since v1.4.
-
-### `--config`
-
-_available for `preview`, `render`, `still` commands_
-
-Specify a location for the Remotion config file. Available in v1.2 and later.
-
-### `--env-file`
-
-_available for `preview`, `render`, `still` commands_
-
-Specify a location for a dotenv file. Default `.env`. Available in v2.2 and later.
-
-### `--quality`
-
-_available for `render`, `still`, `lambda render` commands_
-
-[Value between 0 and 100 for JPEG rendering quality](/docs/config#setquality). Doesn't work when PNG frames are rendered. Available since v1.4.
-
-### `--overwrite`
-
-_available for `render`, `still` commands_
-
-[Write to output even if file already exists.](/docs/config#setoverwriteoutput)
-
-### `--sequence`
-
-_available for `render` command_
+## How to use
-[Pass this flag if you want an image sequence as the output instead of a video.](/docs/config#setimagesequence) Available since v1.4.
+- You can access the CLI by running `npx remotion` inside a npm project using remotion, `yarn remotion` inside a yarn project and `pnpm exec remotion` inside a pnpm project. For compactness, in the documentation we always say `npx remotion`.
+- Inside an npm script, you don't need the `npx` prefix.
-### `--codec`
-
-_available for `render` , `lambda render` command_
-
-[`h264` or `h265` or `png` or `vp8` or `vp9` or `mp3` or `aac` or `wav` or `prores` or `h264-mkv`](/docs/config#setcodec). If you don't supply `--codec`, it will use the H.264 encoder. Available since v1.4.
-
-### `--prores-profile`
-
-_available for `render`, `lambda render` command_
-
-[Set the ProRes profile](/docs/config#setproresprofile). This option is only valid if the [`codec`](#--codec) has been set to `prores`. Possible values: `4444-xq`, `4444`, `hq`, `standard`, `light`, `proxy`. See [here](https://video.stackexchange.com/a/14715) for explanation of possible values. Default: `hq`. Available since v2.1.6.
-
-### `--crf`
-
-_available for `render`, `lambda render` command_
-
-[To set Constant Rate Factor (CRF) of the output](/docs/config#setcrf). Minimum 0. Use this rate control mode if you want to keep the best quality and care less about the file size. Available since v1.4.
-
-### `--browser-executable`
-
-_available for `still`, `render` commands_
-
-[Path to a Chrome executable](/docs/config#setbrowserexecutable). If not specified and Remotion cannot find one, it will download one during rendering. Available since v1.5.
-
-### `--scale`
-
-_available for `render`, `still` , `lambda render`, `lambda still` command._
-
-[Scales the output frames by the factor you pass in.](/docs/scaling) For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details. `scale` must be greater than 0 and less than equal to 16. Default: `1`.
-
-### `--frames`
-
-_available for `render` command_
-
-[Render a subset of a video](/docs/config#setframerange). Example: `--frames=0-9` to select the first 10 frames. To render a still, use the `still` command. Available since v2.0.
-
-### `--frame`
-
-_available for `still`, `lambda still` command_
-
-Which frame should be rendered when rendering a still. Example `--frame=10`. Default `0`. Available from v2.3
-
-### `--bundle-cache`
-
-_available for `still`, `render` commands_
-
-[Enable or disable Webpack caching](/docs/config#setcachingenabled). This flag is enabled by default, use `--bundle-cache=false` to disable caching. Available since v2.0.
-
-### `--log`
-
-_available for `preview`, `still`, `render`, `lambda still`, `lambda render` commands_
-
-[Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warn`, `info` (_default_), `verbose`
-
-:::info
-If you don't feel like passing command line flags every time, consider creating a `remotion.config.ts` [config file](/docs/config).
-:::
-
-### `--port`
-
-_available for `preview`, `still`, `render` commands_
-
-[Set a custom HTTP server port](/docs/config#setPort). If not defined, Remotion will try to find a free port.
-
-### `--ffmpeg-executable`
-
-_available for `render` command_
-
-[Set a custom `ffmpeg` executable](/docs/config#setFfmpegExecutable). If not defined, a `ffmpeg` executable will be searched in `PATH`.
-
-### `--ffprobe-executable`
-
-_available for `render` command, available from v3.0.17_
-
-[Set a custom `ffprobe` executable](/docs/config#setFfprobeExecutable). If not defined, a `ffprobe` executable will be searched in `PATH`.
-
-### `--timeout`
-
-_available for `still`, `render`, `lambda still`, `lambda render` command_
-
-Define how long a single frame may take to resolve all [`delayRender()`](/docs/delay-render) calls before it times out in milliseconds. Default: `30000`.
-
-:::info
-Not to be confused with the [`--timeout` flag when deploying a Lambda function](/docs/lambda/cli/functions#--timeout).
-
-:::
-
-### `--ignore-certificate-errors`
-
-_available for `still`, `render`, `lambda still`, `lambda render` command_
-
-Results in invalid SSL certificates in Chrome, such as self-signed ones, being ignored. Available since v2.6.5.
-
-### `--disable-web-security`
-
-_available for `still`, `render`, `lambda still`, `lambda render` command_
-
-This will most notably disable CORS in Chrome among other security features.
-Available since v2.6.5.
-
-### `--disable-headless`
-
-_available for `still`, `render` command_
-
-Opens an actual browser during rendering to observe the render.
-Available since v2.6.5.
-
-### `--gl`
-
-_available for `still`, `render`, `lambda still`, `lambda render` command_
-
-<AngleChangelog />
-
-Select the OpenGL renderer backend for Chromium.
-Accepted values:
-
-- `"angle"`,
-- `"egl"`,
-- `"swiftshader"`
-- `"swangle"`
-- `null` - Chromiums default
-
-**Default for local rendering**: `null`.
-**Default for Lambda rendering**: `"swangle"`.
+## Commands
-### `--help`
+The following commands are available - you can always run them using `npx remotion` or even without the `npx` prefix if you put the command inside an npm script.
-Print the list of available CLI commands and flags.
+- [`npx remotion preview`](/docs/cli/preview)
+- [`npx remotion render`](/docs/cli/render)
+- [`npx remotion still`](/docs/cli/still)
+- [`npx remotion compositions`](/docs/cli/compositions)
+- [`npx remotion upgrade`](/docs/cli/upgrade)
+- [`npx remotion versions`](/docs/cli/versions)
+- [`npx remotion lambda`](/docs/lambda/cli)
## Example command
diff --git a/packages/docs/docs/cli/help.md b/packages/docs/docs/cli/help.md
new file mode 100644
index 0000000000..f5d99fdf5f
--- /dev/null
+++ b/packages/docs/docs/cli/help.md
@@ -0,0 +1,10 @@
+---
+title: npx remotion help
+sidebar_label: help
+---
+
+Prints available commands and flags for the Remotion CLI.
+
+```
+npx remotion help
+```
diff --git a/packages/docs/docs/cli/render.md b/packages/docs/docs/cli/render.md
index cc54df99f3..5879b377fe 100644
--- a/packages/docs/docs/cli/render.md
+++ b/packages/docs/docs/cli/render.md
@@ -5,7 +5,7 @@ sidebar_label: render
import {AngleChangelog} from '../../components/AngleChangelog';
-Render a video based on the entry point, the composition ID and save it to the output location.
+Render a video or audio based on the entry point, the composition ID and save it to the output location.
```bash
npx remotion render <entry-file> <composition-id> <output-location>
@@ -49,7 +49,7 @@ Specify a location for a dotenv file. Default `.env`. Available in v2.2 and late
### `--overwrite`
-[Write to output even if file already exists.](/docs/config#setoverwriteoutput)
+[Write to output even if file already exists.](/docs/config#setoverwriteoutput). This flag is enabled by default, use `--overwrite=false` to disable it.
### `--sequence`
diff --git a/packages/docs/docs/config.md b/packages/docs/docs/config.md
index 4c3a030c9d..f50f5d541e 100644
--- a/packages/docs/docs/config.md
+++ b/packages/docs/docs/config.md
@@ -5,7 +5,11 @@ title: Configuration file
To configure Remotion, create a `remotion.config.ts` file in the root of your Remotion project.
-These options will apply to CLI commands such as `npm start` and `npm run build`, but have no effect in the Node.JS API.
+These options will apply to CLI commands such as `npm start` and `npm run build`.
+
+:::warning
+The configuration file has no effect when using [SSR](/docs/renderer) APIs.
+:::warn
You can control several behaviors of Remotion here.
diff --git a/packages/docs/docs/lambda/cli.md b/packages/docs/docs/lambda/cli.md
index 276a8578f3..e769f77333 100644
--- a/packages/docs/docs/lambda/cli.md
+++ b/packages/docs/docs/lambda/cli.md
@@ -5,6 +5,8 @@ title: "@remotion/lambda - CLI"
slug: /lambda/cli
---
+To use the Remotion Lambda CLI, you first need to [install it](/docs/lambda/setup).
+
## Commands
- [sites](/docs/lambda/cli/sites)
diff --git a/packages/docs/docs/lambda/setup.md b/packages/docs/docs/lambda/setup.md
index cea4b0868a..e395fc2082 100644
--- a/packages/docs/docs/lambda/setup.md
+++ b/packages/docs/docs/lambda/setup.md
@@ -9,8 +9,6 @@ import TabItem from '@theme/TabItem';
## 1. Install `@remotion/lambda`
-Check the newest version number in the [#lambda Discord channel](https://discord.gg/PzjkKS8S5S)
-
<Tabs
defaultValue="npm"
values={[
@@ -59,10 +57,6 @@ Your package.json should look like the following:
"remotion": "3.0.0",
```
-:::note
-You can install `@remotion/lambda` in any Node.JS project to trigger a render, but remember to also install `react` and `react-dom` as they are peer dependencies.
-:::
-
## 2. Create role policy
- Go to [AWS account IAM Policies section](https://console.aws.amazon.com/iamv2/home?#/policies)
diff --git a/packages/docs/docs/renderer.md b/packages/docs/docs/renderer.md
index 5449d806fd..d6310e8a6e 100644
--- a/packages/docs/docs/renderer.md
+++ b/packages/docs/docs/renderer.md
@@ -10,6 +10,10 @@ import TabItem from '@theme/TabItem';
The `@remotion/renderer` package provides APIs for rendering video server-side.
The package is also internally used by the Remotion CLI and [Remotion Lambda](/docs/lambda).
+:::warning
+The configuration file has no effect when using these APIs.
+:::warn
+
## Installation
<Tabs
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 09be30103f..2fd9781f2a 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -123,14 +123,15 @@ module.exports = {
"cli/preview",
"cli/render",
"cli/still",
+ "cli/compositions",
{
type: "link",
href: "/docs/lambda/cli",
label: "lambda ↗️",
},
- "cli/compositions",
"cli/versions",
"cli/upgrade",
+ "cli/help",
],
},
"config",