@remotion/renderer 4.0.124 → 4.0.126

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 (39) hide show
  1. package/dist/call-ffmpeg.d.ts +1 -0
  2. package/dist/can-concatenate-seamlessly.d.ts +3 -0
  3. package/dist/can-concatenate-seamlessly.js +7 -0
  4. package/dist/check-apple-silicon.d.ts +3 -1
  5. package/dist/check-apple-silicon.js +32 -2
  6. package/dist/client.d.ts +3 -3
  7. package/dist/create-combined-video.d.ts +2 -3
  8. package/dist/create-combined-video.js +1 -7
  9. package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
  10. package/dist/get-compositions.js +1 -0
  11. package/dist/get-extension-from-audio-codec.d.ts +2 -2
  12. package/dist/get-extra-frames-to-capture.d.ts +13 -0
  13. package/dist/get-extra-frames-to-capture.js +55 -0
  14. package/dist/index.d.ts +12 -7
  15. package/dist/options/gl.d.ts +3 -3
  16. package/dist/options/index.d.ts +3 -3
  17. package/dist/options/separate-audio-to.d.ts +18 -0
  18. package/dist/options/separate-audio-to.js +31 -0
  19. package/dist/port-config.d.ts +2 -2
  20. package/dist/port-config.js +7 -4
  21. package/dist/prepare-server.d.ts +2 -1
  22. package/dist/prepare-server.js +3 -1
  23. package/dist/render-frames.js +1 -0
  24. package/dist/render-media.js +1 -0
  25. package/dist/render-still.js +1 -0
  26. package/dist/select-composition.js +1 -0
  27. package/dist/serve-static.d.ts +1 -0
  28. package/dist/serve-static.js +1 -1
  29. package/dist/should-seamless.d.ts +3 -0
  30. package/dist/should-seamless.js +7 -0
  31. package/dist/supported-audio-codecs.d.ts +13 -0
  32. package/dist/supported-audio-codecs.js +16 -0
  33. package/dist/x264-preset.d.ts +0 -15
  34. package/dist/x264-preset.js +1 -26
  35. package/package.json +9 -9
  36. package/dist/does-have-m2-bug.d.ts +0 -3
  37. package/dist/does-have-m2-bug.js +0 -12
  38. package/dist/options/prores-profile.d.ts +0 -0
  39. package/dist/options/prores-profile.js +0 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import execa from 'execa';
2
3
  import type { SpawnOptionsWithoutStdio } from 'node:child_process';
3
4
  import type { LogLevel } from './log-level';
@@ -0,0 +1,3 @@
1
+ import type { AudioCodec } from './audio-codec';
2
+ import type { Codec } from './codec';
3
+ export declare const canConcatSeamlessly: (audioCodec: AudioCodec | null, codec: Codec) => boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canConcatSeamlessly = void 0;
4
+ const canConcatSeamlessly = (audioCodec, codec) => {
5
+ return audioCodec === 'aac' && codec === 'h264';
6
+ };
7
+ exports.canConcatSeamlessly = canConcatSeamlessly;
@@ -1 +1,3 @@
1
- export declare const checkNodeVersionAndWarnAboutRosetta: () => void;
1
+ import type { LogLevel } from './log-level';
2
+ export declare const gLibCErrorMessage: (libCString: string) => string | null;
3
+ export declare const checkNodeVersionAndWarnAboutRosetta: (logLevel: LogLevel, indent: boolean) => void;
@@ -1,12 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkNodeVersionAndWarnAboutRosetta = void 0;
4
- const checkNodeVersionAndWarnAboutRosetta = () => {
3
+ exports.checkNodeVersionAndWarnAboutRosetta = exports.gLibCErrorMessage = void 0;
4
+ const logger_1 = require("./logger");
5
+ const gLibCErrorMessage = (libCString) => {
6
+ const split = libCString.split('.');
7
+ if (split.length !== 2) {
8
+ return null;
9
+ }
10
+ if (split[0] === '2' && Number(split[1]) >= 35) {
11
+ return null;
12
+ }
13
+ if (Number(split[0]) > 2) {
14
+ return null;
15
+ }
16
+ return `Rendering videos requires glibc 2.35 or higher. Your system has glibc ${libCString}.`;
17
+ };
18
+ exports.gLibCErrorMessage = gLibCErrorMessage;
19
+ const checkLibCRequirement = (logLevel, indent) => {
20
+ const { report } = process;
21
+ if (report) {
22
+ // @ts-expect-error no types
23
+ const { glibcVersionRuntime } = report.getReport().header;
24
+ if (!glibcVersionRuntime) {
25
+ return;
26
+ }
27
+ const error = (0, exports.gLibCErrorMessage)(glibcVersionRuntime);
28
+ if (error) {
29
+ logger_1.Log.warn({ logLevel, indent }, error);
30
+ }
31
+ }
32
+ };
33
+ const checkNodeVersionAndWarnAboutRosetta = (logLevel, indent) => {
5
34
  const version = process.version.replace('v', '').split('.');
6
35
  const majorVersion = Number(version[0]);
7
36
  const requiredNodeVersion = 16;
8
37
  if (majorVersion < 16) {
9
38
  throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
10
39
  }
40
+ checkLibCRequirement(logLevel, indent);
11
41
  };
12
42
  exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
package/dist/client.d.ts CHANGED
@@ -464,19 +464,19 @@ export declare const BrowserSafeApis: {
464
464
  cliFlag: "gl";
465
465
  docLink: string;
466
466
  name: string;
467
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
467
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
468
468
  ssrName: string;
469
469
  description: () => import("react/jsx-runtime").JSX.Element;
470
470
  getValue: ({ commandLine }: {
471
471
  commandLine: Record<string, unknown>;
472
472
  }) => {
473
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
473
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
474
474
  source: string;
475
475
  } | {
476
476
  value: null;
477
477
  source: string;
478
478
  };
479
- setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
479
+ setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
480
480
  };
481
481
  enableLambdaInsights: {
482
482
  name: string;
@@ -1,7 +1,7 @@
1
1
  import type { Codec } from './codec';
2
2
  import type { LogLevel } from './log-level';
3
3
  import type { CancelSignal } from './make-cancel-signal';
4
- export declare const createCombinedVideo: ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }: {
4
+ export declare const createCombinedVideo: ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, }: {
5
5
  fps: number;
6
6
  codec: Codec;
7
7
  filelistDir: string;
@@ -14,5 +14,4 @@ export declare const createCombinedVideo: ({ addRemotionMetadata, binariesDirect
14
14
  addRemotionMetadata: boolean;
15
15
  binariesDirectory: string | null;
16
16
  cancelSignal: CancelSignal | undefined;
17
- seamless: boolean;
18
- }) => Promise<string | undefined>;
17
+ }) => Promise<void>;
@@ -2,13 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCombinedVideo = void 0;
4
4
  const combine_video_streams_1 = require("./combine-video-streams");
5
- const combine_video_streams_seamlessly_1 = require("./combine-video-streams-seamlessly");
6
- const createCombinedVideo = async ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }) => {
7
- if (seamless) {
8
- return (0, combine_video_streams_seamlessly_1.combineVideoStreamsSeamlessly)({
9
- files,
10
- });
11
- }
5
+ const createCombinedVideo = async ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, }) => {
12
6
  await (0, combine_video_streams_1.combineVideoStreams)({
13
7
  addRemotionMetadata,
14
8
  binariesDirectory,
@@ -4,9 +4,6 @@ export declare const createFfmpegComplexFilter: ({ filters, downloadMap, }: {
4
4
  filters: PreprocessedAudioTrack[];
5
5
  downloadMap: DownloadMap;
6
6
  }) => Promise<{
7
- complexFilterFlag: [
8
- string,
9
- string
10
- ] | null;
7
+ complexFilterFlag: [string, string] | null;
11
8
  cleanup: () => void;
12
9
  }>;
@@ -105,6 +105,7 @@ const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions,
105
105
  indent,
106
106
  offthreadVideoCacheSizeInBytes,
107
107
  binariesDirectory,
108
+ forceIPv4: false,
108
109
  }, {
109
110
  onDownload: () => undefined,
110
111
  onError,
@@ -1,2 +1,2 @@
1
- import type { AudioCodec } from './audio-codec';
2
- export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "mp3" | "aac" | "wav" | "opus";
1
+ import type { AudioCodec } from './options/audio-codec';
2
+ export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "aac" | "mp3" | "opus" | "wav";
@@ -0,0 +1,13 @@
1
+ type ReturnType = {
2
+ extraFramesToCaptureAssets: number[];
3
+ trimLeftOffset: number;
4
+ trimRightOffset: number;
5
+ chunkLengthInSeconds: number;
6
+ };
7
+ export declare const getExtraFramesToCapture: ({ compositionStart, realFrameRange, fps, forSeamlessAacConcatenation, }: {
8
+ fps: number;
9
+ compositionStart: number;
10
+ realFrameRange: [number, number];
11
+ forSeamlessAacConcatenation: boolean;
12
+ }) => ReturnType;
13
+ export {};
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // For seamless AAC concatenation, we need to capture a bit of extra audio on both sides
3
+ // to later align the audio correctly. This function calculates the exact frames to capture.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getExtraFramesToCapture = void 0;
6
+ const combine_audio_1 = require("./combine-audio");
7
+ const sample_rate_1 = require("./sample-rate");
8
+ const getExtraFramesToCapture = ({ compositionStart, realFrameRange, fps, forSeamlessAacConcatenation, }) => {
9
+ if (!forSeamlessAacConcatenation) {
10
+ return {
11
+ extraFramesToCaptureAssets: [],
12
+ chunkLengthInSeconds: (realFrameRange[1] - realFrameRange[0] + 1) / fps,
13
+ trimLeftOffset: 0,
14
+ trimRightOffset: 0,
15
+ };
16
+ }
17
+ const chunkStart = realFrameRange[0] / fps;
18
+ if (chunkStart < compositionStart) {
19
+ throw new Error('chunkStart may not be below compositionStart');
20
+ }
21
+ const realLeftEnd = chunkStart - compositionStart;
22
+ if (realLeftEnd < 0) {
23
+ throw new Error('chunkStat - compositionStart may not be below 0');
24
+ }
25
+ const realRightEnd = realLeftEnd + (realFrameRange[1] - realFrameRange[0] + 1) / fps;
26
+ const aacAdjustedLeftEnd = Math.max(0, (0, combine_audio_1.getClosestAlignedTime)(realLeftEnd) - 2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE));
27
+ const aacAdjustedRightEnd = (0, combine_audio_1.getClosestAlignedTime)(realRightEnd) + 2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE);
28
+ const startTimeWithoutOffset = Math.floor(aacAdjustedLeftEnd * fps);
29
+ // TODO: Prevent floating point issues by dividing and then multiplying by FPS
30
+ const startFrame = startTimeWithoutOffset + compositionStart * fps;
31
+ const trimLeftOffset = (aacAdjustedLeftEnd * fps - startTimeWithoutOffset) / fps;
32
+ const endFrame = Math.ceil(aacAdjustedRightEnd * fps) + compositionStart * fps;
33
+ const trimRightOffset = (aacAdjustedRightEnd * fps - Math.ceil(aacAdjustedRightEnd * fps)) / fps;
34
+ const extraFramesToCaptureAudioOnly = new Array(realFrameRange[0] - startFrame)
35
+ .fill(true)
36
+ .map((_, f) => {
37
+ return f + startFrame;
38
+ });
39
+ const extraFramesToCaptureAudioOnlyBackend = new Array(endFrame - realFrameRange[1] - 1)
40
+ .fill(true)
41
+ .map((_, f) => {
42
+ return f + realFrameRange[1] + 1;
43
+ });
44
+ const chunkLengthInSeconds = aacAdjustedRightEnd - aacAdjustedLeftEnd;
45
+ return {
46
+ extraFramesToCaptureAssets: [
47
+ ...extraFramesToCaptureAudioOnly,
48
+ ...extraFramesToCaptureAudioOnlyBackend,
49
+ ],
50
+ chunkLengthInSeconds,
51
+ trimLeftOffset,
52
+ trimRightOffset,
53
+ };
54
+ };
55
+ exports.getExtraFramesToCapture = getExtraFramesToCapture;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import execa from 'execa';
2
4
  import { HeadlessBrowser } from './browser/Browser';
3
5
  import { SymbolicateableError } from './error-handling/symbolicateable-error';
@@ -59,6 +61,7 @@ export declare const RenderInternals: {
59
61
  indent: boolean;
60
62
  offthreadVideoCacheSizeInBytes: number | null;
61
63
  binariesDirectory: string | null;
64
+ forceIPv4: boolean;
62
65
  }) => Promise<{
63
66
  port: number;
64
67
  close: () => Promise<void>;
@@ -139,8 +142,8 @@ export declare const RenderInternals: {
139
142
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
140
143
  DEFAULT_BROWSER: "chrome";
141
144
  validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
142
- DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
143
- validateOpenGlRenderer: (option: unknown) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
145
+ DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
146
+ validateOpenGlRenderer: (option: unknown) => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
144
147
  validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
145
148
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
146
149
  validateJpegQuality: (q: unknown) => void;
@@ -350,8 +353,8 @@ export declare const RenderInternals: {
350
353
  }) => execa.ExecaChildProcess<string>;
351
354
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
352
355
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
353
- DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
354
- DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
356
+ DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
357
+ DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
355
358
  DEFAULT_JPEG_QUALITY: number;
356
359
  chalk: {
357
360
  enabled: () => boolean;
@@ -416,7 +419,7 @@ export declare const RenderInternals: {
416
419
  INDENT_TOKEN: string;
417
420
  isColorSupported: () => boolean;
418
421
  HeadlessBrowser: typeof HeadlessBrowser;
419
- prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, offthreadVideoCacheSizeInBytes, binariesDirectory, }: {
422
+ prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, offthreadVideoCacheSizeInBytes, binariesDirectory, forceIPv4, }: {
420
423
  webpackConfigOrServeUrl: string;
421
424
  port: number | null;
422
425
  remotionRoot: string;
@@ -425,6 +428,7 @@ export declare const RenderInternals: {
425
428
  indent: boolean;
426
429
  offthreadVideoCacheSizeInBytes: number | null;
427
430
  binariesDirectory: string | null;
431
+ forceIPv4: boolean;
428
432
  }) => Promise<import("./prepare-server").RemotionServer>;
429
433
  makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
430
434
  webpackConfigOrServeUrl: string;
@@ -435,6 +439,7 @@ export declare const RenderInternals: {
435
439
  indent: boolean;
436
440
  offthreadVideoCacheSizeInBytes: number | null;
437
441
  binariesDirectory: string | null;
442
+ forceIPv4: boolean;
438
443
  }, { onDownload, onError, }: {
439
444
  onError: (err: Error) => void;
440
445
  onDownload: import("./assets/download-and-map-assets-to-file").RenderMediaOnDownload | null;
@@ -448,7 +453,7 @@ export declare const RenderInternals: {
448
453
  frame: number;
449
454
  serializedInputPropsWithCustomSchema: string;
450
455
  serializedResolvedPropsWithCustomSchema: string;
451
- imageFormat: "png" | "jpeg" | "pdf" | "webp";
456
+ imageFormat: "jpeg" | "png" | "webp" | "pdf";
452
457
  jpegQuality: number;
453
458
  puppeteerInstance: HeadlessBrowser | null;
454
459
  envVariables: Record<string, string>;
@@ -729,7 +734,7 @@ export declare const RenderInternals: {
729
734
  feature: string;
730
735
  status: string;
731
736
  }[]>;
732
- getPortConfig: () => {
737
+ getPortConfig: (preferIpv4: boolean) => {
733
738
  host: string;
734
739
  hostsToTry: string[];
735
740
  };
@@ -1,19 +1,19 @@
1
1
  export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
2
2
  export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
3
3
  export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
4
- export declare const getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
4
+ export declare const getChromiumOpenGlRenderer: () => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
5
5
  export declare const setChromiumOpenGlRenderer: (renderer: OpenGlRenderer) => void;
6
6
  export declare const glOption: {
7
7
  cliFlag: "gl";
8
8
  docLink: string;
9
9
  name: string;
10
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
10
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
11
11
  ssrName: string;
12
12
  description: () => import("react/jsx-runtime").JSX.Element;
13
13
  getValue: ({ commandLine }: {
14
14
  commandLine: Record<string, unknown>;
15
15
  }) => {
16
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
16
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
17
17
  source: string;
18
18
  } | {
19
19
  value: null;
@@ -245,19 +245,19 @@ export declare const allOptions: {
245
245
  cliFlag: "gl";
246
246
  docLink: string;
247
247
  name: string;
248
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
248
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
249
249
  ssrName: string;
250
250
  description: () => import("react/jsx-runtime").JSX.Element;
251
251
  getValue: ({ commandLine }: {
252
252
  commandLine: Record<string, unknown>;
253
253
  }) => {
254
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
254
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
255
255
  source: string;
256
256
  } | {
257
257
  value: null;
258
258
  source: string;
259
259
  };
260
- setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
260
+ setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
261
261
  };
262
262
  enableLambdaInsights: {
263
263
  name: string;
@@ -0,0 +1,18 @@
1
+ export declare const separateAudioOption: {
2
+ cliFlag: string;
3
+ description: () => import("react/jsx-runtime").JSX.Element;
4
+ docLink: string;
5
+ getValue: ({ commandLine }: {
6
+ commandLine: Record<string, unknown>;
7
+ }) => {
8
+ source: string;
9
+ value: string;
10
+ } | {
11
+ source: string;
12
+ value: null;
13
+ };
14
+ name: string;
15
+ setConfig: () => never;
16
+ ssrName: string;
17
+ type: string | null;
18
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.separateAudioOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const DEFAULT = null;
6
+ const cliFlag = 'separate-audio-to';
7
+ exports.separateAudioOption = {
8
+ cliFlag,
9
+ description: () => {
10
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "If set, the audio will not be included in the main output but rendered as a separate file at the location you pass. It is recommended to use an absolute path. If a relative path is passed, it is relative to the Remotion Root." }));
11
+ },
12
+ docLink: 'https://remotion.dev/docs/renderer/render-media',
13
+ getValue: ({ commandLine }) => {
14
+ if (commandLine[cliFlag]) {
15
+ return {
16
+ source: 'cli',
17
+ value: commandLine[cliFlag],
18
+ };
19
+ }
20
+ return {
21
+ source: 'default',
22
+ value: DEFAULT,
23
+ };
24
+ },
25
+ name: 'Separate audio to',
26
+ setConfig: () => {
27
+ throw new Error('Not implemented');
28
+ },
29
+ ssrName: 'separateAudioTo',
30
+ type: 'string',
31
+ };
@@ -8,8 +8,8 @@ type PortConfig = {
8
8
  host: string;
9
9
  hostsToTry: string[];
10
10
  };
11
- export declare const getPortConfig: () => PortConfig;
12
- export declare const getHostToBind: (flattened: os.NetworkInterfaceInfo[]) => "::" | "0.0.0.0";
11
+ export declare const getPortConfig: (preferIpv4: boolean) => PortConfig;
12
+ export declare const getHostToBind: (flattened: os.NetworkInterfaceInfo[], preferIpv4: boolean) => "0.0.0.0" | "::";
13
13
  export declare const getHostsToTry: (flattened: os.NetworkInterfaceInfo[]) => string[];
14
14
  export declare const flattenNetworkInterfaces: (networkInterfaces: NodeJS.Dict<NetworkInterfaceInfo[]>) => NetworkInterfaceInfo[];
15
15
  export declare const isIpV6Supported: (flattened: os.NetworkInterfaceInfo[]) => boolean;
@@ -7,21 +7,24 @@ exports.hasIpv4LoopbackAddress = exports.hasIPv6LoopbackAddress = exports.isIpV6
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const truthy_1 = require("./truthy");
9
9
  let cached = null;
10
- const getPortConfig = () => {
10
+ const getPortConfig = (preferIpv4) => {
11
11
  if (cached) {
12
12
  return cached;
13
13
  }
14
14
  const networkInterfaces = os_1.default.networkInterfaces();
15
15
  const flattened = (0, exports.flattenNetworkInterfaces)(networkInterfaces);
16
- const host = (0, exports.getHostToBind)(flattened);
16
+ const host = (0, exports.getHostToBind)(flattened, preferIpv4);
17
17
  const hostsToTry = (0, exports.getHostsToTry)(flattened);
18
18
  const response = { host, hostsToTry };
19
19
  cached = response;
20
20
  return response;
21
21
  };
22
22
  exports.getPortConfig = getPortConfig;
23
- const getHostToBind = (flattened) => {
24
- return (0, exports.isIpV6Supported)(flattened) ? '::' : '0.0.0.0';
23
+ const getHostToBind = (flattened, preferIpv4) => {
24
+ if (preferIpv4 || !(0, exports.isIpV6Supported)(flattened)) {
25
+ return '0.0.0.0';
26
+ }
27
+ return '::';
25
28
  };
26
29
  exports.getHostToBind = getHostToBind;
27
30
  const getHostsToTry = (flattened) => {
@@ -20,8 +20,9 @@ type PrepareServerOptions = {
20
20
  indent: boolean;
21
21
  offthreadVideoCacheSizeInBytes: number | null;
22
22
  binariesDirectory: string | null;
23
+ forceIPv4: boolean;
23
24
  };
24
- export declare const prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, offthreadVideoCacheSizeInBytes, binariesDirectory, }: PrepareServerOptions) => Promise<RemotionServer>;
25
+ export declare const prepareServer: ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, offthreadVideoCacheSizeInBytes, binariesDirectory, forceIPv4, }: PrepareServerOptions) => Promise<RemotionServer>;
25
26
  export declare const makeOrReuseServer: (server: RemotionServer | undefined, config: PrepareServerOptions, { onDownload, onError, }: {
26
27
  onError: (err: Error) => void;
27
28
  onDownload: RenderMediaOnDownload | null;
@@ -15,7 +15,7 @@ const logger_1 = require("./logger");
15
15
  const serve_static_1 = require("./serve-static");
16
16
  const symbolicate_stacktrace_1 = require("./symbolicate-stacktrace");
17
17
  const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
18
- const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, offthreadVideoCacheSizeInBytes, binariesDirectory, }) => {
18
+ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, concurrency, logLevel, indent, offthreadVideoCacheSizeInBytes, binariesDirectory, forceIPv4, }) => {
19
19
  const downloadMap = (0, download_map_1.makeDownloadMap)();
20
20
  logger_1.Log.verbose({ indent, logLevel }, 'Created directory for temporary files', downloadMap.assetDir);
21
21
  if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
@@ -28,6 +28,7 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
28
28
  indent,
29
29
  offthreadVideoCacheSizeInBytes,
30
30
  binariesDirectory,
31
+ forceIPv4,
31
32
  });
32
33
  let remoteSourceMap = null;
33
34
  (0, symbolicate_stacktrace_1.getSourceMapFromRemoteUrl)((0, get_bundle_url_from_serve_url_1.getBundleMapUrlFromServeUrl)(webpackConfigOrServeUrl))
@@ -74,6 +75,7 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
74
75
  indent,
75
76
  offthreadVideoCacheSizeInBytes,
76
77
  binariesDirectory,
78
+ forceIPv4,
77
79
  });
78
80
  return Promise.resolve({
79
81
  closeServer: async (force) => {
@@ -353,6 +353,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
353
353
  indent,
354
354
  offthreadVideoCacheSizeInBytes,
355
355
  binariesDirectory,
356
+ forceIPv4: false,
356
357
  }, {
357
358
  onDownload,
358
359
  onError,
@@ -273,6 +273,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
273
273
  webpackConfigOrServeUrl: serveUrl,
274
274
  offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
275
275
  binariesDirectory,
276
+ forceIPv4: false,
276
277
  }, {
277
278
  onDownload,
278
279
  onError: (err) => reject(err),
@@ -213,6 +213,7 @@ const internalRenderStillRaw = (options) => {
213
213
  indent: options.indent,
214
214
  offthreadVideoCacheSizeInBytes: options.offthreadVideoCacheSizeInBytes,
215
215
  binariesDirectory: options.binariesDirectory,
216
+ forceIPv4: false,
216
217
  }, {
217
218
  onDownload: options.onDownload,
218
219
  onError,
@@ -120,6 +120,7 @@ const internalSelectCompositionRaw = async (options) => {
120
120
  indent,
121
121
  offthreadVideoCacheSizeInBytes,
122
122
  binariesDirectory,
123
+ forceIPv4: false,
123
124
  }, {
124
125
  onDownload: () => undefined,
125
126
  onError,
@@ -10,6 +10,7 @@ export declare const serveStatic: (path: string | null, options: {
10
10
  indent: boolean;
11
11
  offthreadVideoCacheSizeInBytes: number | null;
12
12
  binariesDirectory: string | null;
13
+ forceIPv4: boolean;
13
14
  }) => Promise<{
14
15
  port: number;
15
16
  close: () => Promise<void>;
@@ -47,7 +47,7 @@ const serveStatic = async (path, options) => {
47
47
  });
48
48
  let selectedPort = null;
49
49
  const maxTries = 5;
50
- const portConfig = (0, port_config_1.getPortConfig)();
50
+ const portConfig = (0, port_config_1.getPortConfig)(options.forceIPv4);
51
51
  for (let i = 0; i < maxTries; i++) {
52
52
  let unlock = () => { };
53
53
  try {
@@ -0,0 +1,3 @@
1
+ import type { AudioCodec } from './audio-codec';
2
+ import type { Codec } from './codec';
3
+ export declare const canConcatSeamlessly: (audioCodec: AudioCodec | null, codec: Codec) => boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canConcatSeamlessly = void 0;
4
+ const canConcatSeamlessly = (audioCodec, codec) => {
5
+ return audioCodec === 'aac' && codec === 'h264';
6
+ };
7
+ exports.canConcatSeamlessly = canConcatSeamlessly;
@@ -0,0 +1,13 @@
1
+ export declare const supportedAudioCodecs: {
2
+ readonly h264: readonly ["aac", "pcm-16", "mp3"];
3
+ readonly 'h264-mkv': readonly ["pcm-16", "mp3"];
4
+ readonly 'h264-ts': readonly ["pcm-16", "aac"];
5
+ readonly aac: readonly ["aac", "pcm-16"];
6
+ readonly gif: readonly [];
7
+ readonly h265: readonly ["aac", "pcm-16"];
8
+ readonly mp3: readonly ["mp3", "pcm-16"];
9
+ readonly prores: readonly ["aac", "pcm-16"];
10
+ readonly vp8: readonly ["opus", "pcm-16"];
11
+ readonly vp9: readonly ["opus", "pcm-16"];
12
+ readonly wav: readonly ["pcm-16"];
13
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportedAudioCodecs = void 0;
4
+ exports.supportedAudioCodecs = {
5
+ h264: ['aac', 'pcm-16', 'mp3'],
6
+ 'h264-mkv': ['pcm-16', 'mp3'],
7
+ 'h264-ts': ['pcm-16', 'aac'],
8
+ aac: ['aac', 'pcm-16'],
9
+ gif: [],
10
+ h265: ['aac', 'pcm-16'],
11
+ mp3: ['mp3', 'pcm-16'],
12
+ prores: ['aac', 'pcm-16'],
13
+ vp8: ['opus', 'pcm-16'],
14
+ vp9: ['opus', 'pcm-16'],
15
+ wav: ['pcm-16'],
16
+ };
@@ -5,18 +5,3 @@ export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Pr
5
5
  codec: Codec;
6
6
  x264Preset: X264Preset | undefined;
7
7
  }) => void;
8
- export declare const x264Option: {
9
- name: string;
10
- cliFlag: "x264-preset";
11
- description: () => import("react/jsx-runtime").JSX.Element;
12
- ssrName: "x264Preset";
13
- docLink: string;
14
- type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
15
- getValue: ({ commandLine }: {
16
- commandLine: Record<string, unknown>;
17
- }) => {
18
- value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
19
- source: string;
20
- };
21
- setConfig: (profile: X264Preset | undefined) => void;
22
- };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.x264Option = exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
3
+ exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
5
4
  exports.x264PresetOptions = [
6
5
  'ultrafast',
7
6
  'superfast',
@@ -14,7 +13,6 @@ exports.x264PresetOptions = [
14
13
  'veryslow',
15
14
  'placebo',
16
15
  ];
17
- let preset;
18
16
  const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
19
17
  if (typeof x264Preset !== 'undefined' &&
20
18
  codec !== 'h264' &&
@@ -29,26 +27,3 @@ const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
29
27
  }
30
28
  };
31
29
  exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
32
- const cliFlag = 'x264-preset';
33
- const DEFAULT_PRESET = 'medium';
34
- exports.x264Option = {
35
- name: 'x264 Preset',
36
- cliFlag,
37
- description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Sets a x264 preset profile. Only applies to videos rendered with", ' ', (0, jsx_runtime_1.jsx)("code", { children: "h264" }), " codec.", (0, jsx_runtime_1.jsx)("br", {}), "Possible values: ", (0, jsx_runtime_1.jsx)("code", { children: "superfast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryfast" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "faster" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "fast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "medium" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "slow" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "slower" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryslow" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "placebo" }), ".", (0, jsx_runtime_1.jsx)("br", {}), "Default: ", (0, jsx_runtime_1.jsx)("code", { children: DEFAULT_PRESET })] })),
38
- ssrName: 'x264Preset',
39
- docLink: 'https://www.remotion.dev/docs/renderer/render-media',
40
- type: 'fast',
41
- getValue: ({ commandLine }) => {
42
- const value = commandLine[cliFlag];
43
- if (typeof value !== 'undefined') {
44
- return { value: value, source: 'cli' };
45
- }
46
- if (typeof preset !== 'undefined') {
47
- return { value: preset, source: 'config' };
48
- }
49
- return { value: DEFAULT_PRESET, source: 'default' };
50
- },
51
- setConfig: (profile) => {
52
- preset = profile;
53
- },
54
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.124",
3
+ "version": "4.0.126",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.7.0",
21
- "remotion": "4.0.124"
21
+ "remotion": "4.0.126"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -40,13 +40,13 @@
40
40
  "vitest": "0.31.1"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@remotion/compositor-darwin-arm64": "4.0.124",
44
- "@remotion/compositor-darwin-x64": "4.0.124",
45
- "@remotion/compositor-linux-arm64-gnu": "4.0.124",
46
- "@remotion/compositor-linux-arm64-musl": "4.0.124",
47
- "@remotion/compositor-linux-x64-gnu": "4.0.124",
48
- "@remotion/compositor-win32-x64-msvc": "4.0.124",
49
- "@remotion/compositor-linux-x64-musl": "4.0.124"
43
+ "@remotion/compositor-darwin-arm64": "4.0.126",
44
+ "@remotion/compositor-linux-arm64-gnu": "4.0.126",
45
+ "@remotion/compositor-darwin-x64": "4.0.126",
46
+ "@remotion/compositor-linux-arm64-musl": "4.0.126",
47
+ "@remotion/compositor-linux-x64-musl": "4.0.126",
48
+ "@remotion/compositor-win32-x64-msvc": "4.0.126",
49
+ "@remotion/compositor-linux-x64-gnu": "4.0.126"
50
50
  },
51
51
  "keywords": [
52
52
  "remotion",
@@ -1,3 +0,0 @@
1
- import type { Codec } from './codec';
2
- import type { PixelFormat } from './pixel-format';
3
- export declare const warnAboutM2Bug: (codec: Codec | null, pixelFormat: PixelFormat | null) => void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warnAboutM2Bug = void 0;
4
- const node_os_1 = require("node:os");
5
- const warnAboutM2Bug = (codec, pixelFormat) => {
6
- const isM2 = (0, node_os_1.cpus)().find((c) => c.model.includes('Apple M2'));
7
- if (codec === 'prores' && pixelFormat === 'yuv422p10le' && isM2) {
8
- console.warn();
9
- console.warn('⚠️ Known issue: Apple M2 CPUs currently suffer from a bug where transparent ProRes videos have flickering. https://github.com/remotion-dev/remotion/issues/1929');
10
- }
11
- };
12
- exports.warnAboutM2Bug = warnAboutM2Bug;
File without changes
@@ -1 +0,0 @@
1
- "use strict";