Skip to content

🎥 Make videos programmatically with React

rename setRange to setRangeFrame

Jonny Burger96f870f65cd8
diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.ts
index c2bd6a6978..f757fb500c 100644
--- a/packages/cli/src/parse-command-line.ts
+++ b/packages/cli/src/parse-command-line.ts
@@ -40,7 +40,7 @@ export const parseCommandLine = () => {
Config.Rendering.setConcurrency(parsedCli.concurrency);
}
if (parsedCli.frames) {
- Config.Rendering.setRange(parsedCli.frames);
+ Config.Rendering.setFrameRange(parsedCli.frames);
}
if (parsedCli.png) {
console.warn(
diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts
index c3e38103ae..a10a955959 100644
--- a/packages/core/src/config/index.ts
+++ b/packages/core/src/config/index.ts
@@ -13,7 +13,7 @@ import {
import {setOverwriteOutput} from './overwrite';
import {PixelFormat, setPixelFormat} from './pixel-format';
import {setQuality} from './quality';
-import {FrameRange, setRange} from './range';
+import {FrameRange, setFrameRange} from './range';
export const Config = {
Bundling: {
@@ -48,7 +48,7 @@ export const Config = {
* PNG is slower, but supports transparency.
*/
setImageFormat,
- setRange,
+ setFrameRange,
},
Output: {
/**
diff --git a/packages/core/src/config/range.ts b/packages/core/src/config/range.ts
index 2248770cf9..dfcae22085 100644
--- a/packages/core/src/config/range.ts
+++ b/packages/core/src/config/range.ts
@@ -2,7 +2,7 @@ export type FrameRange = number | [number, number] | null;
let range: FrameRange = null;
-export const setRange = (newFrameRange: string | number) => {
+export const setFrameRange = (newFrameRange: string | number) => {
if (typeof newFrameRange === 'number') {
range = newFrameRange;
return;
diff --git a/packages/docs/docs/cli.md b/packages/docs/docs/cli.md
index 1c4c326e64..fe0573164e 100644
--- a/packages/docs/docs/cli.md
+++ b/packages/docs/docs/cli.md
@@ -24,7 +24,7 @@ Besides choosing a video and output location with the command line arguments, th
- `--codec`: [`h264` or `h265` or `png` or `vp8` or `vp9`](config#setoutputformat). 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](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](config#setbrowserexecutable). If not specified and Remotion cannot find one, it will download one during rendering. Available since v1.5.
-- `--frames`: [To select frame range](config#setrange).`--frames=1-10` (To select frame from 1 to 10) or <br/>`--frames=50` (To select only 50th frame).
+- `--frames`: [To select frame range](config#setframerange).`--frames=1-10` (To select frame from 1 to 10) or <br/>`--frames=50` (To select only 50th frame).
:::info
If you don't feel like passing command line flags every time, consider creating a `remotion.config.ts` [config file](/docs/config).
diff --git a/packages/docs/docs/config.md b/packages/docs/docs/config.md
index 7b844f1999..2514e0d8e1 100644
--- a/packages/docs/docs/config.md
+++ b/packages/docs/docs/config.md
@@ -70,17 +70,18 @@ Config.Rendering.setImageFormat('png')
The [command line flag](/docs/cli) `--image-format` will take precedence over this option.
-### setRange()
+### setFrameRange()
To render a still frame or a range of frames. Which can be helpful to generate humbnails and stills.
```tsx
-Config.Rendering.setRange(90); //to select only 90th frame
+Config.Rendering.setFrameRange(90); //to select only 90th frame
```
+
or
```tsx
-Config.Rendering.setRange('10-20'); //To select frames from 10 to 20
+Config.Rendering.setFrameRange('10-20'); //To select frames from 10 to 20
```
### setQuality()