🎥 Make videos programmatically with React
improve docs
Jonny Burgere0be976435f1
diff --git a/packages/docs/docs/cli.md b/packages/docs/docs/cli.mdindex cda2d16cc1..9659e8f585 100644--- a/packages/docs/docs/cli.md+++ b/packages/docs/docs/cli.md@@ -13,26 +13,78 @@ npx remotion render <entry-file> <composition-id> <output-location>Besides choosing a video and output location with the command line arguments, the following flags are supported:-- `--props`: React Props to pass to the root component of your video. Must be a serialized JSON string (`--props='{"hello": "world"}'`) or a path to a JSON file (`./path/to/props.json`). Inline JSON string isn't supported on Windows because it removes the `"` character, use a temporary file instead.-- `--concurrency`: [How many CPU threads to use.](/docs/config#setconcurrency) Minimum 1. The maximum is the amount of threads you have.-- `--pixel-format`: [Set a custom pixel format. See here for available values.](/docs/config#setpixelformat)-- `--image-format`: [`jpeg` or `png` - JPEG is faster, but supports transparency.](/docs/config#setimageformat) The default image format is `jpeg` since v1.1. Flag available since v1.4.-- `--config`: Specify a location for the Remotion config file. Available in v1.2 and later.-- `--env-file`: Specify a location for a dotenv file. Default `.env`. Available in v2.2 and later.-- `--quality`: [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`: [Write to output even if file already exists.](/docs/config#setoverwriteoutput)-- `--sequence`: [Pass this flag if you want an image sequence as the output instead of a video.](/docs/config#setimagesequence) Available since v1.4.-- `--codec`: [`h264` or `h265` or `png` or `vp8` or `vp9` or `mp3` or `aac` or `wav`](/docs/config#setcodec). If you don't supply `--codec`, it will use the H.264 encoder. Available since v1.4.-- `--crf`: [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`: [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.-- `--frames`: [Render a still frame or a subset of a video](/docs/config#setframerange). Example: `--frames=0-9` (To select the first 10 frames) or `--frames=50` (To render a still of the 51st frame). Available since v2.0.-- `--bundle-cache`: [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`: [Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warning`, `info` (_default_), `verbose`+### `--props`++[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`++[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`++[Set a custom pixel format. See here for available values.](/docs/config#setpixelformat)++### `--image-format`++[`jpeg` or `png` - JPEG is faster, but supports transparency.](/docs/config#setimageformat) The default image format is `jpeg` since v1.1. Flag available since v1.4.++### `--config`++Specify a location for the Remotion config file. Available in v1.2 and later.++### `--env-file`++Specify a location for a dotenv file. Default `.env`. Available in v2.2 and later.++### `--quality`++[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`++[Write to output even if file already exists.](/docs/config#setoverwriteoutput)++### `--sequence`++[Pass this flag if you want an image sequence as the output instead of a video.](/docs/config#setimagesequence) Available since v1.4.++### `--codec`++[`h264` or `h265` or `png` or `vp8` or `vp9` or `mp3` or `aac` or `wav`](/docs/config#setcodec). If you don't supply `--codec`, it will use the H.264 encoder. Available since v1.4.++### `--crf`++[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`++[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.++### `--frames`++[Render a still frame or a subset of a video](/docs/config#setframerange). Example: `--frames=0-9` (To select the first 10 frames) or `--frames=50` (To render a still of the 51st frame). Available since v2.0.++### `--bundle-cache`++[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`++[Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warning`, `info` (_default_), `verbose`:::infoIf you don't feel like passing command line flags every time, consider creating a `remotion.config.ts` [config file](/docs/config).:::+### `--help`++Print the list of available CLI commands and flags.+## Example command```diff --git a/packages/docs/docs/config.mdx b/packages/docs/docs/config.mdxindex 069b2da8eb..be202cd455 100644--- a/packages/docs/docs/config.mdx+++ b/packages/docs/docs/config.mdx@@ -41,7 +41,7 @@ Enable or disable webpack caching. Default is `true` which will make the WebpackConfig.Bundling.setCachingEnabled(false);```-The [command line flag](/docs/cli) `--bundle-cache` will take precedence over this option.+The [command line flag](/docs/cli#--bundle-cache) `--bundle-cache` will take precedence over this option.## Log@@ -61,7 +61,7 @@ Acceptable values:Config.Log.setLevel('verbose');```-The [command line flag](/docs/cli) `--log` will take precedence over this option.+The [command line flag](/docs/cli#--log) `--log` will take precedence over this option.## Puppeteer@@ -75,7 +75,7 @@ Set a custom Chrome or Chromium executable path. By default Remotion will try toConfig.Puppeteer.setBrowserExecutable('/usr/bin/google-chrome-stable')```-The [command line flag](/docs/cli) `--browser-executable` will take precedence over this option.+The [command line flag](/docs/cli#--browser-executable) `--browser-executable` will take precedence over this option.## Rendering@@ -88,7 +88,7 @@ Default: `null`, meaning **half of the threads** available on your CPU.Config.Rendering.setConcurrency(8)```-The [command line flag](/docs/cli) `--concurrency` will take precedence over this option.+The [command line flag](/docs/cli#--concurrency) `--concurrency` will take precedence over this option.:::tipTry to set your concurrency to `os.cpus().length` to all the threads available on your CPU for faster rendering. The drawback is that other parts of your system might slow down.@@ -108,7 +108,7 @@ Determines which in which image format to render the frames. Either:Config.Rendering.setImageFormat('png')```-The [command line flag](/docs/cli) `--image-format` will take precedence over this option.+The [command line flag](/docs/cli#--image-format) `--image-format` will take precedence over this option.### setFrameRange()@@ -126,6 +126,8 @@ orConfig.Rendering.setFrameRange([0, 20]); // Render a video only containing the first 21 frames```+The [command line flag](/docs/cli#--frames) `--frames` will take precedence over this option.+### setQuality()The JPEG quality of each frame. Must be a number between 0 and 100. Will not work if you render PNG frames. [Default: 80](https://github.com/chromium/chromium/blob/99314be8152e688bafbbf9a615536bdbb289ea87/headless/lib/browser/protocol/headless_handler.cc#L32).@@ -134,6 +136,8 @@ The JPEG quality of each frame. Must be a number between 0 and 100. Will not worConfig.Rendering.setQuality(90);```+The [command line flag](/docs/cli#--quality) `--quality` will take precedence over this option.+### setDotEnvLocation()Set a custom location for a [`.env`](https://www.npmjs.com/package/dotenv) file. You can specify an absolute path or a relative path in which case it gets resolved based on the current working directory.@@ -142,7 +146,7 @@ Set a custom location for a [`.env`](https://www.npmjs.com/package/dotenv) file.Config.Rendering.setDotEnvLocation('.my-env')```-The [command line flag](/docs/cli) `--env-file` will take precedence over this option.+The [command line flag](/docs/cli#--env-file) `--env-file` will take precedence over this option.## Output@@ -154,7 +158,7 @@ Set this to `false` to prevent overwriting Remotion outputs when they already exConfig.Output.setOverwriteOutput(false)```-The [command line flag](/docs/cli) `--overwrite` will take precedence over this option.+The [command line flag](/docs/cli#--overwrite) `--overwrite` will take precedence over this option.:::infoIn version 1.x, the default behavior was inverse - Remotion would not override by default.@@ -169,7 +173,7 @@ Default value: `yuv420p`Config.Output.setPixelFormat('yuv420p')```-The [command line flag](/docs/cli) `--pixel-format` will take precedence over this option.+The [command line flag](/docs/cli#--pixel-format) `--pixel-format` will take precedence over this option.### setCodec()@@ -189,6 +193,8 @@ Choose one of the supported codecs: `h264` _(default)_, `h265`, `vp8`, `vp9`.Config.Output.setCodec('h265');```+The [command line flag](/docs/cli#--codec) `--codec` will take precedence over this option.+**See also**: [Encoding guide](/docs/encoding)### setImageSequence()@@ -201,6 +207,8 @@ Set to true if you want to output an image sequence instead of a video.Config.Output.setImageSequence(true);```+The [command line flag](/docs/cli#--sequence) `--sequence` will take precedence over this option.+### ~~setOutputFormat()~~_Deprecated_. Use `setCodec()` and `setImageSequence()` instead.@@ -238,7 +246,7 @@ Choose the highest CRF value that still provides an acceptable quality. If the oConfig.Output.setCrf(16);```-The [command line flag](/docs/cli) `--crf` will take precedence over this option.+The [command line flag](/docs/cli#--crf) `--crf` will take precedence over this option.## See also