remotion 4.0.0-alpha6 → 4.0.0-alpha8

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.
@@ -37,6 +37,11 @@ declare type EnhancedTSequenceData = {
37
37
  startMediaFrom: number;
38
38
  playbackRate: number;
39
39
  };
40
+ export declare type LoopDisplay = {
41
+ numberOfTimes: number;
42
+ startOffset: number;
43
+ durationInFrames: number;
44
+ };
40
45
  export declare type TSequence = {
41
46
  from: number;
42
47
  duration: number;
@@ -46,7 +51,7 @@ export declare type TSequence = {
46
51
  rootId: string;
47
52
  showInTimeline: boolean;
48
53
  nonce: number;
49
- showLoopTimesInTimeline: number | undefined;
54
+ loopDisplay: LoopDisplay | undefined;
50
55
  } & EnhancedTSequenceData;
51
56
  export declare type TAsset = {
52
57
  type: 'audio' | 'video';
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { LoopDisplay } from './CompositionManager.js';
2
3
  export declare type LayoutAndStyle = {
3
4
  layout: 'none';
4
5
  } | {
@@ -12,7 +13,7 @@ export declare type SequenceProps = {
12
13
  durationInFrames?: number;
13
14
  name?: string;
14
15
  showInTimeline?: boolean;
15
- showLoopTimesInTimeline?: number;
16
+ loopDisplay?: LoopDisplay;
16
17
  } & LayoutAndStyle;
17
18
  /**
18
19
  * @description A component that time-shifts its children and wraps them in an absolutely positioned <div>.
@@ -11,7 +11,7 @@ const nonce_js_1 = require("./nonce.js");
11
11
  const SequenceContext_js_1 = require("./SequenceContext.js");
12
12
  const timeline_position_state_js_1 = require("./timeline-position-state.js");
13
13
  const use_video_config_js_1 = require("./use-video-config.js");
14
- const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, showInTimeline = true, showLoopTimesInTimeline, ...other }, ref) => {
14
+ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, showInTimeline = true, loopDisplay, ...other }, ref) => {
15
15
  const { layout = 'absolute-fill' } = other;
16
16
  const [id] = (0, react_1.useState)(() => String(Math.random()));
17
17
  const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
@@ -81,7 +81,7 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
81
81
  rootId,
82
82
  showInTimeline,
83
83
  nonce,
84
- showLoopTimesInTimeline,
84
+ loopDisplay,
85
85
  });
86
86
  return () => {
87
87
  unregisterSequence(id);
@@ -99,7 +99,7 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
99
99
  from,
100
100
  showInTimeline,
101
101
  nonce,
102
- showLoopTimesInTimeline,
102
+ loopDisplay,
103
103
  environment,
104
104
  ]);
105
105
  const endThreshold = cumulatedFrom + from + durationInFrames - 1;
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Loop = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const Sequence_js_1 = require("../Sequence.js");
7
+ const use_current_frame_js_1 = require("../use-current-frame.js");
6
8
  const use_video_config_js_1 = require("../use-video-config.js");
7
9
  const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
8
10
  /**
@@ -10,6 +12,7 @@ const validate_duration_in_frames_js_1 = require("../validation/validate-duratio
10
12
  * @see [Documentation](https://www.remotion.dev/docs/loop)
11
13
  */
12
14
  const Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
15
+ const currentFrame = (0, use_current_frame_js_1.useCurrentFrame)();
13
16
  const { durationInFrames: compDuration } = (0, use_video_config_js_1.useVideoConfig)();
14
17
  (0, validate_duration_in_frames_js_1.validateDurationInFrames)({
15
18
  durationInFrames,
@@ -28,10 +31,16 @@ const Loop = ({ durationInFrames, times = Infinity, children, name, ...props })
28
31
  const maxTimes = Math.ceil(compDuration / durationInFrames);
29
32
  const actualTimes = Math.min(maxTimes, times);
30
33
  const style = props.layout === 'none' ? undefined : props.style;
31
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: new Array(actualTimes).fill(true).map((_, i) => {
32
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence
33
- // eslint-disable-next-line react/no-array-index-key
34
- , { durationInFrames: durationInFrames, from: i * durationInFrames, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, layout: props.layout, style: style, children: children }, `loop-${i}`));
35
- }) }));
34
+ const maxFrame = durationInFrames * (actualTimes - 1);
35
+ const start = Math.floor(currentFrame / durationInFrames) * durationInFrames;
36
+ const from = Math.min(start, maxFrame);
37
+ const loopDisplay = (0, react_1.useMemo)(() => {
38
+ return {
39
+ numberOfTimes: actualTimes,
40
+ startOffset: -from,
41
+ durationInFrames,
42
+ };
43
+ }, [actualTimes, durationInFrames, from]);
44
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { durationInFrames: durationInFrames, from: from, name: name, loopDisplay: loopDisplay, layout: props.layout, style: style, children: children }));
36
45
  };
37
46
  exports.Loop = Loop;
@@ -84,7 +84,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
84
84
  nonce,
85
85
  startMediaFrom: 0 - startsAt,
86
86
  doesVolumeChange,
87
- showLoopTimesInTimeline: undefined,
87
+ loopDisplay: undefined,
88
88
  playbackRate,
89
89
  });
90
90
  return () => {
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.0-alpha6";
1
+ export declare const VERSION = "4.0.0-alpha8";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '4.0.0-alpha6';
5
+ exports.VERSION = '4.0.0-alpha8';
@@ -58,7 +58,7 @@ function truthy(value) {
58
58
  }
59
59
 
60
60
  // Automatically generated on publish
61
- const VERSION = '4.0.0-alpha6';
61
+ const VERSION = '4.0.0-alpha8';
62
62
 
63
63
  const checkMultipleRemotionVersions = () => {
64
64
  if (typeof globalThis === 'undefined') {
@@ -666,7 +666,7 @@ const useVideoConfig = () => {
666
666
  return videoConfig;
667
667
  };
668
668
 
669
- const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, showInTimeline = true, showLoopTimesInTimeline, ...other }, ref) => {
669
+ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, showInTimeline = true, loopDisplay, ...other }, ref) => {
670
670
  const { layout = 'absolute-fill' } = other;
671
671
  const [id] = useState(() => String(Math.random()));
672
672
  const parentSequence = useContext(SequenceContext);
@@ -736,7 +736,7 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
736
736
  rootId,
737
737
  showInTimeline,
738
738
  nonce,
739
- showLoopTimesInTimeline,
739
+ loopDisplay,
740
740
  });
741
741
  return () => {
742
742
  unregisterSequence(id);
@@ -754,7 +754,7 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
754
754
  from,
755
755
  showInTimeline,
756
756
  nonce,
757
- showLoopTimesInTimeline,
757
+ loopDisplay,
758
758
  environment,
759
759
  ]);
760
760
  const endThreshold = cumulatedFrom + from + durationInFrames - 1;
@@ -781,6 +781,26 @@ const SequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity,
781
781
  */
782
782
  const Sequence = forwardRef(SequenceRefForwardingFunction);
783
783
 
784
+ /**
785
+ * @description Get the current frame of the video. Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
786
+ * @see [Documentation](https://remotion.dev/docs/use-current-frame)
787
+ */
788
+ const useCurrentFrame = () => {
789
+ const canUseRemotionHooks = useContext(CanUseRemotionHooks);
790
+ if (!canUseRemotionHooks) {
791
+ if (typeof window !== 'undefined' && window.remotion_isPlayer) {
792
+ throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
793
+ }
794
+ throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
795
+ }
796
+ const frame = useTimelinePosition();
797
+ const context = useContext(SequenceContext);
798
+ const contextOffset = context
799
+ ? context.cumulatedFrom + context.relativeFrom
800
+ : 0;
801
+ return frame - contextOffset;
802
+ };
803
+
784
804
  const validateDurationInFrames = ({ allowFloats, component, durationInFrames, }) => {
785
805
  if (typeof durationInFrames !== 'number') {
786
806
  throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
@@ -801,6 +821,7 @@ const validateDurationInFrames = ({ allowFloats, component, durationInFrames, })
801
821
  * @see [Documentation](https://www.remotion.dev/docs/loop)
802
822
  */
803
823
  const Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
824
+ const currentFrame = useCurrentFrame();
804
825
  const { durationInFrames: compDuration } = useVideoConfig();
805
826
  validateDurationInFrames({
806
827
  durationInFrames,
@@ -819,11 +840,17 @@ const Loop = ({ durationInFrames, times = Infinity, children, name, ...props })
819
840
  const maxTimes = Math.ceil(compDuration / durationInFrames);
820
841
  const actualTimes = Math.min(maxTimes, times);
821
842
  const style = props.layout === 'none' ? undefined : props.style;
822
- return (jsx(Fragment, { children: new Array(actualTimes).fill(true).map((_, i) => {
823
- return (jsx(Sequence
824
- // eslint-disable-next-line react/no-array-index-key
825
- , { durationInFrames: durationInFrames, from: i * durationInFrames, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, layout: props.layout, style: style, children: children }, `loop-${i}`));
826
- }) }));
843
+ const maxFrame = durationInFrames * (actualTimes - 1);
844
+ const start = Math.floor(currentFrame / durationInFrames) * durationInFrames;
845
+ const from = Math.min(start, maxFrame);
846
+ const loopDisplay = useMemo(() => {
847
+ return {
848
+ numberOfTimes: actualTimes,
849
+ startOffset: -from,
850
+ durationInFrames,
851
+ };
852
+ }, [actualTimes, durationInFrames, from]);
853
+ return (jsx(Sequence, { durationInFrames: durationInFrames, from: from, name: name, loopDisplay: loopDisplay, layout: props.layout, style: style, children: children }));
827
854
  };
828
855
 
829
856
  const validateMediaProps = (props, component) => {
@@ -1067,26 +1094,6 @@ const random = (seed, dummy) => {
1067
1094
  throw new Error('random() argument must be a number or a string');
1068
1095
  };
1069
1096
 
1070
- /**
1071
- * @description Get the current frame of the video. Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
1072
- * @see [Documentation](https://remotion.dev/docs/use-current-frame)
1073
- */
1074
- const useCurrentFrame = () => {
1075
- const canUseRemotionHooks = useContext(CanUseRemotionHooks);
1076
- if (!canUseRemotionHooks) {
1077
- if (typeof window !== 'undefined' && window.remotion_isPlayer) {
1078
- throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
1079
- }
1080
- throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
1081
- }
1082
- const frame = useTimelinePosition();
1083
- const context = useContext(SequenceContext);
1084
- const contextOffset = context
1085
- ? context.cumulatedFrom + context.relativeFrom
1086
- : 0;
1087
- return frame - contextOffset;
1088
- };
1089
-
1090
1097
  const useMediaStartsAt = () => {
1091
1098
  var _a;
1092
1099
  const parentSequence = useContext(SequenceContext);
@@ -1248,7 +1255,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
1248
1255
  nonce,
1249
1256
  startMediaFrom: 0 - startsAt,
1250
1257
  doesVolumeChange,
1251
- showLoopTimesInTimeline: undefined,
1258
+ loopDisplay: undefined,
1252
1259
  playbackRate,
1253
1260
  });
1254
1261
  return () => {
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.0-alpha6';
2
+ const VERSION = '4.0.0-alpha8';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.0-alpha6",
3
+ "version": "4.0.0-alpha8",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -1,294 +0,0 @@
1
- /**
2
- * The configuration has moved to @remotion/cli.
3
- * For the moment the type definitions are going to stay here
4
- */
5
- import type { Configuration } from 'webpack';
6
- declare type Concurrency = number | null;
7
- declare type BrowserExecutable = string | null;
8
- declare type FrameRange = number | [number, number];
9
- declare type FfmpegExecutable = string | null;
10
- declare type Loop = number | null;
11
- declare type CodecOrUndefined = 'h264' | 'h265' | 'vp8' | 'vp9' | 'mp3' | 'aac' | 'wav' | 'prores' | 'h264-mkv' | 'gif' | undefined;
12
- declare type Crf = number | undefined;
13
- export declare type WebpackConfiguration = Configuration;
14
- export declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
15
- declare type FlatConfig = RemotionConfigObject['Bundling'] & RemotionConfigObject['Log'] & RemotionConfigObject['Preview'] & RemotionConfigObject['Puppeteer'] & RemotionConfigObject['Output'] & RemotionConfigObject['Rendering'] & {
16
- /**
17
- * Set the audio codec to use for the output video.
18
- * See the Encoding guide in the docs for defaults and available options.
19
- */
20
- setAudioCodec: (codec: 'pcm-16' | 'aac' | 'mp3' | 'opus') => void;
21
- };
22
- declare global {
23
- interface RemotionBundlingOptions {
24
- /**
25
- * Specify the entry point so you don't have to specify it in the
26
- * CLI command
27
- */
28
- readonly setEntryPoint: (src: string) => void;
29
- /**
30
- * Whether Webpack bundles should be cached to make
31
- * subsequent renders faster. Default: true
32
- */
33
- readonly setCachingEnabled: (flag: boolean) => void;
34
- /**
35
- * Define on which port Remotion should start it's HTTP servers during preview and rendering.
36
- * By default, Remotion will try to find a free port.
37
- * If you specify a port, but it's not available, Remotion will throw an error.
38
- */
39
- readonly setPort: (port: number | undefined) => void;
40
- /**
41
- * Define the location of the public/ directory.
42
- * By default it is a folder named "public" inside the current working directory.
43
- * You can set an absolute path or a relative path that will be resolved from the closest package.json location.
44
- */
45
- readonly setPublicDir: (publicDir: string | null) => void;
46
- readonly overrideWebpackConfig: (f: WebpackOverrideFn) => void;
47
- }
48
- interface RemotionConfigObject {
49
- /**
50
- * @deprecated New flat config format: You can now replace `Config.Preview.` with `Config.`
51
- */
52
- readonly Preview: {
53
- /**
54
- * Change the maximum amount of tracks that are shown in the timeline.
55
- * @param maxTracks The maximum amount of timeline tracks that you would like to show.
56
- * @default 15
57
- */
58
- readonly setMaxTimelineTracks: (maxTracks: number) => void;
59
- /**
60
- * Enable Keyboard shortcuts in the Remotion Preview.
61
- * @param enabled Boolean whether to enable the keyboard shortcuts
62
- * @default true
63
- */
64
- readonly setKeyboardShortcutsEnabled: (enableShortcuts: boolean) => void;
65
- /**
66
- * Set number of shared audio tags. https://www.remotion.dev/docs/player/autoplay#use-the-numberofsharedaudiotags-property
67
- * @param numberOfAudioTags
68
- * @default 0
69
- */
70
- readonly setNumberOfSharedAudioTags: (numberOfAudioTags: number) => void;
71
- /**
72
- * Enable Webpack polling instead of file system listeners for hot reloading in the preview.
73
- * This is useful if you are using a remote directory or a virtual machine.
74
- * @param interval
75
- * @default null
76
- */
77
- readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
78
- /**
79
- * Whether Remotion should open a browser when starting the Preview.
80
- * @param should
81
- * @default true
82
- */
83
- readonly setShouldOpenBrowser: (should: boolean) => void;
84
- };
85
- /**
86
- * @deprecated New flat config format: You can now replace `Config.Bundling.` with `Config.`
87
- */
88
- readonly Bundling: RemotionBundlingOptions;
89
- /**
90
- * @deprecated New flat config format: You can now replace `Config.Log.` with `Config.`
91
- */
92
- readonly Log: {
93
- /**
94
- * Set the log level.
95
- * Acceptable values: 'error' | 'warning' | 'info' | 'verbose'
96
- * Default value: 'info'
97
- *
98
- * Set this to 'verbose' to get browser logs and other IO.
99
- */
100
- readonly setLevel: (newLogLevel: 'verbose' | 'info' | 'warn' | 'error') => void;
101
- };
102
- /**
103
- * @deprecated New flat config format: You can now replace `Config.Puppeteer.` with `Config.`
104
- */
105
- readonly Puppeteer: {
106
- /**
107
- * Specify executable path for the browser to use.
108
- * Default: null, which will make Remotion find or download a version of said browser.
109
- */
110
- readonly setBrowserExecutable: (newBrowserExecutablePath: BrowserExecutable) => void;
111
- /**
112
- * Set how many milliseconds a frame may take to render before it times out.
113
- * Default: `30000`
114
- */
115
- readonly setDelayRenderTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
116
- /**
117
- * @deprecated Renamed to `setDelayRenderTimeoutInMilliseconds`.
118
- * Set how many milliseconds a frame may take to render before it times out.
119
- * Default: `30000`
120
- */
121
- readonly setTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
122
- /**
123
- * Setting deciding whether to disable CORS and other Chrome security features.
124
- * Default: false
125
- */
126
- readonly setChromiumDisableWebSecurity: (should: boolean) => void;
127
- /**
128
- * Setting whether to ignore any invalid SSL certificates, such as self-signed ones.
129
- * Default: false
130
- */
131
- readonly setChromiumIgnoreCertificateErrors: (should: boolean) => void;
132
- /**
133
- * If false, will open an actual browser during rendering to observe progress.
134
- * Default: true
135
- */
136
- readonly setChromiumHeadlessMode: (should: boolean) => void;
137
- /**
138
- * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
139
- * Default: 'swangle' in Lambda, null elsewhere.
140
- */
141
- readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader') => void;
142
- /**
143
- * Set the user agent for Chrome. Only works during rendering.
144
- * Default:
145
- */
146
- readonly setChromiumUserAgent: (userAgent: string | null) => void;
147
- };
148
- /**
149
- * @deprecated New flat config format: You can now replace `Config.Rendering.` with `Config.`
150
- */
151
- readonly Rendering: {
152
- /**
153
- * Set a custom location for a .env file.
154
- * Default: `.env`
155
- */
156
- readonly setDotEnvLocation: (file: string) => void;
157
- /**
158
- * Sets how many Puppeteer instances will work on rendering your video in parallel.
159
- * Default: `null`, meaning half of the threads available on your CPU.
160
- */
161
- readonly setConcurrency: (newConcurrency: Concurrency) => void;
162
- /**
163
- * Set the JPEG quality for the frames.
164
- * Must be between 0 and 100.
165
- * Must be between 0 and 100.
166
- * Default: 80
167
- */
168
- readonly setQuality: (q: number | undefined) => void;
169
- /** Decide in which image format to render. Can be either 'jpeg' or 'png'.
170
- * PNG is slower, but supports transparency.
171
- */
172
- readonly setImageFormat: (format: 'png' | 'jpeg' | 'none') => void;
173
- /**
174
- * Render only a subset of a video.
175
- * Pass in a tuple [20, 30] to only render frames 20-30 into a video.
176
- * Pass in a single number `20` to only render a single frame as an image.
177
- * The frame count starts at 0.
178
- */
179
- readonly setFrameRange: (newFrameRange: FrameRange | null) => void;
180
- /**
181
- * Specify local ffmpeg executable.
182
- * Default: null, which will use ffmpeg available in PATH.
183
- */
184
- readonly setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
185
- /**
186
- * Specify local ffprobe executable.
187
- * Default: null, which will use ffprobe available in PATH.
188
- */
189
- readonly setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
190
- /**
191
- * Scales the output dimensions by a factor.
192
- * Default: 1.
193
- */
194
- readonly setScale: (newScale: number) => void;
195
- /**
196
- * Specify which frames should be picked for rendering a GIF
197
- * Default: 1, which means every frame
198
- * https://remotion.dev/docs/render-as-gif
199
- */
200
- readonly setEveryNthFrame: (frame: number) => void;
201
- /**
202
- * Specify the number of Loop a GIF should have.
203
- * Default: null (means GIF will loop infinite)
204
- */
205
- readonly setNumberOfGifLoops: (newLoop: Loop) => void;
206
- /**
207
- * Disable audio output.
208
- * Default: false
209
- */
210
- readonly setMuted: (muted: boolean) => void;
211
- /**
212
- * Don't render an audio track if it would be silent.
213
- * Default: true
214
- */
215
- readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
216
- };
217
- /**
218
- * @deprecated New flat config format: You can now replace `Config.Output.` with `Config.`
219
- */
220
- readonly Output: {
221
- /**
222
- * Set the output file location string. Default: `out/{composition}.{codec}`
223
- */
224
- readonly setOutputLocation: (newOutputLocation: string) => void;
225
- /**
226
- * If the video file already exists, should Remotion overwrite
227
- * the output? Default: true
228
- */
229
- readonly setOverwriteOutput: (newOverwrite: boolean) => void;
230
- /**
231
- * Sets the pixel format in FFMPEG.
232
- * See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
233
- * You can override this using the `--pixel-format` Cli flag.
234
- */
235
- readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
236
- /**
237
- * @deprecated Use setCodec() and setImageSequence() instead.
238
- * Specify what kind of output you, either `mp4` or `png-sequence`.
239
- */
240
- readonly setOutputFormat: (newLegacyFormat: 'mp4' | 'png-sequence') => void;
241
- /**
242
- * Specify the codec for stitching the frames into a video.
243
- * Can be `h264` (default), `h265`, `vp8` or `vp9`
244
- */
245
- readonly setCodec: (newCodec: CodecOrUndefined) => void;
246
- /**
247
- * Set the Constant Rate Factor to pass to FFMPEG.
248
- * Lower values mean better quality, but be aware that the ranges of
249
- * possible values greatly differs between codecs.
250
- */
251
- readonly setCrf: (newCrf: Crf) => void;
252
- /**
253
- * Set to true if don't want a video but an image sequence as the output.
254
- */
255
- readonly setImageSequence: (newImageSequence: boolean) => void;
256
- /**
257
- * Overrides the height of a composition
258
- */
259
- readonly overrideHeight: (newHeight: number) => void;
260
- /**
261
- * Overrides the width of a composition
262
- */
263
- readonly overrideWidth: (newWidth: number) => void;
264
- /**
265
- * Set the ProRes profile.
266
- * This method is only valid if the codec has been set to 'prores'.
267
- * Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
268
- * See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
269
- */
270
- readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
271
- /**
272
- * Override the arguments that Remotion passes to FFMPEG.
273
- * Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
274
- */
275
- readonly overrideFfmpegCommand: (command: (info: {
276
- type: 'pre-stitcher' | 'stitcher';
277
- args: string[];
278
- }) => string[]) => void;
279
- /**
280
- * Set a target audio bitrate to be passed to FFMPEG.
281
- */
282
- readonly setAudioBitrate: (bitrate: string | null) => void;
283
- /**
284
- * Set a target video bitrate to be passed to FFMPEG.
285
- * Mutually exclusive with setCrf().
286
- */
287
- readonly setVideoBitrate: (bitrate: string | null) => void;
288
- };
289
- }
290
- }
291
- export declare type ConfigType = RemotionConfigObject & FlatConfig;
292
- export type { Concurrency };
293
- export declare const Config: ConfigType;
294
- export declare const enableLegacyRemotionConfig: () => void;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enableLegacyRemotionConfig = exports.Config = void 0;
4
- const conf = {};
5
- let enabled = false;
6
- exports.Config = new Proxy(conf, {
7
- get(target, prop, receiver) {
8
- if (!enabled) {
9
- if (typeof document !== 'undefined') {
10
- // We are in the browser
11
- return {};
12
- }
13
- throw new Error('To use the Remotion config file, you need to have @remotion/cli installed.\n- Make sure that all versions of Remotion are the same.\n- Make sure that @remotion/cli is installed.\n- Make sure Config is imported from "@remotion/cli", not "remotion".');
14
- }
15
- return Reflect.get(target, prop, receiver);
16
- },
17
- });
18
- const enableLegacyRemotionConfig = () => {
19
- enabled = true;
20
- };
21
- exports.enableLegacyRemotionConfig = enableLegacyRemotionConfig;
@@ -1 +0,0 @@
1
- export declare const validateOffthreadVideoImageFormat: (input: unknown) => void;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateOffthreadVideoImageFormat = void 0;
4
- const validateOffthreadVideoImageFormat = (input) => {
5
- if (typeof input === 'undefined') {
6
- return;
7
- }
8
- if (typeof input !== 'string') {
9
- throw new TypeError(`<OffthreadVideo imageFormat=""> must be a string, but got ${JSON.stringify(input)} instead.`);
10
- }
11
- if (input !== 'png' && input !== 'jpeg') {
12
- throw new TypeError(`<OffthreadVideo imageFormat=""> must be either "png" or "jpeg", but got ${input}`);
13
- }
14
- };
15
- exports.validateOffthreadVideoImageFormat = validateOffthreadVideoImageFormat;