Skip to content

🎥 Make videos programmatically with React

implement frame range and write some TODOs on option resolution

Jonny Burgerd929e3a44522
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.ts
index e34f187496..88346739d3 100644
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@ -253,6 +253,7 @@ export const benchmarkCommand = async (
remotionRoot,
uiCrf: null,
uiImageFormat: null,
+ uiFrameRange: null,
});
const concurrency = getValidConcurrency(renderMediaOptions);
diff --git a/packages/cli/src/get-render-media-options.ts b/packages/cli/src/get-render-media-options.ts
index 393ee20575..e67c06c7f5 100644
--- a/packages/cli/src/get-render-media-options.ts
+++ b/packages/cli/src/get-render-media-options.ts
@@ -1,4 +1,4 @@
-import type {Codec, RenderMediaOptions} from '@remotion/renderer';
+import type {Codec, FrameRange, RenderMediaOptions} from '@remotion/renderer';
import {RenderInternals} from '@remotion/renderer';
import {ConfigInternals} from './config';
import {getCliOptions} from './get-cli-options';
@@ -12,6 +12,7 @@ export const getRenderMediaOptions = async ({
remotionRoot,
uiImageFormat,
uiCrf,
+ uiFrameRange,
}: {
outputLocation: RenderMediaOptions['outputLocation'];
config: RenderMediaOptions['composition'];
@@ -20,11 +21,14 @@ export const getRenderMediaOptions = async ({
remotionRoot: string;
uiImageFormat: 'png' | 'jpeg' | 'none' | null;
uiCrf: number | null;
+ uiFrameRange: FrameRange | null;
}): Promise<RenderMediaOptions> => {
+ // TODO: Lots of these options can have difference defaults
+ // TODO: Scale option for example is not being applied
const {
proResProfile,
concurrency,
- frameRange,
+ frameRange: defaultFrameRange,
overwrite,
inputProps,
envVariables,
@@ -70,7 +74,7 @@ export const getRenderMediaOptions = async ({
envVariables,
ffmpegExecutable,
ffprobeExecutable,
- frameRange,
+ frameRange: uiFrameRange ?? defaultFrameRange,
imageFormat,
inputProps,
overwrite,
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index b7028f490a..5f32798cfd 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -384,6 +384,7 @@ export const renderCompFlow = async ({
remotionRoot,
uiImageFormat,
uiCrf,
+ uiFrameRange: frameRange,
});
await renderMedia({