@remotion/cli 4.0.424 → 4.0.425

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 CHANGED
@@ -22,7 +22,7 @@ const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-
22
22
  const show_compositions_picker_1 = require("./show-compositions-picker");
23
23
  const truthy_1 = require("./truthy");
24
24
  const DEFAULT_RUNS = 3;
25
- const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, headlessOption, overwriteOption, binariesDirectoryOption, forSeamlessAacConcatenationOption, publicPathOption, publicDirOption, metadataOption, hardwareAccelerationOption, chromeModeOption, offthreadVideoThreadsOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
25
+ const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, headlessOption, overwriteOption, binariesDirectoryOption, forSeamlessAacConcatenationOption, publicPathOption, publicDirOption, metadataOption, hardwareAccelerationOption, chromeModeOption, offthreadVideoThreadsOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, } = client_1.BrowserSafeApis.options;
26
26
  const getValidConcurrency = (cliConcurrency) => {
27
27
  const { concurrencies } = parsed_cli_1.parsedCli;
28
28
  if (!concurrencies) {
@@ -103,11 +103,30 @@ const benchmarkCommand = async (remotionRoot, args, logLevel) => {
103
103
  process.exit(1);
104
104
  }
105
105
  const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(file);
106
- const { inputProps, envVariables, browserExecutable, proResProfile, frameRange: defaultFrameRange, pixelFormat, everyNthFrame, ffmpegOverride, height, width, concurrency: unparsedConcurrency, disableWebSecurity, userAgent, ignoreCertificateErrors, } = (0, get_cli_options_1.getCliOptions)({
106
+ const { inputProps, envVariables, frameRange: defaultFrameRange, ffmpegOverride, height, width, fps, durationInFrames, concurrency: unparsedConcurrency, } = (0, get_cli_options_1.getCliOptions)({
107
107
  isStill: false,
108
108
  logLevel,
109
109
  indent: false,
110
110
  });
111
+ const pixelFormat = pixelFormatOption.getValue({
112
+ commandLine: parsed_cli_1.parsedCli,
113
+ }).value;
114
+ const browserExecutable = browserExecutableOption.getValue({
115
+ commandLine: parsed_cli_1.parsedCli,
116
+ }).value;
117
+ const everyNthFrame = everyNthFrameOption.getValue({
118
+ commandLine: parsed_cli_1.parsedCli,
119
+ }).value;
120
+ const proResProfile = proResProfileOption.getValue({
121
+ commandLine: parsed_cli_1.parsedCli,
122
+ }).value;
123
+ const userAgent = userAgentOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
124
+ const disableWebSecurity = disableWebSecurityOption.getValue({
125
+ commandLine: parsed_cli_1.parsedCli,
126
+ }).value;
127
+ const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
128
+ commandLine: parsed_cli_1.parsedCli,
129
+ }).value;
111
130
  log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', fullEntryPoint, 'reason:', reason);
112
131
  const scale = scaleOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
113
132
  const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
@@ -304,6 +323,8 @@ const benchmarkCommand = async (remotionRoot, args, logLevel) => {
304
323
  ...composition,
305
324
  width: width !== null && width !== void 0 ? width : composition.width,
306
325
  height: height !== null && height !== void 0 ? height : composition.height,
326
+ fps: fps !== null && fps !== void 0 ? fps : composition.fps,
327
+ durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : composition.durationInFrames,
307
328
  },
308
329
  crf: configFileCrf !== null && configFileCrf !== void 0 ? configFileCrf : null,
309
330
  envVariables,
@@ -2,18 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureCommand = exports.ENSURE_COMMAND = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const client_1 = require("@remotion/renderer/client");
5
6
  const browser_download_bar_1 = require("../browser-download-bar");
6
- const get_cli_options_1 = require("../get-cli-options");
7
7
  const log_1 = require("../log");
8
8
  const parsed_cli_1 = require("../parsed-cli");
9
+ const { browserExecutableOption } = client_1.BrowserSafeApis.options;
9
10
  exports.ENSURE_COMMAND = 'ensure';
10
11
  const ensureCommand = async (logLevel) => {
11
12
  const indent = false;
12
- const { browserExecutable } = (0, get_cli_options_1.getCliOptions)({
13
- isStill: false,
14
- logLevel,
15
- indent,
16
- });
13
+ const browserExecutable = browserExecutableOption.getValue({
14
+ commandLine: parsed_cli_1.parsedCli,
15
+ }).value;
17
16
  const status = await (0, renderer_1.ensureBrowser)({
18
17
  browserExecutable,
19
18
  logLevel,
@@ -13,7 +13,7 @@ const log_1 = require("./log");
13
13
  const parsed_cli_1 = require("./parsed-cli");
14
14
  const print_compositions_1 = require("./print-compositions");
15
15
  const setup_cache_1 = require("./setup-cache");
16
- const { enableMultiprocessOnLinuxOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, glOption, headlessOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, publicPathOption, publicDirOption, chromeModeOption, audioLatencyHintOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
16
+ const { enableMultiprocessOnLinuxOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, glOption, headlessOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, publicPathOption, publicDirOption, chromeModeOption, audioLatencyHintOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, browserExecutableOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, } = client_1.BrowserSafeApis.options;
17
17
  const listCompositionsCommand = async (remotionRoot, args, logLevel) => {
18
18
  const { file, reason } = (0, entry_point_1.findEntryPoint)({
19
19
  args,
@@ -28,11 +28,21 @@ const listCompositionsCommand = async (remotionRoot, args, logLevel) => {
28
28
  process.exit(1);
29
29
  }
30
30
  log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', file, 'reason:', reason);
31
- const { browserExecutable, envVariables, inputProps, ignoreCertificateErrors, userAgent, disableWebSecurity, } = (0, get_cli_options_1.getCliOptions)({
31
+ const { envVariables, inputProps } = (0, get_cli_options_1.getCliOptions)({
32
32
  isStill: false,
33
33
  logLevel,
34
34
  indent: false,
35
35
  });
36
+ const browserExecutable = browserExecutableOption.getValue({
37
+ commandLine: parsed_cli_1.parsedCli,
38
+ }).value;
39
+ const userAgent = userAgentOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
40
+ const disableWebSecurity = disableWebSecurityOption.getValue({
41
+ commandLine: parsed_cli_1.parsedCli,
42
+ }).value;
43
+ const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
44
+ commandLine: parsed_cli_1.parsedCli,
45
+ }).value;
36
46
  const publicPath = publicPathOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
37
47
  const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({
38
48
  commandLine: parsed_cli_1.parsedCli,
@@ -241,6 +241,14 @@ declare global {
241
241
  * Overrides the width of a composition
242
242
  */
243
243
  readonly overrideWidth: (newWidth: number) => void;
244
+ /**
245
+ * Overrides the FPS of a composition
246
+ */
247
+ readonly overrideFps: (newFps: number) => void;
248
+ /**
249
+ * Overrides the duration in frames of a composition
250
+ */
251
+ readonly overrideDuration: (newDuration: number) => void;
244
252
  /**
245
253
  * Set the ProRes profile.
246
254
  * This method is only valid if the codec has been set to 'prores'.
@@ -410,15 +418,9 @@ export declare const Config: FlatConfig;
410
418
  export declare const ConfigInternals: {
411
419
  getRange: () => FrameRange | null;
412
420
  getBrowser: () => null;
413
- getPixelFormat: () => "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
414
- getProResProfile: () => "4444" | "4444-xq" | "hq" | "light" | "proxy" | "standard" | undefined;
415
- getBrowserExecutable: () => BrowserExecutable;
416
421
  getStudioPort: () => number | undefined;
417
422
  getRendererPortFromConfigFile: () => number | null;
418
423
  getRendererPortFromConfigFileAndCliFlag: () => number | null;
419
- getChromiumDisableWebSecurity: () => boolean;
420
- getIgnoreCertificateErrors: () => boolean;
421
- getEveryNthFrame: () => number;
422
424
  getConcurrency: () => string | number | null;
423
425
  getStillFrame: () => number;
424
426
  getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
@@ -431,13 +433,10 @@ export declare const ConfigInternals: {
431
433
  getMaxTimelineTracks: () => number;
432
434
  defaultOverrideFunction: WebpackOverrideFn;
433
435
  getFfmpegOverrideFunction: () => import("@remotion/renderer").FfmpegOverrideFn;
434
- getHeight: () => number | null;
435
- getWidth: () => number | null;
436
436
  getMetadata: () => Record<string, string>;
437
437
  getEntryPoint: () => string | null;
438
438
  getWebpackPolling: () => number | null;
439
439
  getShouldOpenBrowser: () => boolean;
440
- getChromiumUserAgent: () => string | null;
441
440
  getBufferStateDelayInMilliseconds: () => number | null;
442
441
  getOutputCodecOrUndefined: () => CodecOrUndefined;
443
442
  };
@@ -2,44 +2,31 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConfigInternals = exports.Config = void 0;
4
4
  const browser_1 = require("./browser");
5
- const browser_executable_1 = require("./browser-executable");
6
- const chromium_flags_1 = require("./chromium-flags");
7
5
  const concurrency_1 = require("./concurrency");
8
6
  const env_file_1 = require("./env-file");
9
7
  const frame_range_1 = require("./frame-range");
10
8
  const image_sequence_1 = require("./image-sequence");
11
9
  const output_location_1 = require("./output-location");
12
10
  const override_webpack_1 = require("./override-webpack");
13
- const pixel_format_1 = require("./pixel-format");
14
11
  const preview_server_1 = require("./preview-server");
15
- const prores_profile_1 = require("./prores-profile");
16
12
  const still_frame_1 = require("./still-frame");
17
13
  const webpack_caching_1 = require("./webpack-caching");
18
14
  const client_1 = require("@remotion/renderer/client");
19
15
  const studio_server_1 = require("@remotion/studio-server");
20
- const browser_executable_2 = require("./browser-executable");
21
16
  const buffer_state_delay_in_milliseconds_1 = require("./buffer-state-delay-in-milliseconds");
22
- const chromium_flags_2 = require("./chromium-flags");
23
- const concurrency_2 = require("./concurrency");
24
17
  const entry_point_1 = require("./entry-point");
25
18
  const env_file_2 = require("./env-file");
26
- const every_nth_frame_1 = require("./every-nth-frame");
27
19
  const ffmpeg_override_1 = require("./ffmpeg-override");
28
20
  const frame_range_2 = require("./frame-range");
29
- const height_1 = require("./height");
30
21
  const image_sequence_2 = require("./image-sequence");
31
22
  const metadata_1 = require("./metadata");
32
23
  const open_browser_1 = require("./open-browser");
33
24
  const output_location_2 = require("./output-location");
34
25
  const override_webpack_2 = require("./override-webpack");
35
- const pixel_format_2 = require("./pixel-format");
36
26
  const preview_server_2 = require("./preview-server");
37
- const prores_profile_2 = require("./prores-profile");
38
- const user_agent_1 = require("./user-agent");
39
27
  const webpack_caching_2 = require("./webpack-caching");
40
28
  const webpack_poll_1 = require("./webpack-poll");
41
- const width_1 = require("./width");
42
- const { offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, askAIOption, publicLicenseKeyOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, stillImageFormatOption, videoImageFormatOption, } = client_1.BrowserSafeApis.options;
29
+ const { concurrencyOption, offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, askAIOption, publicLicenseKeyOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, pixelFormatOption, browserExecutableOption, everyNthFrameOption, proResProfileOption, stillImageFormatOption, videoImageFormatOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, overrideHeightOption, overrideWidthOption, overrideFpsOption, overrideDurationOption, } = client_1.BrowserSafeApis.options;
43
30
  exports.Config = {
44
31
  get Bundling() {
45
32
  throw new Error('The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.');
@@ -74,16 +61,16 @@ exports.Config = {
74
61
  setPublicDir: publicDirOption.setConfig,
75
62
  setEntryPoint: entry_point_1.setEntryPoint,
76
63
  setLevel: logLevelOption.setConfig,
77
- setBrowserExecutable: browser_executable_2.setBrowserExecutable,
64
+ setBrowserExecutable: browserExecutableOption.setConfig,
78
65
  setTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.setConfig,
79
66
  setDelayRenderTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.setConfig,
80
- setChromiumDisableWebSecurity: chromium_flags_2.setChromiumDisableWebSecurity,
81
- setChromiumIgnoreCertificateErrors: chromium_flags_2.setChromiumIgnoreCertificateErrors,
67
+ setChromiumDisableWebSecurity: disableWebSecurityOption.setConfig,
68
+ setChromiumIgnoreCertificateErrors: ignoreCertificateErrorsOption.setConfig,
82
69
  setChromiumHeadlessMode: headlessOption.setConfig,
83
70
  setChromiumOpenGlRenderer: glOption.setConfig,
84
- setChromiumUserAgent: user_agent_1.setChromiumUserAgent,
71
+ setChromiumUserAgent: userAgentOption.setConfig,
85
72
  setDotEnvLocation: env_file_2.setDotEnvLocation,
86
- setConcurrency: concurrency_2.setConcurrency,
73
+ setConcurrency: concurrencyOption.setConfig,
87
74
  setChromiumMultiProcessOnLinux: enableMultiprocessOnLinuxOption.setConfig,
88
75
  setChromiumDarkMode: darkModeOption.setConfig,
89
76
  setQuality: () => {
@@ -100,25 +87,27 @@ exports.Config = {
100
87
  setEncodingBufferSize: encodingBufferSizeOption.setConfig,
101
88
  setFrameRange: frame_range_2.setFrameRange,
102
89
  setScale: scaleOption.setConfig,
103
- setEveryNthFrame: every_nth_frame_1.setEveryNthFrame,
90
+ setEveryNthFrame: everyNthFrameOption.setConfig,
104
91
  setNumberOfGifLoops: numberOfGifLoopsOption.setConfig,
105
92
  setMuted: mutedOption.setConfig,
106
93
  setEnforceAudioTrack: enforceAudioOption.setConfig,
107
94
  setOutputLocation: output_location_2.setOutputLocation,
108
95
  setOverwriteOutput: overwriteOption.setConfig,
109
96
  setChromeMode: chromeModeOption.setConfig,
110
- setPixelFormat: pixel_format_2.setPixelFormat,
97
+ setPixelFormat: pixelFormatOption.setConfig,
111
98
  setCodec: videoCodecOption.setConfig,
112
99
  setCrf: crfOption.setConfig,
113
100
  setImageSequence: image_sequence_2.setImageSequence,
114
- setProResProfile: prores_profile_2.setProResProfile,
101
+ setProResProfile: proResProfileOption.setConfig,
115
102
  setX264Preset: x264Option.setConfig,
116
103
  setAudioBitrate: audioBitrateOption.setConfig,
117
104
  setVideoBitrate: videoBitrateOption.setConfig,
118
105
  setAudioLatencyHint: audioLatencyHintOption.setConfig,
119
106
  setForSeamlessAacConcatenation: forSeamlessAacConcatenationOption.setConfig,
120
- overrideHeight: height_1.overrideHeight,
121
- overrideWidth: width_1.overrideWidth,
107
+ overrideHeight: overrideHeightOption.setConfig,
108
+ overrideWidth: overrideWidthOption.setConfig,
109
+ overrideFps: overrideFpsOption.setConfig,
110
+ overrideDuration: overrideDurationOption.setConfig,
122
111
  overrideFfmpegCommand: ffmpeg_override_1.setFfmpegOverrideFunction,
123
112
  setAudioCodec: audioCodecOption.setConfig,
124
113
  setOffthreadVideoCacheSizeInBytes: (size) => {
@@ -145,15 +134,9 @@ exports.Config = {
145
134
  exports.ConfigInternals = {
146
135
  getRange: frame_range_1.getRange,
147
136
  getBrowser: browser_1.getBrowser,
148
- getPixelFormat: pixel_format_1.getPixelFormat,
149
- getProResProfile: prores_profile_1.getProResProfile,
150
- getBrowserExecutable: browser_executable_1.getBrowserExecutable,
151
137
  getStudioPort: preview_server_1.getStudioPort,
152
138
  getRendererPortFromConfigFile: preview_server_1.getRendererPortFromConfigFile,
153
139
  getRendererPortFromConfigFileAndCliFlag: preview_server_1.getRendererPortFromConfigFileAndCliFlag,
154
- getChromiumDisableWebSecurity: chromium_flags_1.getChromiumDisableWebSecurity,
155
- getIgnoreCertificateErrors: chromium_flags_1.getIgnoreCertificateErrors,
156
- getEveryNthFrame: every_nth_frame_1.getEveryNthFrame,
157
140
  getConcurrency: concurrency_1.getConcurrency,
158
141
  getStillFrame: still_frame_1.getStillFrame,
159
142
  getShouldOutputImageSequence: image_sequence_1.getShouldOutputImageSequence,
@@ -166,13 +149,10 @@ exports.ConfigInternals = {
166
149
  getMaxTimelineTracks: studio_server_1.StudioServerInternals.getMaxTimelineTracks,
167
150
  defaultOverrideFunction: override_webpack_1.defaultOverrideFunction,
168
151
  getFfmpegOverrideFunction: ffmpeg_override_1.getFfmpegOverrideFunction,
169
- getHeight: height_1.getHeight,
170
- getWidth: width_1.getWidth,
171
152
  getMetadata: metadata_1.getMetadata,
172
153
  getEntryPoint: entry_point_1.getEntryPoint,
173
154
  getWebpackPolling: webpack_poll_1.getWebpackPolling,
174
155
  getShouldOpenBrowser: open_browser_1.getShouldOpenBrowser,
175
- getChromiumUserAgent: user_agent_1.getChromiumUserAgent,
176
156
  getBufferStateDelayInMilliseconds: buffer_state_delay_in_milliseconds_1.getBufferStateDelayInMilliseconds,
177
157
  getOutputCodecOrUndefined: client_1.BrowserSafeApis.getOutputCodecOrUndefined,
178
158
  };
@@ -0,0 +1,2 @@
1
+ export declare const getNumberOfSharedAudioTags: () => number;
2
+ export declare const setNumberOfSharedAudioTags: (audioTags: number) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setNumberOfSharedAudioTags = exports.getNumberOfSharedAudioTags = void 0;
4
+ let numberOfSharedAudioTags = 0;
5
+ const getNumberOfSharedAudioTags = () => {
6
+ return numberOfSharedAudioTags;
7
+ };
8
+ exports.getNumberOfSharedAudioTags = getNumberOfSharedAudioTags;
9
+ const setNumberOfSharedAudioTags = (audioTags) => {
10
+ numberOfSharedAudioTags = audioTags;
11
+ };
12
+ exports.setNumberOfSharedAudioTags = setNumberOfSharedAudioTags;
@@ -0,0 +1,9 @@
1
+ type RemotionDetectionResult = {
2
+ type: 'match';
3
+ } | {
4
+ type: 'mismatch';
5
+ } | {
6
+ type: 'not-remotion';
7
+ };
8
+ export declare const detectRemotionServer: (port: number, cwd: string) => Promise<RemotionDetectionResult>;
9
+ export {};
@@ -0,0 +1,45 @@
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.detectRemotionServer = void 0;
7
+ const http_1 = __importDefault(require("http"));
8
+ const detectRemotionServer = (port, cwd) => {
9
+ return new Promise((resolve) => {
10
+ const req = http_1.default.get({
11
+ hostname: 'localhost',
12
+ port,
13
+ path: '/__remotion_config',
14
+ timeout: 1000,
15
+ }, (res) => {
16
+ let data = '';
17
+ res.on('data', (chunk) => {
18
+ data += chunk;
19
+ });
20
+ res.on('end', () => {
21
+ try {
22
+ const json = JSON.parse(data);
23
+ if ((json === null || json === void 0 ? void 0 : json.isRemotion) !== true) {
24
+ return resolve({ type: 'not-remotion' });
25
+ }
26
+ // Normalize paths for comparison to avoid issues with different separators or casing on Windows
27
+ const normalize = (p) => p.replace(/\\/g, '/').toLowerCase();
28
+ if (normalize(json.cwd) === normalize(cwd)) {
29
+ return resolve({ type: 'match' });
30
+ }
31
+ return resolve({ type: 'mismatch' });
32
+ }
33
+ catch (_a) {
34
+ resolve({ type: 'not-remotion' });
35
+ }
36
+ });
37
+ });
38
+ req.on('error', () => resolve({ type: 'not-remotion' }));
39
+ req.on('timeout', () => {
40
+ req.destroy();
41
+ resolve({ type: 'not-remotion' });
42
+ });
43
+ });
44
+ };
45
+ exports.detectRemotionServer = detectRemotionServer;
@@ -4,20 +4,15 @@ export declare const getCliOptions: (options: {
4
4
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
5
5
  indent: boolean;
6
6
  }) => {
7
- concurrency: string | number | null;
7
+ concurrency: import("@remotion/renderer").Concurrency;
8
8
  frameRange: import("@remotion/renderer").FrameRange | null;
9
9
  shouldOutputImageSequence: boolean;
10
10
  inputProps: Record<string, unknown>;
11
11
  envVariables: Record<string, string>;
12
- pixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
13
- proResProfile: "4444" | "4444-xq" | "hq" | "light" | "proxy" | "standard" | undefined;
14
- everyNthFrame: number;
15
12
  stillFrame: number;
16
- browserExecutable: import("@remotion/renderer").BrowserExecutable;
17
- userAgent: string | null;
18
- disableWebSecurity: boolean;
19
- ignoreCertificateErrors: boolean;
20
13
  ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
21
14
  height: number | null;
22
15
  width: number | null;
16
+ fps: number | null;
17
+ durationInFrames: number | null;
23
18
  };
@@ -5,12 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getCliOptions = exports.getAndValidateAbsoluteOutputFile = void 0;
7
7
  const renderer_1 = require("@remotion/renderer");
8
+ const client_1 = require("@remotion/renderer/client");
8
9
  const node_fs_1 = __importDefault(require("node:fs"));
9
10
  const node_path_1 = __importDefault(require("node:path"));
10
11
  const config_1 = require("./config");
11
12
  const get_env_1 = require("./get-env");
12
13
  const get_input_props_1 = require("./get-input-props");
13
14
  const log_1 = require("./log");
15
+ const parsed_cli_1 = require("./parsed-cli");
14
16
  const getAndValidateFrameRange = (logLevel, indent) => {
15
17
  const frameRange = config_1.ConfigInternals.getRange();
16
18
  if (typeof frameRange === 'number') {
@@ -29,25 +31,26 @@ const getAndValidateAbsoluteOutputFile = (relativeOutputLocation, overwrite, log
29
31
  return absoluteOutputFile;
30
32
  };
31
33
  exports.getAndValidateAbsoluteOutputFile = getAndValidateAbsoluteOutputFile;
32
- const getProResProfile = () => {
33
- const proResProfile = config_1.ConfigInternals.getProResProfile();
34
- return proResProfile;
35
- };
36
34
  const getCliOptions = (options) => {
37
35
  const frameRange = getAndValidateFrameRange(options.logLevel, false);
38
36
  const shouldOutputImageSequence = options.isStill
39
37
  ? true
40
38
  : config_1.ConfigInternals.getShouldOutputImageSequence(frameRange);
41
- const pixelFormat = config_1.ConfigInternals.getPixelFormat();
42
- const proResProfile = getProResProfile();
43
- const browserExecutable = config_1.ConfigInternals.getBrowserExecutable();
44
- const disableWebSecurity = config_1.ConfigInternals.getChromiumDisableWebSecurity();
45
- const ignoreCertificateErrors = config_1.ConfigInternals.getIgnoreCertificateErrors();
46
- const userAgent = config_1.ConfigInternals.getChromiumUserAgent();
47
- const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
48
- const concurrency = config_1.ConfigInternals.getConcurrency();
49
- const height = config_1.ConfigInternals.getHeight();
50
- const width = config_1.ConfigInternals.getWidth();
39
+ const concurrency = client_1.BrowserSafeApis.options.concurrencyOption.getValue({
40
+ commandLine: parsed_cli_1.parsedCli,
41
+ }).value;
42
+ const height = client_1.BrowserSafeApis.options.overrideHeightOption.getValue({
43
+ commandLine: parsed_cli_1.parsedCli,
44
+ }).value;
45
+ const width = client_1.BrowserSafeApis.options.overrideWidthOption.getValue({
46
+ commandLine: parsed_cli_1.parsedCli,
47
+ }).value;
48
+ const fps = client_1.BrowserSafeApis.options.overrideFpsOption.getValue({
49
+ commandLine: parsed_cli_1.parsedCli,
50
+ }).value;
51
+ const durationInFrames = client_1.BrowserSafeApis.options.overrideDurationOption.getValue({
52
+ commandLine: parsed_cli_1.parsedCli,
53
+ }).value;
51
54
  renderer_1.RenderInternals.validateConcurrency({
52
55
  value: concurrency,
53
56
  setting: 'concurrency',
@@ -59,17 +62,12 @@ const getCliOptions = (options) => {
59
62
  shouldOutputImageSequence,
60
63
  inputProps: (0, get_input_props_1.getInputProps)(null, options.logLevel),
61
64
  envVariables: (0, get_env_1.getEnvironmentVariables)(null, options.logLevel, options.indent),
62
- pixelFormat,
63
- proResProfile,
64
- everyNthFrame,
65
65
  stillFrame: config_1.ConfigInternals.getStillFrame(),
66
- browserExecutable,
67
- userAgent,
68
- disableWebSecurity,
69
- ignoreCertificateErrors,
70
66
  ffmpegOverride: config_1.ConfigInternals.getFfmpegOverrideFunction(),
71
67
  height,
72
68
  width,
69
+ fps,
70
+ durationInFrames,
73
71
  };
74
72
  };
75
73
  exports.getCliOptions = getCliOptions;
@@ -1,8 +1,10 @@
1
1
  import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, OnBrowserDownload, RemotionServer } from '@remotion/renderer';
2
2
  import type { VideoConfig } from 'remotion';
3
- export declare const getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }: {
3
+ export declare const getCompositionWithDimensionOverride: ({ height, width, fps, durationInFrames, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }: {
4
4
  height: number | null;
5
5
  width: number | null;
6
+ fps: number | null;
7
+ durationInFrames: number | null;
6
8
  args: (string | number)[];
7
9
  compositionIdFromUi: string | null;
8
10
  timeoutInMilliseconds: number;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCompositionWithDimensionOverride = void 0;
4
4
  const get_composition_id_1 = require("./get-composition-id");
5
- const getCompositionWithDimensionOverride = async ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }) => {
5
+ const getCompositionWithDimensionOverride = async ({ height, width, fps, durationInFrames, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }) => {
6
6
  const returnValue = await (0, get_composition_id_1.getCompositionId)({
7
7
  args,
8
8
  compositionIdFromUi,
@@ -30,6 +30,8 @@ const getCompositionWithDimensionOverride = async ({ height, width, args, compos
30
30
  ...returnValue.config,
31
31
  height: height !== null && height !== void 0 ? height : returnValue.config.height,
32
32
  width: width !== null && width !== void 0 ? width : returnValue.config.width,
33
+ fps: fps !== null && fps !== void 0 ? fps : returnValue.config.fps,
34
+ durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : returnValue.config.durationInFrames,
33
35
  },
34
36
  };
35
37
  };
@@ -5,7 +5,7 @@ const renderer_1 = require("@remotion/renderer");
5
5
  const client_1 = require("@remotion/renderer/client");
6
6
  const config_1 = require("./config");
7
7
  const parsed_cli_1 = require("./parsed-cli");
8
- const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, logLevelOption, delayRenderTimeoutInMillisecondsOption, headlessOption, forSeamlessAacConcatenationOption, audioCodecOption, hardwareAccelerationOption, chromeModeOption, mediaCacheSizeInBytesOption, darkModeOption, publicLicenseKeyOption, stillImageFormatOption, videoImageFormatOption, } = client_1.BrowserSafeApis.options;
8
+ const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, concurrencyOption, offthreadVideoThreadsOption, scaleOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, logLevelOption, delayRenderTimeoutInMillisecondsOption, headlessOption, forSeamlessAacConcatenationOption, audioCodecOption, hardwareAccelerationOption, chromeModeOption, mediaCacheSizeInBytesOption, darkModeOption, pixelFormatOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, publicLicenseKeyOption, stillImageFormatOption, videoImageFormatOption, } = client_1.BrowserSafeApis.options;
9
9
  const getRenderDefaults = () => {
10
10
  var _a;
11
11
  const defaultJpegQuality = jpegQualityOption.getValue({
@@ -13,9 +13,11 @@ const getRenderDefaults = () => {
13
13
  }).value;
14
14
  const logLevel = logLevelOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
15
15
  const defaultCodec = config_1.ConfigInternals.getOutputCodecOrUndefined();
16
- const concurrency = renderer_1.RenderInternals.resolveConcurrency(config_1.ConfigInternals.getConcurrency());
17
- const pixelFormat = config_1.ConfigInternals.getPixelFormat();
18
- const proResProfile = (_a = config_1.ConfigInternals.getProResProfile()) !== null && _a !== void 0 ? _a : null;
16
+ const concurrency = renderer_1.RenderInternals.resolveConcurrency(concurrencyOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value);
17
+ const pixelFormat = pixelFormatOption.getValue({
18
+ commandLine: parsed_cli_1.parsedCli,
19
+ }).value;
20
+ const proResProfile = (_a = proResProfileOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value) !== null && _a !== void 0 ? _a : null;
19
21
  const x264Preset = x264Option.getValue({
20
22
  commandLine: parsed_cli_1.parsedCli,
21
23
  }).value;
@@ -88,19 +90,25 @@ const getRenderDefaults = () => {
88
90
  const publicLicenseKey = publicLicenseKeyOption.getValue({
89
91
  commandLine: parsed_cli_1.parsedCli,
90
92
  }).value;
91
- const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
93
+ const everyNthFrame = everyNthFrameOption.getValue({
94
+ commandLine: parsed_cli_1.parsedCli,
95
+ }).value;
92
96
  const stillImageFormat = stillImageFormatOption.getValue({
93
97
  commandLine: parsed_cli_1.parsedCli,
94
98
  }).value;
95
99
  const videoImageFormat = videoImageFormatOption.getValue({
96
100
  commandLine: parsed_cli_1.parsedCli,
97
101
  }).value;
98
- const disableWebSecurity = config_1.ConfigInternals.getChromiumDisableWebSecurity();
99
- const ignoreCertificateErrors = config_1.ConfigInternals.getIgnoreCertificateErrors();
102
+ const disableWebSecurity = disableWebSecurityOption.getValue({
103
+ commandLine: parsed_cli_1.parsedCli,
104
+ }).value;
105
+ const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
106
+ commandLine: parsed_cli_1.parsedCli,
107
+ }).value;
100
108
  const darkMode = darkModeOption.getValue({
101
109
  commandLine: parsed_cli_1.parsedCli,
102
110
  }).value;
103
- const userAgent = config_1.ConfigInternals.getChromiumUserAgent();
111
+ const userAgent = userAgentOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
104
112
  const metadata = config_1.ConfigInternals.getMetadata();
105
113
  const outputLocation = config_1.ConfigInternals.getOutputLocation();
106
114
  const maxConcurrency = renderer_1.RenderInternals.getMaxConcurrency();
package/dist/gpu.js CHANGED
@@ -5,17 +5,21 @@ const renderer_1 = require("@remotion/renderer");
5
5
  const client_1 = require("@remotion/renderer/client");
6
6
  const browser_download_bar_1 = require("./browser-download-bar");
7
7
  const chalk_1 = require("./chalk");
8
- const get_cli_options_1 = require("./get-cli-options");
9
8
  const log_1 = require("./log");
10
9
  const parsed_cli_1 = require("./parsed-cli");
11
10
  exports.GPU_COMMAND = 'gpu';
12
- const { enableMultiprocessOnLinuxOption, glOption, delayRenderTimeoutInMillisecondsOption, headlessOption, chromeModeOption, darkModeOption, } = client_1.BrowserSafeApis.options;
11
+ const { enableMultiprocessOnLinuxOption, glOption, delayRenderTimeoutInMillisecondsOption, headlessOption, chromeModeOption, darkModeOption, browserExecutableOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, } = client_1.BrowserSafeApis.options;
13
12
  const gpuCommand = async (logLevel) => {
14
- const { browserExecutable, disableWebSecurity, ignoreCertificateErrors, userAgent, } = (0, get_cli_options_1.getCliOptions)({
15
- isStill: false,
16
- logLevel,
17
- indent: false,
18
- });
13
+ const browserExecutable = browserExecutableOption.getValue({
14
+ commandLine: parsed_cli_1.parsedCli,
15
+ }).value;
16
+ const userAgent = userAgentOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
17
+ const disableWebSecurity = disableWebSecurityOption.getValue({
18
+ commandLine: parsed_cli_1.parsedCli,
19
+ }).value;
20
+ const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({
21
+ commandLine: parsed_cli_1.parsedCli,
22
+ }).value;
19
23
  const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
20
24
  commandLine: parsed_cli_1.parsedCli,
21
25
  }).value;
package/dist/index.d.ts CHANGED
@@ -80,22 +80,17 @@ export declare const CliInternals: {
80
80
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
81
81
  indent: boolean;
82
82
  }) => {
83
- concurrency: string | number | null;
83
+ concurrency: import("@remotion/renderer").Concurrency;
84
84
  frameRange: import("@remotion/renderer").FrameRange | null;
85
85
  shouldOutputImageSequence: boolean;
86
86
  inputProps: Record<string, unknown>;
87
87
  envVariables: Record<string, string>;
88
- pixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
89
- proResProfile: "4444" | "4444-xq" | "hq" | "light" | "proxy" | "standard" | undefined;
90
- everyNthFrame: number;
91
88
  stillFrame: number;
92
- browserExecutable: import("@remotion/renderer").BrowserExecutable;
93
- userAgent: string | null;
94
- disableWebSecurity: boolean;
95
- ignoreCertificateErrors: boolean;
96
89
  ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
97
90
  height: number | null;
98
91
  width: number | null;
92
+ fps: number | null;
93
+ durationInFrames: number | null;
99
94
  };
100
95
  loadConfig: (remotionRoot: string) => Promise<string | null>;
101
96
  formatBytes: (number: number, options?: (Intl.NumberFormatOptions & {
@@ -142,9 +137,11 @@ export declare const CliInternals: {
142
137
  shouldUseNonOverlayingLogger: ({ logLevel, }: {
143
138
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
144
139
  }) => boolean;
145
- getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }: {
140
+ getCompositionWithDimensionOverride: ({ height, width, fps, durationInFrames, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }: {
146
141
  height: number | null;
147
142
  width: number | null;
143
+ fps: number | null;
144
+ durationInFrames: number | null;
148
145
  args: (string | number)[];
149
146
  compositionIdFromUi: string | null;
150
147
  timeoutInMilliseconds: number;
@@ -0,0 +1 @@
1
+ export declare const isPortOpen: (port: number) => Promise<boolean>;