@remotion/cli 4.0.51 → 4.0.52

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 (41) hide show
  1. package/dist/benchmark.js +9 -8
  2. package/dist/config/image-format.d.ts +1 -1
  3. package/dist/config/index.d.ts +1 -1
  4. package/dist/config/log.d.ts +1 -1
  5. package/dist/editor/components/CurrentComposition.d.ts +0 -1
  6. package/dist/editor/components/Modals.js +1 -1
  7. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
  8. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  9. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  10. package/dist/editor/components/RenderButton.js +2 -19
  11. package/dist/editor/components/RenderModal/RenderModal.d.ts +2 -6
  12. package/dist/editor/components/RenderModal/RenderModal.js +25 -1
  13. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  14. package/dist/editor/components/SidebarRenderButton.js +3 -28
  15. package/dist/editor/components/UpdateCheck.d.ts +0 -1
  16. package/dist/editor/helpers/colors.d.ts +1 -1
  17. package/dist/editor/helpers/render-modal-sections.d.ts +0 -1
  18. package/dist/editor/state/modals.d.ts +2 -6
  19. package/dist/get-cli-options.d.ts +2 -2
  20. package/dist/get-cli-options.js +12 -3
  21. package/dist/get-final-output-codec.d.ts +2 -1
  22. package/dist/get-final-output-codec.js +4 -1
  23. package/dist/gpu.d.ts +2 -0
  24. package/dist/gpu.js +43 -0
  25. package/dist/index.d.ts +15 -14
  26. package/dist/index.js +4 -0
  27. package/dist/list-of-remotion-packages.js +1 -0
  28. package/dist/log.d.ts +4 -4
  29. package/dist/make-on-download.d.ts +3 -1
  30. package/dist/make-on-download.js +3 -1
  31. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  32. package/dist/preview-server/render-queue/get-default-video-contexts.d.ts +8 -4
  33. package/dist/preview-server/render-queue/get-default-video-contexts.js +21 -5
  34. package/dist/preview-server/render-queue/make-retry-payload.js +6 -28
  35. package/dist/preview-server/routes.d.ts +0 -1
  36. package/dist/print-help.js +37 -66
  37. package/dist/progress-bar.d.ts +2 -1
  38. package/dist/progress-bar.js +4 -3
  39. package/dist/render-flows/render.js +8 -1
  40. package/dist/render-flows/still.js +18 -4
  41. package/package.json +8 -8
package/dist/benchmark.js CHANGED
@@ -84,7 +84,7 @@ const makeBenchmarkProgressBar = ({ totalRuns, run, progress, doneIn, }) => {
84
84
  ].join(' ');
85
85
  };
86
86
  const benchmarkCommand = async (remotionRoot, args) => {
87
- var _a, _b;
87
+ var _a, _b, _c;
88
88
  const runs = (_a = parse_command_line_1.parsedCli.runs) !== null && _a !== void 0 ? _a : DEFAULT_RUNS;
89
89
  const { file, reason, remainingArgs } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
90
90
  if (!file) {
@@ -165,14 +165,15 @@ const benchmarkCommand = async (remotionRoot, args) => {
165
165
  }
166
166
  const benchmark = {};
167
167
  let count = 1;
168
- const { codec, reason: codecReason } = (0, get_final_output_codec_1.getFinalOutputCodec)({
169
- cliFlag: parse_command_line_1.parsedCli.codec,
170
- downloadName: null,
171
- outName: null,
172
- configFile: (_b = config_1.ConfigInternals.getOutputCodecOrUndefined()) !== null && _b !== void 0 ? _b : null,
173
- uiCodec: null,
174
- });
175
168
  for (const composition of compositions) {
169
+ const { codec, reason: codecReason } = (0, get_final_output_codec_1.getFinalOutputCodec)({
170
+ cliFlag: parse_command_line_1.parsedCli.codec,
171
+ downloadName: null,
172
+ outName: null,
173
+ configFile: (_b = config_1.ConfigInternals.getOutputCodecOrUndefined()) !== null && _b !== void 0 ? _b : null,
174
+ uiCodec: null,
175
+ compositionCodec: (_c = composition.defaultCodec) !== null && _c !== void 0 ? _c : null,
176
+ });
176
177
  const concurrency = getValidConcurrency(unparsedConcurrency);
177
178
  benchmark[composition.id] = {};
178
179
  for (const con of concurrency) {
@@ -2,4 +2,4 @@ import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
2
2
  export declare const setStillImageFormat: (format: StillImageFormat) => void;
3
3
  export declare const setVideoImageFormat: (format: VideoImageFormat) => void;
4
4
  export declare const getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
5
- export declare const getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
5
+ export declare const getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
@@ -316,7 +316,7 @@ export declare const ConfigInternals: {
316
316
  getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
317
317
  getDotEnvLocation: () => string | null;
318
318
  getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
319
- getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
319
+ getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
320
320
  getWebpackOverrideFn: () => WebpackOverrideFn;
321
321
  getWebpackCaching: () => boolean;
322
322
  getOutputLocation: () => string | null;
@@ -1 +1 @@
1
- export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error", setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
1
+ export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn", setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const CurrentComposition: () => JSX.Element;
@@ -16,7 +16,7 @@ const UpdateModal_1 = require("./UpdateModal/UpdateModal");
16
16
  const Modals = () => {
17
17
  const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
18
18
  const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type === 'connected';
19
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialVideoCodecForAudioTab: modalContextType.initialVideoCodecForAudioTab, initialVideoCodecForVideoTab: modalContextType.initialVideoCodecForVideoTab, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialAudioCodec: modalContextType.initialAudioCodec, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux })), modalContextType &&
19
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec })), modalContextType &&
20
20
  canRender &&
21
21
  modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
22
22
  };
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
12
12
  status: 'error' | 'warning' | 'ok';
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
- }) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
16
- export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
15
+ }) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "#f1c40f" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)";
16
+ export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
4
4
  status: RemInputStatus;
5
5
  name: string;
6
6
  };
7
- export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
7
+ export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
8
8
  export {};
@@ -3,5 +3,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaEleme
3
3
  status: 'error' | 'warning' | 'ok';
4
4
  };
5
5
  export declare const inputBaseStyle: React.CSSProperties;
6
- export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
6
+ export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
7
7
  export {};
@@ -2,12 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const client_1 = require("@remotion/renderer/client");
6
5
  const react_1 = require("react");
7
6
  const remotion_1 = require("remotion");
8
- const get_default_out_name_1 = require("../../get-default-out-name");
9
7
  const Button_1 = require("../../preview-server/error-overlay/remotion-overlay/Button");
10
- const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
11
8
  const client_id_1 = require("../helpers/client-id");
12
9
  const use_keybinding_1 = require("../helpers/use-keybinding");
13
10
  const render_1 = require("../icons/render");
@@ -48,34 +45,19 @@ const RenderButton = () => {
48
45
  if (!video) {
49
46
  return null;
50
47
  }
51
- const isVideo = video.durationInFrames > 1;
52
48
  const defaults = window.remotion_renderDefaults;
53
49
  if (!defaults) {
54
50
  throw new TypeError('Expected defaults');
55
51
  }
56
- const { initialAudioCodec, initialRenderType, initialVideoCodec } = (0, get_default_video_contexts_1.getDefaultCodecs)({
57
- defaultCodec: defaults.codec,
58
- renderType: isVideo ? 'video' : 'still',
59
- });
60
52
  setSelectedModal({
61
53
  type: 'render',
62
54
  compositionId: video.id,
63
55
  initialFrame: frame,
64
56
  initialStillImageFormat: defaults.stillImageFormat,
65
57
  initialVideoImageFormat: defaults.videoImageFormat,
66
- initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
67
- compositionName: video.id,
68
- defaultExtension: isVideo
69
- ? client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec)
70
- : defaults.stillImageFormat,
71
- type: 'asset',
72
- }),
73
58
  initialJpegQuality: defaults.jpegQuality,
74
59
  initialScale: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : 1,
75
60
  initialVerbose: defaults.logLevel === 'verbose',
76
- initialVideoCodecForAudioTab: initialAudioCodec,
77
- initialRenderType,
78
- initialVideoCodecForVideoTab: initialVideoCodec,
79
61
  initialConcurrency: defaults.concurrency,
80
62
  maxConcurrency: defaults.maxConcurrency,
81
63
  minConcurrency: defaults.minConcurrency,
@@ -89,7 +71,7 @@ const RenderButton = () => {
89
71
  initialEveryNthFrame: defaults.everyNthFrame,
90
72
  initialNumberOfGifLoops: defaults.numberOfGifLoops,
91
73
  initialDelayRenderTimeout: defaults.delayRenderTimeout,
92
- initialAudioCodec: defaults.audioCodec,
74
+ defaultConfigurationAudioCodec: defaults.audioCodec,
93
75
  initialEnvVariables: window.process.env,
94
76
  initialDisableWebSecurity: defaults.disableWebSecurity,
95
77
  initialOpenGlRenderer: defaults.openGlRenderer,
@@ -101,6 +83,7 @@ const RenderButton = () => {
101
83
  outFrameMark: outFrame,
102
84
  initialColorSpace: defaults.colorSpace,
103
85
  initialMultiProcessOnLinux: defaults.multiProcessOnLinux,
86
+ defaultConfigurationVideoCodec: defaults.codec,
104
87
  });
105
88
  }, [video, setSelectedModal, frame, props, inFrame, outFrame]);
106
89
  if (!video) {
@@ -1,6 +1,5 @@
1
1
  import type { AudioCodec, Codec, ColorSpace, OpenGlRenderer, PixelFormat, ProResProfile, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
2
2
  import React from 'react';
3
- import type { RenderType } from './RenderModalAdvanced';
4
3
  type RenderModalProps = {
5
4
  compositionId: string;
6
5
  initialFrame: number;
@@ -9,11 +8,6 @@ type RenderModalProps = {
9
8
  initialJpegQuality: number;
10
9
  initialScale: number;
11
10
  initialVerbose: boolean;
12
- initialOutName: string;
13
- initialRenderType: RenderType;
14
- initialVideoCodecForAudioTab: Codec;
15
- initialVideoCodecForVideoTab: Codec;
16
- initialAudioCodec: AudioCodec | null;
17
11
  initialConcurrency: number;
18
12
  minConcurrency: number;
19
13
  maxConcurrency: number;
@@ -38,6 +32,8 @@ type RenderModalProps = {
38
32
  inFrameMark: number | null;
39
33
  outFrameMark: number | null;
40
34
  initialMultiProcessOnLinux: boolean;
35
+ defaultConfigurationVideoCodec: Codec | null;
36
+ defaultConfigurationAudioCodec: AudioCodec | null;
41
37
  };
42
38
  export declare const RenderModalWithLoader: React.FC<RenderModalProps>;
43
39
  export {};
@@ -16,6 +16,8 @@ const file_1 = require("../../icons/file");
16
16
  const frame_1 = require("../../icons/frame");
17
17
  const gear_1 = require("../../icons/gear");
18
18
  const gif_1 = require("../../icons/gif");
19
+ const get_default_out_name_1 = require("../../../get-default-out-name");
20
+ const get_default_video_contexts_1 = require("../../../preview-server/render-queue/get-default-video-contexts");
19
21
  const colors_1 = require("../../helpers/colors");
20
22
  const modals_1 = require("../../state/modals");
21
23
  const sidebar_1 = require("../../state/sidebar");
@@ -114,8 +116,21 @@ const outer = {
114
116
  display: 'flex',
115
117
  flexDirection: 'column',
116
118
  };
117
- const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialx264Preset, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialOffthreadVideoCacheSizeInBytes, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, defaultProps, inFrameMark, outFrameMark, onClose, resolvedComposition, unresolvedComposition, initialColorSpace, initialMultiProcessOnLinux, }) => {
119
+ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialx264Preset, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialOffthreadVideoCacheSizeInBytes, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, defaultProps, inFrameMark, outFrameMark, onClose, resolvedComposition, unresolvedComposition, initialColorSpace, initialMultiProcessOnLinux, defaultConfigurationAudioCodec, defaultConfigurationVideoCodec, }) => {
118
120
  const isMounted = (0, react_1.useRef)(true);
121
+ const [isVideo] = (0, react_1.useState)(() => {
122
+ return typeof resolvedComposition.durationInFrames === 'undefined'
123
+ ? true
124
+ : resolvedComposition.durationInFrames > 1;
125
+ });
126
+ const [{ initialAudioCodec, initialRenderType, initialVideoCodec, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, },] = (0, react_1.useState)(() => {
127
+ return (0, get_default_video_contexts_1.getDefaultCodecs)({
128
+ defaultConfigurationVideoCodec,
129
+ compositionDefaultVideoCodec: resolvedComposition.defaultCodec,
130
+ defaultConfigurationAudioCodec,
131
+ renderType: isVideo ? 'video' : 'still',
132
+ });
133
+ });
119
134
  const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
120
135
  const [unclampedFrame, setFrame] = (0, react_1.useState)(() => initialFrame);
121
136
  const [saving, setSaving] = (0, react_1.useState)(false);
@@ -126,6 +141,15 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
126
141
  const [videoCodecForVideoTab, setVideoCodecForVideoTab] = (0, react_1.useState)(() => initialVideoCodecForVideoTab);
127
142
  const [userSelectedAudioCodec, setUserSelectedAudioCodec] = (0, react_1.useState)(() => initialAudioCodec);
128
143
  const [envVariables, setEnvVariables] = (0, react_1.useState)(() => (0, convert_env_variables_1.envVariablesObjectToArray)(initialEnvVariables).filter(([key]) => key !== 'NODE_ENV'));
144
+ const [initialOutName] = (0, react_1.useState)(() => {
145
+ return (0, get_default_out_name_1.getDefaultOutLocation)({
146
+ compositionName: resolvedComposition.id,
147
+ defaultExtension: isVideo
148
+ ? client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, initialAudioCodec)
149
+ : initialStillImageFormat,
150
+ type: 'asset',
151
+ });
152
+ });
129
153
  const [videoCodecForAudioTab, setVideoCodecForAudioTab] = (0, react_1.useState)(() => initialVideoCodecForAudioTab);
130
154
  const [mutedState, setMuted] = (0, react_1.useState)(() => initialMuted);
131
155
  const [enforceAudioTrackState, setEnforceAudioTrackState] = (0, react_1.useState)(() => initialEnforceAudioTrack);
@@ -1,2 +1,2 @@
1
1
  import type { Codec } from '@remotion/renderer';
2
- export declare const humanReadableCodec: (codec: Codec) => "GIF" | "AAC" | "MP3" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
2
+ export declare const humanReadableCodec: (codec: Codec) => "AAC" | "MP3" | "GIF" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
@@ -2,11 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SidebarRenderButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const client_1 = require("@remotion/renderer/client");
6
5
  const react_1 = require("react");
7
6
  const remotion_1 = require("remotion");
8
- const get_default_out_name_1 = require("../../get-default-out-name");
9
- const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
10
7
  const client_id_1 = require("../helpers/client-id");
11
8
  const render_1 = require("../icons/render");
12
9
  const modals_1 = require("../state/modals");
@@ -22,9 +19,6 @@ const SidebarRenderButton = ({ composition, visible }) => {
22
19
  }, []);
23
20
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
24
21
  const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
25
- const isVideo = typeof composition.durationInFrames === 'undefined'
26
- ? true
27
- : composition.durationInFrames > 1;
28
22
  const onClick = (0, react_1.useCallback)((e) => {
29
23
  var _a;
30
24
  const defaults = window.remotion_renderDefaults;
@@ -32,10 +26,6 @@ const SidebarRenderButton = ({ composition, visible }) => {
32
26
  throw new Error('expected defaults');
33
27
  }
34
28
  e.stopPropagation();
35
- const { initialAudioCodec, initialRenderType, initialVideoCodec } = (0, get_default_video_contexts_1.getDefaultCodecs)({
36
- defaultCodec: defaults.codec,
37
- renderType: isVideo ? 'video' : 'still',
38
- });
39
29
  setSelectedModal({
40
30
  type: 'render',
41
31
  compositionId: composition.id,
@@ -45,16 +35,6 @@ const SidebarRenderButton = ({ composition, visible }) => {
45
35
  initialJpegQuality: defaults.jpegQuality,
46
36
  initialScale: defaults.scale,
47
37
  initialVerbose: defaults.logLevel === 'verbose',
48
- initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
49
- compositionName: composition.id,
50
- defaultExtension: isVideo
51
- ? client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec)
52
- : defaults.stillImageFormat,
53
- type: 'asset',
54
- }),
55
- initialVideoCodecForAudioTab: initialAudioCodec,
56
- initialRenderType,
57
- initialVideoCodecForVideoTab: initialVideoCodec,
58
38
  initialConcurrency: defaults.concurrency,
59
39
  maxConcurrency: defaults.maxConcurrency,
60
40
  minConcurrency: defaults.minConcurrency,
@@ -68,7 +48,7 @@ const SidebarRenderButton = ({ composition, visible }) => {
68
48
  initialEveryNthFrame: defaults.everyNthFrame,
69
49
  initialNumberOfGifLoops: defaults.numberOfGifLoops,
70
50
  initialDelayRenderTimeout: defaults.delayRenderTimeout,
71
- initialAudioCodec: defaults.audioCodec,
51
+ defaultConfigurationAudioCodec: defaults.audioCodec,
72
52
  initialEnvVariables: window.process.env,
73
53
  initialDisableWebSecurity: defaults.disableWebSecurity,
74
54
  initialOpenGlRenderer: defaults.openGlRenderer,
@@ -80,14 +60,9 @@ const SidebarRenderButton = ({ composition, visible }) => {
80
60
  outFrameMark: null,
81
61
  initialColorSpace: defaults.colorSpace,
82
62
  initialMultiProcessOnLinux: defaults.multiProcessOnLinux,
63
+ defaultConfigurationVideoCodec: defaults.codec,
83
64
  });
84
- }, [
85
- composition.defaultProps,
86
- composition.id,
87
- isVideo,
88
- props,
89
- setSelectedModal,
90
- ]);
65
+ }, [composition.defaultProps, composition.id, props, setSelectedModal]);
91
66
  const renderAction = (0, react_1.useCallback)((color) => {
92
67
  return (0, jsx_runtime_1.jsx)(render_1.ThinRenderIcon, { fill: color, svgProps: iconStyle });
93
68
  }, [iconStyle]);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { PackageManager } from '../../preview-server/get-package-manager';
3
2
  export type UpdateInfo = {
4
3
  currentVersion: string;
@@ -16,4 +16,4 @@ export declare const BLUE_DISABLED = "#284f73";
16
16
  export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
17
17
  selected: boolean;
18
18
  hovered: boolean;
19
- }) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
19
+ }) => "transparent" | "hsla(0, 0%, 100%, 0.25)" | "hsla(0, 0%, 100%, 0.15)" | "rgba(255, 255, 255, 0.06)";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Codec } from '@remotion/renderer';
3
2
  import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
4
3
  type Section = 'general' | 'picture' | 'advanced' | 'data' | 'gif' | 'audio';
@@ -1,7 +1,6 @@
1
1
  import type { AudioCodec, Codec, ColorSpace, OpenGlRenderer, PixelFormat, ProResProfile, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
2
2
  import type React from 'react';
3
3
  import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
4
- import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
5
4
  import type { Bug, UpdateInfo } from '../components/UpdateCheck';
6
5
  export type CompType = 'composition' | 'still';
7
6
  export type RenderModalState = {
@@ -11,13 +10,8 @@ export type RenderModalState = {
11
10
  initialStillImageFormat: StillImageFormat;
12
11
  initialVideoImageFormat: VideoImageFormat;
13
12
  initialJpegQuality: number;
14
- initialOutName: string;
15
13
  initialScale: number;
16
14
  initialVerbose: boolean;
17
- initialRenderType: RenderType;
18
- initialVideoCodecForAudioTab: Codec;
19
- initialVideoCodecForVideoTab: Codec;
20
- initialAudioCodec: AudioCodec | null;
21
15
  initialConcurrency: number;
22
16
  initialMuted: boolean;
23
17
  initialEnforceAudioTrack: boolean;
@@ -42,6 +36,8 @@ export type RenderModalState = {
42
36
  defaultProps: Record<string, unknown>;
43
37
  inFrameMark: number | null;
44
38
  outFrameMark: number | null;
39
+ defaultConfigurationVideoCodec: Codec;
40
+ defaultConfigurationAudioCodec: AudioCodec | null;
45
41
  };
46
42
  export type ModalState = {
47
43
  type: 'new-comp';
@@ -21,7 +21,7 @@ export declare const getCliOptions: (options: {
21
21
  numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
22
22
  stillFrame: number;
23
23
  browserExecutable: BrowserExecutable;
24
- logLevel: "verbose" | "info" | "warn" | "error";
24
+ logLevel: "error" | "verbose" | "info" | "warn";
25
25
  scale: number;
26
26
  chromiumOptions: ChromiumOptions;
27
27
  overwrite: boolean;
@@ -34,7 +34,7 @@ export declare const getCliOptions: (options: {
34
34
  videoBitrate: string | null;
35
35
  height: number | null;
36
36
  width: number | null;
37
- configFileImageFormat: "png" | "jpeg" | "none" | undefined;
37
+ configFileImageFormat: "none" | "png" | "jpeg" | undefined;
38
38
  offthreadVideoCacheSizeInBytes: number | null;
39
39
  deleteAfter: ("1-day" | "3-days" | "7-days" | "30-days") | null;
40
40
  colorSpace: "default" | "bt709";
@@ -48,10 +48,14 @@ const getx264Preset = () => {
48
48
  const x264Preset = config_1.ConfigInternals.getPresetProfile();
49
49
  return x264Preset;
50
50
  };
51
- const getAndValidateBrowser = async (browserExecutable) => {
51
+ const getAndValidateBrowser = async ({ browserExecutable, indent, logLevel, }) => {
52
52
  const browser = getBrowser();
53
53
  try {
54
- await renderer_1.RenderInternals.ensureLocalBrowser(browserExecutable);
54
+ await renderer_1.RenderInternals.ensureLocalBrowser({
55
+ preferredBrowserExecutable: browserExecutable,
56
+ indent,
57
+ logLevel,
58
+ });
55
59
  }
56
60
  catch (err) {
57
61
  log_1.Log.error('Could not download a browser for rendering frames.');
@@ -97,6 +101,7 @@ const getCliOptions = async (options) => {
97
101
  setting: 'concurrency',
98
102
  checkIfValidForCurrentMachine: false,
99
103
  });
104
+ const logLevel = config_1.ConfigInternals.Logging.getLogLevel();
100
105
  return {
101
106
  puppeteerTimeout: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
102
107
  concurrency,
@@ -105,7 +110,11 @@ const getCliOptions = async (options) => {
105
110
  inputProps: (0, get_input_props_1.getInputProps)(null),
106
111
  envVariables: await (0, get_env_1.getEnvironmentVariables)(null),
107
112
  jpegQuality: config_1.ConfigInternals.getJpegQuality(),
108
- browser: await getAndValidateBrowser(browserExecutable),
113
+ browser: await getAndValidateBrowser({
114
+ browserExecutable,
115
+ indent: false,
116
+ logLevel,
117
+ }),
109
118
  crf,
110
119
  pixelFormat,
111
120
  proResProfile,
@@ -1,10 +1,11 @@
1
1
  import type { Codec, CodecOrUndefined } from '@remotion/renderer';
2
- export declare const getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
2
+ export declare const getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, compositionCodec, }: {
3
3
  cliFlag: CodecOrUndefined;
4
4
  outName: string | null;
5
5
  downloadName: string | null;
6
6
  configFile: Codec | null;
7
7
  uiCodec: Codec | null;
8
+ compositionCodec: Codec | null;
8
9
  }) => {
9
10
  codec: Codec;
10
11
  reason: string;
@@ -12,7 +12,7 @@ const deriveCodecsFromFilename = (extension) => {
12
12
  possible: (_b = renderer_1.RenderInternals.makeFileExtensionMap()[extension]) !== null && _b !== void 0 ? _b : [],
13
13
  };
14
14
  };
15
- const getFinalOutputCodec = ({ cliFlag, configFile, downloadName, outName, uiCodec, }) => {
15
+ const getFinalOutputCodec = ({ cliFlag, configFile, downloadName, outName, uiCodec, compositionCodec, }) => {
16
16
  if (uiCodec) {
17
17
  return { codec: uiCodec, reason: 'via UI' };
18
18
  }
@@ -49,6 +49,9 @@ const getFinalOutputCodec = ({ cliFlag, configFile, downloadName, outName, uiCod
49
49
  reason: 'derived from out name',
50
50
  };
51
51
  }
52
+ if (compositionCodec) {
53
+ return { codec: compositionCodec, reason: 'via calculateMetadata' };
54
+ }
52
55
  if (configFile) {
53
56
  return {
54
57
  codec: configFile,
package/dist/gpu.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const GPU_COMMAND = "gpu";
2
+ export declare const gpuCommand: (remotionRoot: string) => Promise<void>;
package/dist/gpu.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gpuCommand = exports.GPU_COMMAND = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ const chalk_1 = require("./chalk");
6
+ const get_cli_options_1 = require("./get-cli-options");
7
+ const log_1 = require("./log");
8
+ exports.GPU_COMMAND = 'gpu';
9
+ const gpuCommand = async (remotionRoot) => {
10
+ const { browserExecutable, logLevel, chromiumOptions } = await (0, get_cli_options_1.getCliOptions)({
11
+ isLambda: false,
12
+ remotionRoot,
13
+ type: 'get-compositions',
14
+ });
15
+ const statuses = await renderer_1.RenderInternals.getChromiumGpuInformation({
16
+ browserExecutable,
17
+ indent: false,
18
+ logLevel,
19
+ chromiumOptions,
20
+ });
21
+ for (const { feature, status } of statuses) {
22
+ log_1.Log.info(`${feature}: ${colorStatus(status)}`);
23
+ }
24
+ };
25
+ exports.gpuCommand = gpuCommand;
26
+ const colorStatus = (status) => {
27
+ if (status === 'Enabled') {
28
+ return chalk_1.chalk.green(status);
29
+ }
30
+ if (status === 'Hardware accelerated') {
31
+ return chalk_1.chalk.green(status);
32
+ }
33
+ if (status === 'Disabled') {
34
+ return chalk_1.chalk.red(status);
35
+ }
36
+ if (status === 'Software only. Hardware acceleration disabled') {
37
+ return chalk_1.chalk.red(status);
38
+ }
39
+ if (status === 'Software only, hardware acceleration unavailable') {
40
+ return chalk_1.chalk.red(status);
41
+ }
42
+ return status;
43
+ };
package/dist/index.d.ts CHANGED
@@ -63,24 +63,24 @@ export declare const CliInternals: {
63
63
  verbose: (message?: any, ...optionalParams: any[]) => void;
64
64
  verboseAdvanced: (options: {
65
65
  indent: boolean;
66
- logLevel: "verbose" | "info" | "warn" | "error";
66
+ logLevel: "error" | "verbose" | "info" | "warn";
67
67
  } & {
68
68
  tag?: string | undefined;
69
69
  }, message?: any, ...optionalParams: any[]) => void;
70
70
  info: (message?: any, ...optionalParams: any[]) => void;
71
71
  infoAdvanced: (options: {
72
72
  indent: boolean;
73
- logLevel: "verbose" | "info" | "warn" | "error";
73
+ logLevel: "error" | "verbose" | "info" | "warn";
74
74
  }, message?: any, ...optionalParams: any[]) => void;
75
75
  warn: (message?: any, ...optionalParams: any[]) => void;
76
76
  warnAdvanced: (options: {
77
77
  indent: boolean;
78
- logLevel: "verbose" | "info" | "warn" | "error";
78
+ logLevel: "error" | "verbose" | "info" | "warn";
79
79
  }, message?: any, ...optionalParams: any[]) => void;
80
80
  error: (message?: any, ...optionalParams: any[]) => void;
81
81
  errorAdvanced: (options: {
82
82
  indent: boolean;
83
- logLevel: "verbose" | "info" | "warn" | "error";
83
+ logLevel: "error" | "verbose" | "info" | "warn";
84
84
  } & {
85
85
  tag?: string | undefined;
86
86
  }, message?: any, ...optionalParams: any[]) => void;
@@ -106,7 +106,7 @@ export declare const CliInternals: {
106
106
  numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
107
107
  stillFrame: number;
108
108
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
109
- logLevel: "verbose" | "info" | "warn" | "error";
109
+ logLevel: "error" | "verbose" | "info" | "warn";
110
110
  scale: number;
111
111
  chromiumOptions: import("@remotion/renderer").ChromiumOptions;
112
112
  overwrite: boolean;
@@ -119,7 +119,7 @@ export declare const CliInternals: {
119
119
  videoBitrate: string | null;
120
120
  height: number | null;
121
121
  width: number | null;
122
- configFileImageFormat: "png" | "jpeg" | "none" | undefined;
122
+ configFileImageFormat: "none" | "png" | "jpeg" | undefined;
123
123
  offthreadVideoCacheSizeInBytes: number | null;
124
124
  deleteAfter: ("1-day" | "3-days" | "7-days" | "30-days") | null;
125
125
  colorSpace: "default" | "bt709";
@@ -131,7 +131,7 @@ export declare const CliInternals: {
131
131
  parsedCli: {
132
132
  "browser-executable": import("@remotion/renderer").BrowserExecutable;
133
133
  "pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
134
- "image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
134
+ "image-format": "none" | "png" | "jpeg" | "pdf" | "webp";
135
135
  "prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
136
136
  "x264-preset": "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
137
137
  "bundle-cache": string;
@@ -190,7 +190,7 @@ export declare const CliInternals: {
190
190
  } & {
191
191
  _: string[];
192
192
  };
193
- printError: (err: Error, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
193
+ printError: (err: Error, logLevel: "error" | "verbose" | "info" | "warn") => Promise<void>;
194
194
  formatBytes: (number: number, options?: Intl.NumberFormatOptions & {
195
195
  locale: string;
196
196
  bits?: boolean | undefined;
@@ -202,7 +202,7 @@ export declare const CliInternals: {
202
202
  downloadName: string | null;
203
203
  outName: string | null;
204
204
  configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
205
- cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
205
+ cliFlag: "none" | "png" | "jpeg" | "pdf" | "webp" | null;
206
206
  isLambda: boolean;
207
207
  fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
208
208
  }) => {
@@ -217,22 +217,23 @@ export declare const CliInternals: {
217
217
  };
218
218
  getVideoImageFormat: ({ codec, uiImageFormat, }: {
219
219
  codec: import("@remotion/renderer").CodecOrUndefined;
220
- uiImageFormat: "png" | "jpeg" | "none" | null;
221
- }) => "png" | "jpeg" | "none";
220
+ uiImageFormat: "none" | "png" | "jpeg" | null;
221
+ }) => "none" | "png" | "jpeg";
222
222
  printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
223
- getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
223
+ getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, compositionCodec, }: {
224
224
  cliFlag: import("@remotion/renderer").CodecOrUndefined;
225
225
  outName: string | null;
226
226
  downloadName: string | null;
227
227
  configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
228
228
  uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
229
+ compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
229
230
  }) => {
230
231
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
231
232
  reason: string;
232
233
  };
233
234
  listOfRemotionPackages: string[];
234
235
  shouldUseNonOverlayingLogger: ({ logLevel, }: {
235
- logLevel: "verbose" | "info" | "warn" | "error";
236
+ logLevel: "error" | "verbose" | "info" | "warn";
236
237
  }) => boolean;
237
238
  getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, offthreadVideoCacheSizeInBytes, }: {
238
239
  height: number | null;
@@ -247,7 +248,7 @@ export declare const CliInternals: {
247
248
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
248
249
  serveUrlOrWebpackUrl: string;
249
250
  indent: boolean;
250
- logLevel: "verbose" | "info" | "warn" | "error";
251
+ logLevel: "error" | "verbose" | "info" | "warn";
251
252
  serializedInputPropsWithCustomSchema: string;
252
253
  server: import("@remotion/renderer").RemotionServer;
253
254
  offthreadVideoCacheSizeInBytes: number | null;