@remotion/cli 4.0.77 → 4.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/benchmark.js +3 -1
- package/dist/cloudrun-command.js +3 -4
- package/dist/config/bitrate.d.ts +4 -0
- package/dist/config/bitrate.js +22 -1
- package/dist/config/image-format.d.ts +1 -1
- package/dist/config/index.d.ts +12 -2
- package/dist/config/index.js +7 -4
- package/dist/download-progress.d.ts +1 -1
- package/dist/download-progress.js +2 -2
- package/dist/editor/components/Modals.js +1 -1
- package/dist/editor/components/RenderButton.js +3 -0
- package/dist/editor/components/RenderModal/CrfSetting.d.ts +3 -2
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.d.ts +0 -2
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +3 -4
- package/dist/editor/components/RenderModal/JpegQualitySetting.js +1 -2
- package/dist/editor/components/RenderModal/MutedSetting.d.ts +0 -2
- package/dist/editor/components/RenderModal/MutedSetting.js +3 -4
- package/dist/editor/components/RenderModal/NumberSetting.d.ts +2 -2
- package/dist/editor/components/RenderModal/NumberSetting.js +2 -3
- package/dist/editor/components/RenderModal/OptionExplainerBubble.d.ts +5 -0
- package/dist/editor/components/RenderModal/OptionExplainerBubble.js +12 -0
- package/dist/editor/components/RenderModal/RenderModal.d.ts +3 -0
- package/dist/editor/components/RenderModal/RenderModal.js +15 -4
- package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +2 -0
- package/dist/editor/components/RenderModal/RenderModalAdvanced.js +19 -5
- package/dist/editor/components/RenderModal/RenderModalAudio.js +4 -4
- package/dist/editor/components/RenderModal/RenderModalBasic.js +2 -3
- package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +4 -0
- package/dist/editor/components/RenderModal/RenderModalPicture.js +19 -5
- package/dist/editor/components/RenderModal/ScaleSetting.js +1 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +1 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +19 -4
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSeparationLine.d.ts +8 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +70 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaVerticalGuide.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +23 -5
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +12 -22
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +6 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +13 -5
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/editor/components/RenderModal/layout.d.ts +1 -0
- package/dist/editor/components/RenderModal/layout.js +6 -3
- package/dist/editor/components/RenderQueue/actions.d.ts +3 -1
- package/dist/editor/components/RenderQueue/actions.js +3 -1
- package/dist/editor/components/SidebarRenderButton.js +3 -0
- package/dist/editor/helpers/colors.d.ts +1 -0
- package/dist/editor/helpers/colors.js +2 -1
- package/dist/editor/helpers/render-modal-sections.d.ts +0 -1
- package/dist/editor/state/modals.d.ts +3 -0
- package/dist/get-cli-options.d.ts +4 -2
- package/dist/get-cli-options.js +4 -0
- package/dist/get-composition-id.js +2 -2
- package/dist/get-env.js +2 -2
- package/dist/get-render-defaults.d.ts +2 -0
- package/dist/get-render-defaults.js +71 -0
- package/dist/index.d.ts +13 -9
- package/dist/index.js +4 -4
- package/dist/lambda-command.js +3 -4
- package/dist/list-of-remotion-packages.js +1 -0
- package/dist/make-on-download.d.ts +1 -1
- package/dist/make-on-download.js +4 -2
- package/dist/parse-command-line.d.ts +6 -2
- package/dist/parse-command-line.js +6 -0
- package/dist/preview-server/render-queue/job.d.ts +4 -0
- package/dist/preview-server/render-queue/make-retry-payload.js +9 -0
- package/dist/preview-server/render-queue/process-video.js +2 -0
- package/dist/preview-server/routes/add-render.js +2 -0
- package/dist/preview-server/routes.d.ts +0 -1
- package/dist/preview-server/routes.js +6 -0
- package/dist/progress-bar.d.ts +1 -9
- package/dist/progress-bar.js +3 -4
- package/dist/progress-types.d.ts +1 -31
- package/dist/render-flows/render.d.ts +4 -2
- package/dist/render-flows/render.js +3 -1
- package/dist/render-flows/still.d.ts +1 -1
- package/dist/render-queue/process-still.d.ts +8 -0
- package/dist/render-queue/process-still.js +49 -0
- package/dist/render-queue/process-video.d.ts +10 -0
- package/dist/render-queue/process-video.js +70 -0
- package/dist/render-queue/queue.d.ts +11 -0
- package/dist/render-queue/queue.js +220 -0
- package/dist/render.js +3 -1
- package/dist/setup-cache.d.ts +1 -1
- package/dist/studio.js +30 -102
- package/dist/upgrade.js +4 -5
- package/dist/user-passed-output-location.js +2 -2
- package/package.json +10 -14
- package/styles/styles.css +0 -123
- package/types/global.d.ts +0 -4
- package/web/favicon.png +0 -0
|
@@ -67,6 +67,8 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
|
|
|
67
67
|
const x264Preset = (_b = config_1.ConfigInternals.getPresetProfile()) !== null && _b !== void 0 ? _b : 'medium';
|
|
68
68
|
const audioBitrate = config_1.ConfigInternals.getAudioBitrate();
|
|
69
69
|
const videoBitrate = config_1.ConfigInternals.getVideoBitrate();
|
|
70
|
+
const encodingBufferSize = config_1.ConfigInternals.getEncodingBufferSize();
|
|
71
|
+
const encodingMaxRate = config_1.ConfigInternals.getEncodingMaxRate();
|
|
70
72
|
const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
|
|
71
73
|
const numberOfGifLoops = config_1.ConfigInternals.getNumberOfGifLoops();
|
|
72
74
|
const delayRenderTimeout = config_1.ConfigInternals.getCurrentPuppeteerTimeout();
|
|
@@ -79,6 +81,7 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
|
|
|
79
81
|
const openGlRenderer = config_1.ConfigInternals.getChromiumOpenGlRenderer();
|
|
80
82
|
const offthreadVideoCacheSizeInBytes = config_1.ConfigInternals.getOffthreadVideoCacheSizeInBytes();
|
|
81
83
|
const colorSpace = config_1.ConfigInternals.getColorSpace();
|
|
84
|
+
const userAgent = config_1.ConfigInternals.getChromiumUserAgent();
|
|
82
85
|
const maxConcurrency = renderer_1.RenderInternals.getMaxConcurrency();
|
|
83
86
|
const minConcurrency = renderer_1.RenderInternals.getMinConcurrency();
|
|
84
87
|
const multiProcessOnLinux = config_1.ConfigInternals.getChromiumMultiProcessOnLinux();
|
|
@@ -116,6 +119,8 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
|
|
|
116
119
|
pixelFormat,
|
|
117
120
|
audioBitrate,
|
|
118
121
|
videoBitrate,
|
|
122
|
+
encodingBufferSize,
|
|
123
|
+
encodingMaxRate,
|
|
119
124
|
everyNthFrame,
|
|
120
125
|
numberOfGifLoops,
|
|
121
126
|
delayRenderTimeout,
|
|
@@ -127,6 +132,7 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
|
|
|
127
132
|
offthreadVideoCacheSizeInBytes,
|
|
128
133
|
colorSpace,
|
|
129
134
|
multiProcessOnLinux,
|
|
135
|
+
userAgent,
|
|
130
136
|
},
|
|
131
137
|
publicFolderExists: (0, node_fs_1.existsSync)(publicDir) ? publicDir : null,
|
|
132
138
|
}));
|
package/dist/progress-bar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CancelSignal } from '@remotion/renderer';
|
|
2
|
-
import type { AggregateRenderProgress } from '
|
|
2
|
+
import type { AggregateRenderProgress, BundlingState, CopyingState } from '@remotion/studio';
|
|
3
3
|
export type OverwriteableCliOutput = {
|
|
4
4
|
update: (up: string, newline: boolean) => boolean;
|
|
5
5
|
};
|
|
@@ -9,14 +9,6 @@ export declare const createOverwriteableCliOutput: (options: {
|
|
|
9
9
|
updatesDontOverwrite: boolean;
|
|
10
10
|
indent: boolean;
|
|
11
11
|
}) => OverwriteableCliOutput;
|
|
12
|
-
export type CopyingState = {
|
|
13
|
-
bytes: number;
|
|
14
|
-
doneIn: number | null;
|
|
15
|
-
};
|
|
16
|
-
export type BundlingState = {
|
|
17
|
-
progress: number;
|
|
18
|
-
doneIn: number | null;
|
|
19
|
-
};
|
|
20
12
|
export type SymbolicLinksState = {
|
|
21
13
|
symlinks: string[];
|
|
22
14
|
};
|
package/dist/progress-bar.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeRenderingAndStitchingProgress = exports.makeBundlingAndCopyProgress = exports.createOverwriteableCliOutput = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const
|
|
5
|
+
const studio_1 = require("@remotion/studio");
|
|
6
6
|
const chalk_1 = require("./chalk");
|
|
7
7
|
const download_progress_1 = require("./download-progress");
|
|
8
|
-
const format_bytes_1 = require("./format-bytes");
|
|
9
8
|
const make_progress_bar_1 = require("./make-progress-bar");
|
|
10
9
|
const truthy_1 = require("./truthy");
|
|
11
10
|
const createOverwriteableCliOutput = (options) => {
|
|
@@ -34,7 +33,7 @@ const createOverwriteableCliOutput = (options) => {
|
|
|
34
33
|
},
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
const diff = new
|
|
36
|
+
const diff = new studio_1.StudioInternals.AnsiDiff();
|
|
38
37
|
(_a = options.cancelSignal) === null || _a === void 0 ? void 0 : _a.call(options, () => {
|
|
39
38
|
process.stdout.write(diff.finish());
|
|
40
39
|
});
|
|
@@ -173,7 +172,7 @@ const getGuiProgressSubtitle = (progress) => {
|
|
|
173
172
|
return `Bundling ${Math.round(progress.bundling.progress * 100)}%`;
|
|
174
173
|
}
|
|
175
174
|
if (progress.copyingState.doneIn === null) {
|
|
176
|
-
return `Copying public dir ${
|
|
175
|
+
return `Copying public dir ${studio_1.StudioInternals.formatBytes(progress.copyingState.bytes)}`;
|
|
177
176
|
}
|
|
178
177
|
if (!progress.rendering) {
|
|
179
178
|
return `Getting compositions`;
|
package/dist/progress-types.d.ts
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { BundlingState, CopyingState } from './progress-bar';
|
|
3
|
-
import type { RenderStep } from './step';
|
|
4
|
-
export type DownloadProgress = {
|
|
5
|
-
name: string;
|
|
6
|
-
id: number;
|
|
7
|
-
progress: number | null;
|
|
8
|
-
totalBytes: number | null;
|
|
9
|
-
downloaded: number;
|
|
10
|
-
};
|
|
11
|
-
export type RenderingProgressInput = {
|
|
12
|
-
frames: number;
|
|
13
|
-
totalFrames: number;
|
|
14
|
-
steps: RenderStep[];
|
|
15
|
-
concurrency: number;
|
|
16
|
-
doneIn: number | null;
|
|
17
|
-
};
|
|
18
|
-
export type StitchingProgressInput = {
|
|
19
|
-
frames: number;
|
|
20
|
-
totalFrames: number;
|
|
21
|
-
doneIn: number | null;
|
|
22
|
-
stage: StitchingState;
|
|
23
|
-
codec: Codec;
|
|
24
|
-
};
|
|
25
|
-
export type AggregateRenderProgress = {
|
|
26
|
-
rendering: RenderingProgressInput | null;
|
|
27
|
-
stitching: StitchingProgressInput | null;
|
|
28
|
-
downloads: DownloadProgress[];
|
|
29
|
-
bundling: BundlingState;
|
|
30
|
-
copyingState: CopyingState;
|
|
31
|
-
};
|
|
1
|
+
import type { AggregateRenderProgress } from '@remotion/studio';
|
|
32
2
|
export declare const initialAggregateRenderProgress: () => AggregateRenderProgress;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AudioCodec, Browser, BrowserExecutable, CancelSignal, ChromiumOptions, Codec, ColorSpace, Crf, FfmpegOverrideFn, FrameRange, LogLevel, PixelFormat, ProResProfile, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
|
+
import type { JobProgressCallback } from '@remotion/studio';
|
|
2
3
|
import type { Loop } from '../config/number-of-gif-loops';
|
|
3
|
-
|
|
4
|
-
export declare const renderVideoFlow: ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, numberOfGifLoops, audioCodec, serializedInputPropsWithCustomSchema, disallowParallelEncoding, offthreadVideoCacheSizeInBytes, colorSpace, }: {
|
|
4
|
+
export declare const renderVideoFlow: ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, encodingMaxRate, encodingBufferSize, numberOfGifLoops, audioCodec, serializedInputPropsWithCustomSchema, disallowParallelEncoding, offthreadVideoCacheSizeInBytes, colorSpace, }: {
|
|
5
5
|
remotionRoot: string;
|
|
6
6
|
fullEntryPoint: string;
|
|
7
7
|
entryPointReason: string;
|
|
@@ -37,6 +37,8 @@ export declare const renderVideoFlow: ({ remotionRoot, fullEntryPoint, indent, l
|
|
|
37
37
|
ffmpegOverride: FfmpegOverrideFn;
|
|
38
38
|
audioBitrate: string | null;
|
|
39
39
|
videoBitrate: string | null;
|
|
40
|
+
encodingMaxRate: string | null;
|
|
41
|
+
encodingBufferSize: string | null;
|
|
40
42
|
muted: boolean;
|
|
41
43
|
enforceAudioTrack: boolean;
|
|
42
44
|
proResProfile: ProResProfile | undefined;
|
|
@@ -47,7 +47,7 @@ const setup_cache_1 = require("../setup-cache");
|
|
|
47
47
|
const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
|
|
48
48
|
const truthy_1 = require("../truthy");
|
|
49
49
|
const user_passed_output_location_1 = require("../user-passed-output-location");
|
|
50
|
-
const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, numberOfGifLoops, audioCodec, serializedInputPropsWithCustomSchema, disallowParallelEncoding, offthreadVideoCacheSizeInBytes, colorSpace, }) => {
|
|
50
|
+
const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, encodingMaxRate, encodingBufferSize, numberOfGifLoops, audioCodec, serializedInputPropsWithCustomSchema, disallowParallelEncoding, offthreadVideoCacheSizeInBytes, colorSpace, }) => {
|
|
51
51
|
var _a;
|
|
52
52
|
const downloads = [];
|
|
53
53
|
const browserInstance = renderer_1.RenderInternals.internalOpenBrowser({
|
|
@@ -294,6 +294,8 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
|
|
|
294
294
|
codec,
|
|
295
295
|
audioBitrate,
|
|
296
296
|
videoBitrate,
|
|
297
|
+
encodingMaxRate,
|
|
298
|
+
encodingBufferSize,
|
|
297
299
|
onProgress: (update) => {
|
|
298
300
|
stitchingProgress.doneIn =
|
|
299
301
|
update.encodedDoneIn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Browser, BrowserExecutable, CancelSignal, ChromiumOptions, LogLevel, StillImageFormat } from '@remotion/renderer';
|
|
2
|
-
import type { JobProgressCallback } from '
|
|
2
|
+
import type { JobProgressCallback } from '@remotion/studio';
|
|
3
3
|
export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indent, addCleanupCallback, cancelSignal, outputLocationFromUi, offthreadVideoCacheSizeInBytes, }: {
|
|
4
4
|
remotionRoot: string;
|
|
5
5
|
fullEntryPoint: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JobProgressCallback, RenderJob } from '@remotion/studio';
|
|
2
|
+
export declare const processStill: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }: {
|
|
3
|
+
job: RenderJob;
|
|
4
|
+
remotionRoot: string;
|
|
5
|
+
entryPoint: string;
|
|
6
|
+
onProgress: JobProgressCallback;
|
|
7
|
+
addCleanupCallback: (cb: () => void) => void;
|
|
8
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processStill = void 0;
|
|
4
|
+
const preview_server_1 = require("../config/preview-server");
|
|
5
|
+
const convert_entry_point_to_serve_url_1 = require("../convert-entry-point-to-serve-url");
|
|
6
|
+
const get_cli_options_1 = require("../get-cli-options");
|
|
7
|
+
const still_1 = require("../render-flows/still");
|
|
8
|
+
const processStill = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }) => {
|
|
9
|
+
if (job.type !== 'still') {
|
|
10
|
+
throw new Error('Expected still job');
|
|
11
|
+
}
|
|
12
|
+
const { publicDir, browserExecutable, browser, puppeteerTimeout } = await (0, get_cli_options_1.getCliOptions)({
|
|
13
|
+
isLambda: false,
|
|
14
|
+
type: 'still',
|
|
15
|
+
remotionRoot,
|
|
16
|
+
logLevel: job.logLevel,
|
|
17
|
+
});
|
|
18
|
+
const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(entryPoint);
|
|
19
|
+
await (0, still_1.renderStillFlow)({
|
|
20
|
+
remotionRoot,
|
|
21
|
+
browser,
|
|
22
|
+
browserExecutable,
|
|
23
|
+
chromiumOptions: job.chromiumOptions,
|
|
24
|
+
entryPointReason: 'same as Studio',
|
|
25
|
+
envVariables: job.envVariables,
|
|
26
|
+
height: null,
|
|
27
|
+
fullEntryPoint,
|
|
28
|
+
serializedInputPropsWithCustomSchema: job.serializedInputPropsWithCustomSchema,
|
|
29
|
+
overwrite: true,
|
|
30
|
+
port: (0, preview_server_1.getRendererPortFromConfigFile)(),
|
|
31
|
+
publicDir,
|
|
32
|
+
puppeteerTimeout,
|
|
33
|
+
jpegQuality: job.jpegQuality,
|
|
34
|
+
remainingArgs: [],
|
|
35
|
+
scale: job.scale,
|
|
36
|
+
stillFrame: job.frame,
|
|
37
|
+
width: null,
|
|
38
|
+
compositionIdFromUi: job.compositionId,
|
|
39
|
+
imageFormatFromUi: job.imageFormat,
|
|
40
|
+
logLevel: job.logLevel,
|
|
41
|
+
onProgress,
|
|
42
|
+
indent: true,
|
|
43
|
+
addCleanupCallback,
|
|
44
|
+
cancelSignal: job.cancelToken.cancelSignal,
|
|
45
|
+
outputLocationFromUi: job.outName,
|
|
46
|
+
offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.processStill = processStill;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { JobProgressCallback, RenderJob } from '@remotion/studio';
|
|
3
|
+
export declare const processVideoJob: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, logLevel, }: {
|
|
4
|
+
job: RenderJob;
|
|
5
|
+
remotionRoot: string;
|
|
6
|
+
entryPoint: string;
|
|
7
|
+
onProgress: JobProgressCallback;
|
|
8
|
+
addCleanupCallback: (cb: () => void) => void;
|
|
9
|
+
logLevel: LogLevel;
|
|
10
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processVideoJob = void 0;
|
|
4
|
+
const preview_server_1 = require("../config/preview-server");
|
|
5
|
+
const convert_entry_point_to_serve_url_1 = require("../convert-entry-point-to-serve-url");
|
|
6
|
+
const get_cli_options_1 = require("../get-cli-options");
|
|
7
|
+
const render_1 = require("../render-flows/render");
|
|
8
|
+
const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, logLevel, }) => {
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
if (job.type !== 'video' && job.type !== 'sequence') {
|
|
11
|
+
throw new Error('Expected video job');
|
|
12
|
+
}
|
|
13
|
+
const { publicDir, browserExecutable, browser, ffmpegOverride } = await (0, get_cli_options_1.getCliOptions)({
|
|
14
|
+
isLambda: false,
|
|
15
|
+
type: 'still',
|
|
16
|
+
remotionRoot,
|
|
17
|
+
logLevel,
|
|
18
|
+
});
|
|
19
|
+
const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(entryPoint);
|
|
20
|
+
await (0, render_1.renderVideoFlow)({
|
|
21
|
+
remotionRoot,
|
|
22
|
+
browser,
|
|
23
|
+
browserExecutable,
|
|
24
|
+
chromiumOptions: job.chromiumOptions,
|
|
25
|
+
entryPointReason: 'same as Studio',
|
|
26
|
+
envVariables: job.envVariables,
|
|
27
|
+
height: null,
|
|
28
|
+
fullEntryPoint,
|
|
29
|
+
serializedInputPropsWithCustomSchema: job.serializedInputPropsWithCustomSchema,
|
|
30
|
+
overwrite: true,
|
|
31
|
+
port: (0, preview_server_1.getRendererPortFromConfigFile)(),
|
|
32
|
+
publicDir,
|
|
33
|
+
puppeteerTimeout: job.delayRenderTimeout,
|
|
34
|
+
jpegQuality: (_a = job.jpegQuality) !== null && _a !== void 0 ? _a : undefined,
|
|
35
|
+
remainingArgs: [],
|
|
36
|
+
scale: job.scale,
|
|
37
|
+
width: null,
|
|
38
|
+
compositionIdFromUi: job.compositionId,
|
|
39
|
+
logLevel: job.logLevel,
|
|
40
|
+
onProgress,
|
|
41
|
+
indent: true,
|
|
42
|
+
concurrency: job.concurrency,
|
|
43
|
+
everyNthFrame: job.type === 'video' ? job.everyNthFrame : 1,
|
|
44
|
+
frameRange: [job.startFrame, job.endFrame],
|
|
45
|
+
quiet: false,
|
|
46
|
+
shouldOutputImageSequence: job.type === 'sequence',
|
|
47
|
+
addCleanupCallback,
|
|
48
|
+
outputLocationFromUI: job.outName,
|
|
49
|
+
uiCodec: job.type === 'video' ? job.codec : null,
|
|
50
|
+
uiImageFormat: job.imageFormat,
|
|
51
|
+
cancelSignal: job.cancelToken.cancelSignal,
|
|
52
|
+
crf: job.type === 'video' ? job.crf : null,
|
|
53
|
+
ffmpegOverride,
|
|
54
|
+
audioBitrate: job.type === 'video' ? job.audioBitrate : null,
|
|
55
|
+
muted: job.type === 'video' ? job.muted : true,
|
|
56
|
+
enforceAudioTrack: job.type === 'video' ? job.enforceAudioTrack : false,
|
|
57
|
+
proResProfile: job.type === 'video' ? (_b = job.proResProfile) !== null && _b !== void 0 ? _b : undefined : undefined,
|
|
58
|
+
x264Preset: job.type === 'video' ? (_c = job.x264Preset) !== null && _c !== void 0 ? _c : undefined : undefined,
|
|
59
|
+
pixelFormat: job.type === 'video' ? job.pixelFormat : 'yuv420p',
|
|
60
|
+
videoBitrate: job.type === 'video' ? job.videoBitrate : null,
|
|
61
|
+
encodingBufferSize: job.type === 'video' ? job.encodingBufferSize : null,
|
|
62
|
+
encodingMaxRate: job.type === 'video' ? job.encodingMaxRate : null,
|
|
63
|
+
numberOfGifLoops: job.type === 'video' ? job.numberOfGifLoops : null,
|
|
64
|
+
audioCodec: job.type === 'video' ? job.audioCodec : null,
|
|
65
|
+
disallowParallelEncoding: job.type === 'video' ? job.disallowParallelEncoding : false,
|
|
66
|
+
offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
|
|
67
|
+
colorSpace: job.type === 'video' ? job.colorSpace : 'default',
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
exports.processVideoJob = processVideoJob;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { RenderJob, RenderJobWithCleanup } from '@remotion/studio';
|
|
3
|
+
export declare const getRenderQueue: () => RenderJob[];
|
|
4
|
+
export declare const addJob: ({ job, entryPoint, remotionRoot, logLevel, }: {
|
|
5
|
+
job: RenderJobWithCleanup;
|
|
6
|
+
entryPoint: string;
|
|
7
|
+
remotionRoot: string;
|
|
8
|
+
logLevel: LogLevel;
|
|
9
|
+
}) => void;
|
|
10
|
+
export declare const removeJob: (jobId: string) => void;
|
|
11
|
+
export declare const cancelJob: (jobId: string) => void;
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cancelJob = exports.removeJob = exports.addJob = exports.getRenderQueue = void 0;
|
|
7
|
+
const studio_1 = require("@remotion/studio");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const chalk_1 = require("../chalk");
|
|
10
|
+
const config_1 = require("../config");
|
|
11
|
+
const log_1 = require("../log");
|
|
12
|
+
const print_error_1 = require("../print-error");
|
|
13
|
+
const progress_types_1 = require("../progress-types");
|
|
14
|
+
const process_still_1 = require("./process-still");
|
|
15
|
+
const process_video_1 = require("./process-video");
|
|
16
|
+
let jobQueue = [];
|
|
17
|
+
const updateJob = (id, updater) => {
|
|
18
|
+
jobQueue = jobQueue.map((j) => {
|
|
19
|
+
if (id === j.id) {
|
|
20
|
+
return updater(j);
|
|
21
|
+
}
|
|
22
|
+
return j;
|
|
23
|
+
});
|
|
24
|
+
notifyClientsOfJobUpdate();
|
|
25
|
+
};
|
|
26
|
+
const getRenderQueue = () => {
|
|
27
|
+
return jobQueue.map((j) => {
|
|
28
|
+
const { cleanup, ...rest } = j;
|
|
29
|
+
return rest;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.getRenderQueue = getRenderQueue;
|
|
33
|
+
const notifyClientsOfJobUpdate = () => {
|
|
34
|
+
studio_1.StudioInternals.waitForLiveEventsListener().then((listener) => {
|
|
35
|
+
listener.sendEventToClient({
|
|
36
|
+
type: 'render-queue-updated',
|
|
37
|
+
queue: (0, exports.getRenderQueue)(),
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const processJob = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, logLevel, }) => {
|
|
42
|
+
if (job.type === 'still') {
|
|
43
|
+
await (0, process_still_1.processStill)({
|
|
44
|
+
job,
|
|
45
|
+
remotionRoot,
|
|
46
|
+
entryPoint,
|
|
47
|
+
onProgress,
|
|
48
|
+
addCleanupCallback,
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (job.type === 'video' || job.type === 'sequence') {
|
|
53
|
+
await (0, process_video_1.processVideoJob)({
|
|
54
|
+
job,
|
|
55
|
+
remotionRoot,
|
|
56
|
+
entryPoint,
|
|
57
|
+
onProgress,
|
|
58
|
+
addCleanupCallback,
|
|
59
|
+
logLevel,
|
|
60
|
+
});
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
throw new Error(`Unknown job ${JSON.stringify(job)}`);
|
|
64
|
+
};
|
|
65
|
+
const addJob = ({ job, entryPoint, remotionRoot, logLevel, }) => {
|
|
66
|
+
jobQueue.push(job);
|
|
67
|
+
processJobIfPossible({ entryPoint, remotionRoot, logLevel });
|
|
68
|
+
notifyClientsOfJobUpdate();
|
|
69
|
+
};
|
|
70
|
+
exports.addJob = addJob;
|
|
71
|
+
const removeJob = (jobId) => {
|
|
72
|
+
jobQueue = jobQueue.filter((job) => {
|
|
73
|
+
if (job.id === jobId) {
|
|
74
|
+
job.cleanup.forEach((c) => {
|
|
75
|
+
c();
|
|
76
|
+
});
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
});
|
|
81
|
+
notifyClientsOfJobUpdate();
|
|
82
|
+
};
|
|
83
|
+
exports.removeJob = removeJob;
|
|
84
|
+
const cancelJob = (jobId) => {
|
|
85
|
+
for (const job of jobQueue) {
|
|
86
|
+
if (job.id === jobId) {
|
|
87
|
+
if (job.status !== 'running') {
|
|
88
|
+
throw new Error('Job is not running');
|
|
89
|
+
}
|
|
90
|
+
job.cancelToken.cancel();
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.cancelJob = cancelJob;
|
|
96
|
+
const processJobIfPossible = async ({ remotionRoot, entryPoint, logLevel, }) => {
|
|
97
|
+
const runningJob = jobQueue.find((q) => {
|
|
98
|
+
return q.status === 'running';
|
|
99
|
+
});
|
|
100
|
+
if (runningJob) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const nextJob = jobQueue.find((q) => {
|
|
104
|
+
return q.status === 'idle';
|
|
105
|
+
});
|
|
106
|
+
if (!nextJob) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const jobCleanups = [];
|
|
110
|
+
try {
|
|
111
|
+
updateJob(nextJob.id, (job) => {
|
|
112
|
+
return {
|
|
113
|
+
...job,
|
|
114
|
+
status: 'running',
|
|
115
|
+
progress: {
|
|
116
|
+
value: 0,
|
|
117
|
+
message: 'Starting job...',
|
|
118
|
+
...(0, progress_types_1.initialAggregateRenderProgress)(),
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
const startTime = Date.now();
|
|
123
|
+
log_1.Log.info(chalk_1.chalk.gray('╭─ Starting render '));
|
|
124
|
+
let lastProgress = null;
|
|
125
|
+
await processJob({
|
|
126
|
+
job: nextJob,
|
|
127
|
+
entryPoint,
|
|
128
|
+
remotionRoot,
|
|
129
|
+
onProgress: (progress) => {
|
|
130
|
+
updateJob(nextJob.id, (job) => {
|
|
131
|
+
lastProgress = progress;
|
|
132
|
+
// Ignore late callbacks of progress updates after cancelling
|
|
133
|
+
if (job.status === 'failed' || job.status === 'done') {
|
|
134
|
+
return job;
|
|
135
|
+
}
|
|
136
|
+
if (job.type === 'still') {
|
|
137
|
+
return {
|
|
138
|
+
...job,
|
|
139
|
+
status: 'running',
|
|
140
|
+
progress,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (job.type === 'video') {
|
|
144
|
+
return {
|
|
145
|
+
...job,
|
|
146
|
+
status: 'running',
|
|
147
|
+
progress,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (job.type === 'sequence') {
|
|
151
|
+
return {
|
|
152
|
+
...job,
|
|
153
|
+
status: 'running',
|
|
154
|
+
progress,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
throw new Error('Unknown job type');
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
addCleanupCallback: (cleanup) => {
|
|
161
|
+
jobCleanups.push(cleanup);
|
|
162
|
+
},
|
|
163
|
+
logLevel,
|
|
164
|
+
});
|
|
165
|
+
log_1.Log.info(chalk_1.chalk.gray('╰─ Done in ' + (Date.now() - startTime) + 'ms.'));
|
|
166
|
+
const { unwatch } = studio_1.StudioInternals.installFileWatcher({
|
|
167
|
+
file: node_path_1.default.resolve(remotionRoot, nextJob.outName),
|
|
168
|
+
onChange: (type) => {
|
|
169
|
+
if (type === 'created') {
|
|
170
|
+
updateJob(nextJob.id, (job) => ({
|
|
171
|
+
...job,
|
|
172
|
+
deletedOutputLocation: false,
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
if (type === 'deleted') {
|
|
176
|
+
updateJob(nextJob.id, (job) => ({
|
|
177
|
+
...job,
|
|
178
|
+
deletedOutputLocation: true,
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
updateJob(nextJob.id, (job) => {
|
|
184
|
+
if (!lastProgress) {
|
|
185
|
+
throw new Error('expected progress');
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
...job,
|
|
189
|
+
status: 'done',
|
|
190
|
+
cleanup: [...job.cleanup, unwatch],
|
|
191
|
+
progress: { message: 'Done', value: 1, ...lastProgress },
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
log_1.Log.error(chalk_1.chalk.gray('╰─ '), chalk_1.chalk.red('Failed to render'));
|
|
197
|
+
updateJob(nextJob.id, (job) => {
|
|
198
|
+
return {
|
|
199
|
+
...job,
|
|
200
|
+
status: 'failed',
|
|
201
|
+
error: {
|
|
202
|
+
message: err.message,
|
|
203
|
+
stack: err.stack,
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
await (0, print_error_1.printError)(err, config_1.ConfigInternals.Logging.getLogLevel());
|
|
208
|
+
studio_1.StudioInternals.waitForLiveEventsListener().then((listener) => {
|
|
209
|
+
listener.sendEventToClient({
|
|
210
|
+
type: 'render-job-failed',
|
|
211
|
+
compositionId: nextJob.compositionId,
|
|
212
|
+
error: err,
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
await Promise.all(jobCleanups.map((c) => c()));
|
|
218
|
+
}
|
|
219
|
+
processJobIfPossible({ remotionRoot, entryPoint, logLevel });
|
|
220
|
+
};
|
package/dist/render.js
CHANGED
|
@@ -25,7 +25,7 @@ const render = async (remotionRoot, args, logLevel) => {
|
|
|
25
25
|
log_1.Log.error('--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/');
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
|
-
const { concurrency, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, jpegQuality, browser, browserExecutable, scale, chromiumOptions, everyNthFrame, puppeteerTimeout, publicDir, height, width, crf, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, numberOfGifLoops, offthreadVideoCacheSizeInBytes, colorSpace, } = await (0, get_cli_options_1.getCliOptions)({
|
|
28
|
+
const { concurrency, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, jpegQuality, browser, browserExecutable, scale, chromiumOptions, everyNthFrame, puppeteerTimeout, publicDir, height, width, crf, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, x264Preset, pixelFormat, videoBitrate, encodingMaxRate, encodingBufferSize, numberOfGifLoops, offthreadVideoCacheSizeInBytes, colorSpace, } = await (0, get_cli_options_1.getCliOptions)({
|
|
29
29
|
isLambda: false,
|
|
30
30
|
type: 'series',
|
|
31
31
|
remotionRoot,
|
|
@@ -79,6 +79,8 @@ const render = async (remotionRoot, args, logLevel) => {
|
|
|
79
79
|
x264Preset,
|
|
80
80
|
pixelFormat,
|
|
81
81
|
videoBitrate,
|
|
82
|
+
encodingMaxRate,
|
|
83
|
+
encodingBufferSize,
|
|
82
84
|
numberOfGifLoops,
|
|
83
85
|
audioCodec,
|
|
84
86
|
disallowParallelEncoding: false,
|
package/dist/setup-cache.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { BundlingState, CopyingState } from '
|
|
2
|
+
import type { BundlingState, CopyingState } from '@remotion/studio';
|
|
3
3
|
export declare const bundleOnCliOrTakeServeUrl: ({ fullPath, remotionRoot, publicDir, onProgress, indentOutput, logLevel, bundlingStep, steps, onDirectoryCreated, quietProgress, }: {
|
|
4
4
|
fullPath: string;
|
|
5
5
|
remotionRoot: string;
|