@remotion/cli 3.2.35-crf.3 → 3.2.36

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.
Files changed (45) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/benchmark.js +8 -5
  3. package/dist/check-version.d.ts +1 -0
  4. package/dist/check-version.js +14 -0
  5. package/dist/composition-prompts.d.ts +8 -0
  6. package/dist/composition-prompts.js +26 -0
  7. package/dist/editor/components/Editor.js +4 -1
  8. package/dist/editor/components/GlobalKeybindings.js +11 -0
  9. package/dist/editor/components/MenuToolbar.js +3 -449
  10. package/dist/editor/components/NewComposition/ComboBox.d.ts +2 -1
  11. package/dist/editor/components/NewComposition/NewComposition.js +3 -0
  12. package/dist/editor/components/PlayPause.js +2 -1
  13. package/dist/editor/components/PlaybackRateSelector.js +1 -0
  14. package/dist/editor/components/QuickSwitcher/NoResults.d.ts +6 -0
  15. package/dist/editor/components/QuickSwitcher/NoResults.js +15 -0
  16. package/dist/editor/components/QuickSwitcher/QuickSwitcher.d.ts +3 -0
  17. package/dist/editor/components/QuickSwitcher/QuickSwitcher.js +16 -0
  18. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.d.ts +2 -0
  19. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +179 -0
  20. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.d.ts +17 -0
  21. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +90 -0
  22. package/dist/editor/components/QuickSwitcher/fuzzy-search.d.ts +2 -0
  23. package/dist/editor/components/QuickSwitcher/fuzzy-search.js +26 -0
  24. package/dist/editor/components/QuickSwitcher.d.ts +3 -0
  25. package/dist/editor/components/QuickSwitcher.js +32 -0
  26. package/dist/editor/components/SizeSelector.js +1 -0
  27. package/dist/editor/helpers/use-menu-structure.d.ts +7 -0
  28. package/dist/editor/helpers/use-menu-structure.js +547 -0
  29. package/dist/editor/helpers/use-menu-toolbar.d.ts +0 -0
  30. package/dist/editor/helpers/use-menu-toolbar.js +1 -0
  31. package/dist/editor/state/modals.d.ts +2 -0
  32. package/dist/get-composition-id.d.ts +6 -1
  33. package/dist/get-composition-id.js +27 -6
  34. package/dist/index.d.ts +4 -0
  35. package/dist/index.js +2 -0
  36. package/dist/preview-server/start-server.js +9 -5
  37. package/dist/render.js +9 -13
  38. package/dist/select-composition.d.ts +7 -0
  39. package/dist/select-composition.js +51 -0
  40. package/dist/still.js +11 -15
  41. package/dist/validate-ffmpeg-version.d.ts +3 -0
  42. package/dist/validate-ffmpeg-version.js +17 -0
  43. package/dist/warn-about-ffmpeg-version.d.ts +5 -0
  44. package/dist/warn-about-ffmpeg-version.js +38 -0
  45. package/package.json +9 -7
package/dist/render.js CHANGED
@@ -49,15 +49,6 @@ const render = async (remotionRoot) => {
49
49
  type: 'series',
50
50
  codec,
51
51
  });
52
- const relativeOutputLocation = (0, get_filename_1.getOutputFilename)({
53
- codec,
54
- imageSequence: shouldOutputImageSequence,
55
- compositionName: (0, get_composition_id_1.getCompositionId)(),
56
- defaultExtension: renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'),
57
- });
58
- const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
59
- const compositionId = (0, get_composition_id_1.getCompositionId)();
60
- log_1.Log.info(chalk_1.chalk.gray(`Composition = ${compositionId}, Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
61
52
  const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
62
53
  ffmpegExecutable,
63
54
  });
@@ -109,16 +100,21 @@ const render = async (remotionRoot) => {
109
100
  downloadMap,
110
101
  port,
111
102
  });
112
- const config = comps.find((c) => c.id === compositionId);
113
- if (!config) {
114
- throw new Error(`Cannot find composition with ID ${compositionId}`);
115
- }
103
+ const { compositionId, config, reason } = await (0, get_composition_id_1.getCompositionId)(comps);
116
104
  renderer_1.RenderInternals.validateEvenDimensionsWithCodec({
117
105
  width: config.width,
118
106
  height: config.height,
119
107
  codec,
120
108
  scale,
121
109
  });
110
+ const relativeOutputLocation = (0, get_filename_1.getOutputFilename)({
111
+ codec,
112
+ imageSequence: shouldOutputImageSequence,
113
+ compositionName: compositionId,
114
+ defaultExtension: renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'),
115
+ });
116
+ log_1.Log.info(chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
117
+ const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
122
118
  const outputDir = shouldOutputImageSequence
123
119
  ? absoluteOutputFile
124
120
  : await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-render'));
@@ -0,0 +1,7 @@
1
+ import type { getCompositions } from '@remotion/renderer';
2
+ export declare type Await<T> = T extends PromiseLike<infer U> ? U : T;
3
+ export declare const selectComposition: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<{
4
+ compositionId: string;
5
+ reason: string;
6
+ }>;
7
+ export declare const selectCompositions: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<string[]>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectCompositions = exports.selectComposition = void 0;
4
+ const composition_prompts_1 = require("./composition-prompts");
5
+ const chalk_1 = require("./chalk");
6
+ const selectComposition = async (validCompositions) => {
7
+ if (validCompositions.length === 1) {
8
+ const onlyComposition = validCompositions[0];
9
+ if (onlyComposition) {
10
+ return {
11
+ compositionId: onlyComposition.id,
12
+ reason: 'Only composition',
13
+ };
14
+ }
15
+ }
16
+ const selectedComposition = (await (0, composition_prompts_1.selectAsync)({
17
+ message: 'Select composition:',
18
+ optionsPerPage: 5,
19
+ type: 'select',
20
+ choices: validCompositions.map((comp) => {
21
+ return {
22
+ value: comp.id,
23
+ title: chalk_1.chalk.bold(comp.id),
24
+ };
25
+ }),
26
+ }));
27
+ return { compositionId: selectedComposition, reason: 'Selected' };
28
+ };
29
+ exports.selectComposition = selectComposition;
30
+ const selectCompositions = async (validCompositions) => {
31
+ if (validCompositions.length === 1) {
32
+ const onlyComposition = validCompositions[0];
33
+ if (onlyComposition) {
34
+ return [onlyComposition.id];
35
+ }
36
+ }
37
+ const selectedComposition = await (0, composition_prompts_1.selectAsync)({
38
+ message: 'Select compositions:',
39
+ optionsPerPage: 5,
40
+ type: 'multiselect',
41
+ min: 1,
42
+ choices: validCompositions.map((comp) => {
43
+ return {
44
+ value: comp.id,
45
+ title: chalk_1.chalk.bold(comp.id),
46
+ };
47
+ }),
48
+ });
49
+ return selectedComposition;
50
+ };
51
+ exports.selectCompositions = selectCompositions;
package/dist/still.js CHANGED
@@ -35,7 +35,6 @@ const still = async (remotionRoot) => {
35
35
  codec: 'h264',
36
36
  });
37
37
  log_1.Log.verbose('Browser executable: ', browserExecutable);
38
- const compositionId = (0, get_composition_id_1.getCompositionId)();
39
38
  const { format: imageFormat, source } = (0, determine_image_format_1.determineFinalImageFormat)({
40
39
  cliFlag: (_a = parse_command_line_1.parsedCli['image-format']) !== null && _a !== void 0 ? _a : null,
41
40
  configImageFormat: (_b = config_1.ConfigInternals.getUserPreferredImageFormat()) !== null && _b !== void 0 ? _b : null,
@@ -43,21 +42,12 @@ const still = async (remotionRoot) => {
43
42
  outName: (0, user_passed_output_location_1.getUserPassedOutputLocation)(),
44
43
  isLambda: false,
45
44
  });
46
- const relativeOutputLocation = (0, user_passed_output_location_1.getOutputLocation)({
47
- compositionId,
48
- defaultExtension: imageFormat,
49
- });
50
- const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
51
- log_1.Log.info(chalk_1.chalk.gray(`Output = ${relativeOutputLocation}, Format = ${imageFormat} (${source}), Composition = ${compositionId}`));
52
45
  const browserInstance = (0, renderer_1.openBrowser)(browser, {
53
46
  browserExecutable,
54
47
  chromiumOptions,
55
48
  shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
56
49
  forceDeviceScaleFactor: scale,
57
50
  });
58
- (0, fs_1.mkdirSync)(path_1.default.join(absoluteOutputLocation, '..'), {
59
- recursive: true,
60
- });
61
51
  const steps = [
62
52
  renderer_1.RenderInternals.isServeUrl(fullPath) ? null : 'bundling',
63
53
  'rendering',
@@ -77,10 +67,16 @@ const still = async (remotionRoot) => {
77
67
  ffprobeExecutable,
78
68
  downloadMap,
79
69
  });
80
- const composition = comps.find((c) => c.id === compositionId);
81
- if (!composition) {
82
- throw new Error(`Cannot find composition with ID ${compositionId}`);
83
- }
70
+ const { compositionId, config, reason } = await (0, get_composition_id_1.getCompositionId)(comps);
71
+ const relativeOutputLocation = (0, user_passed_output_location_1.getOutputLocation)({
72
+ compositionId,
73
+ defaultExtension: imageFormat,
74
+ });
75
+ const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
76
+ (0, fs_1.mkdirSync)(path_1.default.join(absoluteOutputLocation, '..'), {
77
+ recursive: true,
78
+ });
79
+ log_1.Log.info(chalk_1.chalk.gray(`Output = ${relativeOutputLocation}, Format = ${imageFormat} (${source}), Composition = ${compositionId} (${reason})`));
84
80
  const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
85
81
  const renderStart = Date.now();
86
82
  const downloads = [];
@@ -117,7 +113,7 @@ const still = async (remotionRoot) => {
117
113
  };
118
114
  };
119
115
  await (0, renderer_1.renderStill)({
120
- composition,
116
+ composition: config,
121
117
  frame: stillFrame,
122
118
  output: absoluteOutputLocation,
123
119
  serveUrl: urlOrBundle,
@@ -0,0 +1,3 @@
1
+ export declare const checkAndValidateFfmpegVersion: (options: {
2
+ ffmpegExecutable: string | null;
3
+ }) => Promise<void>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkAndValidateFfmpegVersion = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ const log_1 = require("./log");
6
+ const warn_about_ffmpeg_version_1 = require("./warn-about-ffmpeg-version");
7
+ const checkAndValidateFfmpegVersion = async (options) => {
8
+ const ffmpegVersion = await renderer_1.RenderInternals.getFfmpegVersion({
9
+ ffmpegExecutable: options.ffmpegExecutable,
10
+ });
11
+ const buildConf = await renderer_1.RenderInternals.getFfmpegBuildInfo({
12
+ ffmpegExecutable: options.ffmpegExecutable,
13
+ });
14
+ log_1.Log.verbose('Your FFMPEG version:', ffmpegVersion ? ffmpegVersion.join('.') : 'Built from source');
15
+ (0, warn_about_ffmpeg_version_1.warnAboutFfmpegVersion)({ ffmpegVersion, buildConf });
16
+ };
17
+ exports.checkAndValidateFfmpegVersion = checkAndValidateFfmpegVersion;
@@ -0,0 +1,5 @@
1
+ import type { FfmpegVersion } from '@remotion/renderer';
2
+ export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
3
+ ffmpegVersion: FfmpegVersion;
4
+ buildConf: string | null;
5
+ }) => null | undefined;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.warnAboutFfmpegVersion = void 0;
4
+ const log_1 = require("./log");
5
+ const printMessage = (ffmpegVersion) => {
6
+ log_1.Log.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
7
+ log_1.Log.warn(' For audio support, you need at least version 4.1.0.');
8
+ log_1.Log.warn(' Upgrade FFMPEG to get rid of this warning.');
9
+ };
10
+ const printBuildConfMessage = () => {
11
+ log_1.Log.error('⚠️ Unsupported FFMPEG version detected.');
12
+ log_1.Log.error(" Your version doesn't support the -buildconf flag");
13
+ log_1.Log.error(' Audio will not be supported and you may experience other issues.');
14
+ log_1.Log.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
15
+ };
16
+ const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
17
+ if (buildConf === null) {
18
+ printBuildConfMessage();
19
+ return;
20
+ }
21
+ if (ffmpegVersion === null) {
22
+ return null;
23
+ }
24
+ const [major, minor] = ffmpegVersion;
25
+ // 3.x and below definitely is too old
26
+ if (major < 4) {
27
+ printMessage(ffmpegVersion);
28
+ return;
29
+ }
30
+ // 5.x will be all good
31
+ if (major > 4) {
32
+ return;
33
+ }
34
+ if (minor < 1) {
35
+ printMessage(ffmpegVersion);
36
+ }
37
+ };
38
+ exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.2.35-crf.3+08916235b",
3
+ "version": "3.2.36",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -22,15 +22,16 @@
22
22
  "author": "Jonny Burger <jonny@remotion.dev>",
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "dependencies": {
25
- "@remotion/bundler": "3.2.35-crf.3+08916235b",
26
- "@remotion/media-utils": "3.2.35-crf.3+08916235b",
27
- "@remotion/player": "3.2.35-crf.3+08916235b",
28
- "@remotion/renderer": "3.2.35-crf.3+08916235b",
25
+ "@remotion/bundler": "3.2.36",
26
+ "@remotion/media-utils": "3.2.36",
27
+ "@remotion/player": "3.2.36",
28
+ "@remotion/renderer": "3.2.36",
29
29
  "better-opn": "2.1.1",
30
30
  "dotenv": "9.0.2",
31
31
  "memfs": "3.4.3",
32
32
  "minimist": "1.2.6",
33
- "remotion": "3.2.35-crf.3+08916235b",
33
+ "prompts": "2.4.1",
34
+ "remotion": "3.2.36",
34
35
  "semver": "7.3.5",
35
36
  "source-map": "0.6.1"
36
37
  },
@@ -42,6 +43,7 @@
42
43
  "@jonny/eslint-config": "3.0.266",
43
44
  "@types/minimist": "^1.2.2",
44
45
  "@types/node": "^16.7.5",
46
+ "@types/prompts": "^2.4.1",
45
47
  "@types/react": "18.0.1",
46
48
  "@types/react-dom": "18.0.0",
47
49
  "@types/semver": "^7.3.4",
@@ -70,5 +72,5 @@
70
72
  "publishConfig": {
71
73
  "access": "public"
72
74
  },
73
- "gitHead": "08916235b80e2f2bee603e2ba0ea8827b436cf8c"
75
+ "gitHead": "69d6e23f17b14509aee4d327b3481fd4e15df4a4"
74
76
  }