Skip to content

🎥 Make videos programmatically with React

stills documentation

Jonny Burgeraa823414a1ff
diff --git a/packages/cli/src/index.tsx b/packages/cli/src/index.tsx
index e42b82716b..70f82c93bf 100644
--- a/packages/cli/src/index.tsx
+++ b/packages/cli/src/index.tsx
@@ -27,6 +27,9 @@ export const cli = async () => {
await still();
} else if (command === 'upgrade') {
await upgrade();
+ } else if (command === 'help') {
+ printHelp();
+ process.exit(0);
} else {
Log.error(`Command ${command} not found.`);
printHelp();
diff --git a/packages/docs/docs/cli.md b/packages/docs/docs/cli.md
index 55be0a5c86..17ea96a17f 100644
--- a/packages/docs/docs/cli.md
+++ b/packages/docs/docs/cli.md
@@ -1,20 +1,55 @@
---
-title: CLI options
+title: Command line reference
+sidebar_label: CLI reference
id: cli
---
-The default command in package.json that powers `npm run build` is:
+## 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 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` 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
@@ -23,62 +58,98 @@ Inline JSON string isn't supported on Windows because it removes the `"` charact
### `--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` command_
+
[Set a custom pixel format. See here for available values.](/docs/config#setpixelformat)
### `--image-format`
+_available for `render`, `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` 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_
+
[Pass this flag if you want an image sequence as the output instead of a video.](/docs/config#setimagesequence) Available since v1.4.
### `--codec`
+_available for `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` 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` 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.
### `--frames`
+_available for `render` command_
+
[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.
+### `--frame`
+
+_available for `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` commands_
+
[Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warning`, `info` (_default_), `verbose`
:::info
@@ -87,6 +158,8 @@ If you don't feel like passing command line flags every time, consider creating
### `--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.
### `--help`
diff --git a/packages/docs/docs/render.md b/packages/docs/docs/render.md
index 9ad84954a8..223dd8ad0e 100644
--- a/packages/docs/docs/render.md
+++ b/packages/docs/docs/render.md
@@ -18,14 +18,32 @@ npx remotion render src/index.tsx HelloWorld out.mp4
Modify it to select a different video to render, or change its output location.
Learn about all the options on the [CLI reference page](/docs/cli).
-## More ways to render a video
+## More ways to render
+
+### SSR
Remotion has a full-featured server-side rendering API. Read more about it on the [server-side rendering API](/docs/ssr).
+### Github Actions
+
You can also render a [video using a Github Action.](/docs/ssr#render-using-github-actions)
+### Serverless
+
We are also working on a Serverless solution for rendering videos, [which is in private beta](/docs/ssr#rendering-a-video-using-serverless).
+### Only audio
+
+Instead of rendering a video, [you can also just export the audio.](/docs/encoding#audio-only-export)
+
+### Image Sequence
+
+Instead of encoding as a video, you can use the [`--sequence`](/docs/cli#--sequence) command to output a series of image.
+
+### Still images
+
+If you want a single image, you can do so using [the CLI or Node.JS API](/docs/stills).
+
## See also
- [CLI options](/docs/cli)
diff --git a/packages/docs/docs/ssr.md b/packages/docs/docs/ssr.md
index c4ac1ca4ff..3b2470fd34 100644
--- a/packages/docs/docs/ssr.md
+++ b/packages/docs/docs/ssr.md
@@ -157,7 +157,7 @@ Note that running the workflow may incur costs. However, the workflow will only
## Rendering a video using serverless
-We are working on a library which will help you render videos using AWS Lambda. Contact us if you are interested in testing an early version.
+We are working on a library which will help you render videos using AWS Lambda. Contact us if you are interested in testing an early version or read the `#lambda` channel on our Discord server.
## API reference
diff --git a/packages/docs/docs/stills.md b/packages/docs/docs/stills.md
new file mode 100644
index 0000000000..43a1643c3a
--- /dev/null
+++ b/packages/docs/docs/stills.md
@@ -0,0 +1,28 @@
+---
+id: stills
+title: Still images
+---
+
+_Available from v2.3_
+
+Remotion is a great solution for rendering dynamic still images too.
+
+## Rendering via CLI
+
+You can use the [`npx remotion still`](/docs/cli/#npx-remotion-still) command to render a still image. Example command:
+
+```bash
+npx remotion still --props='{"custom": "data"}' src/index.tsx my-comp out.png
+```
+
+You can use the `--image-format` flag to determine the output format. The default format is `png`, with `jpeg` being the other option.
+
+By default the frame with number of a composition is being rendered, you can control it using the `--frame` flag.
+
+## Rendering using Node.JS
+
+You can use the [`renderStill()`](/docs/render-still) Node.JS API to render a still frame programmatically.
+
+## Rendering using serverless
+
+[AWS Lambda integration is a work in progress.](/docs/ssr/#rendering-a-video-using-serverless)
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index fb0483a035..633fe89ccd 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -35,6 +35,7 @@ module.exports = {
"legacy-babel",
"env-variables",
"third-party",
+ "stills",
],
},
"cli",