@remotion/renderer 4.0.125 → 4.0.127

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 (65) hide show
  1. package/dist/assets/convert-assets-to-file-urls.d.ts +2 -1
  2. package/dist/assets/convert-assets-to-file-urls.js +6 -4
  3. package/dist/assets/download-map.d.ts +6 -2
  4. package/dist/assets/ffmpeg-volume-expression.js +7 -3
  5. package/dist/calculate-ffmpeg-filters.d.ts +4 -2
  6. package/dist/calculate-ffmpeg-filters.js +10 -17
  7. package/dist/check-apple-silicon.d.ts +1 -3
  8. package/dist/check-apple-silicon.js +2 -32
  9. package/dist/client.d.ts +124 -88
  10. package/dist/combine-audio.js +6 -6
  11. package/dist/combine-videos.js +1 -0
  12. package/dist/compress-audio.d.ts +2 -2
  13. package/dist/compress-audio.js +4 -7
  14. package/dist/create-audio.d.ts +11 -4
  15. package/dist/create-audio.js +7 -5
  16. package/dist/create-combined-video.d.ts +3 -2
  17. package/dist/create-combined-video.js +7 -1
  18. package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
  19. package/dist/create-silent-audio.d.ts +2 -2
  20. package/dist/create-silent-audio.js +2 -2
  21. package/dist/does-have-m2-bug.d.ts +3 -0
  22. package/dist/does-have-m2-bug.js +12 -0
  23. package/dist/get-extension-from-audio-codec.d.ts +2 -2
  24. package/dist/get-extension-from-codec.d.ts +2 -2
  25. package/dist/get-extra-frames-to-capture.d.ts +13 -0
  26. package/dist/get-extra-frames-to-capture.js +63 -0
  27. package/dist/index.d.ts +40 -40
  28. package/dist/logger.js +3 -1
  29. package/dist/merge-audio-track.d.ts +1 -1
  30. package/dist/merge-audio-track.js +7 -11
  31. package/dist/options/audio-codec.d.ts +5 -5
  32. package/dist/options/index.d.ts +44 -8
  33. package/dist/options/index.js +4 -0
  34. package/dist/options/options-map.d.ts +26 -26
  35. package/dist/options/options-map.js +1 -1
  36. package/dist/options/prores-profile.d.ts +0 -0
  37. package/dist/options/prores-profile.js +1 -0
  38. package/dist/options/{separate-audio-to.d.ts → public-dir.d.ts} +5 -5
  39. package/dist/options/public-dir.js +37 -0
  40. package/dist/options/public-path.d.ts +18 -0
  41. package/dist/options/public-path.js +37 -0
  42. package/dist/options/video-codec.d.ts +1 -1
  43. package/dist/preprocess-audio-track.d.ts +3 -1
  44. package/dist/preprocess-audio-track.js +7 -7
  45. package/dist/pure.d.ts +3 -3
  46. package/dist/render-frames.d.ts +6 -0
  47. package/dist/render-frames.js +70 -29
  48. package/dist/render-media.d.ts +1 -0
  49. package/dist/render-media.js +5 -2
  50. package/dist/stitch-frames-to-video.d.ts +1 -1
  51. package/dist/stitch-frames-to-video.js +9 -9
  52. package/dist/stringify-ffmpeg-filter.d.ts +3 -2
  53. package/dist/stringify-ffmpeg-filter.js +56 -14
  54. package/dist/take-frame-and-compose.d.ts +1 -0
  55. package/dist/validate-output-filename.d.ts +1 -1
  56. package/dist/x264-preset.d.ts +15 -0
  57. package/dist/x264-preset.js +26 -1
  58. package/package.json +9 -9
  59. package/dist/can-concatenate-seamlessly.d.ts +0 -3
  60. package/dist/can-concatenate-seamlessly.js +0 -7
  61. package/dist/options/separate-audio-to.js +0 -31
  62. package/dist/should-seamless.d.ts +0 -3
  63. package/dist/should-seamless.js +0 -7
  64. package/dist/supported-audio-codecs.d.ts +0 -13
  65. package/dist/supported-audio-codecs.js +0 -16
@@ -2,7 +2,13 @@
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 createCombinedVideo = async ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, }) => {
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
+ }
6
12
  await (0, combine_video_streams_1.combineVideoStreams)({
7
13
  addRemotionMetadata,
8
14
  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
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { LogLevel } from './log-level';
2
2
  import type { CancelSignal } from './make-cancel-signal';
3
- export declare const createSilentAudio: ({ numberOfSeconds, outName, indent, logLevel, binariesDirectory, cancelSignal, }: {
4
- numberOfSeconds: number;
3
+ export declare const createSilentAudio: ({ outName, indent, logLevel, binariesDirectory, cancelSignal, chunkLengthInSeconds, }: {
4
+ chunkLengthInSeconds: number;
5
5
  outName: string;
6
6
  indent: boolean;
7
7
  logLevel: LogLevel;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSilentAudio = void 0;
4
4
  const call_ffmpeg_1 = require("./call-ffmpeg");
5
5
  const sample_rate_1 = require("./sample-rate");
6
- const createSilentAudio = async ({ numberOfSeconds, outName, indent, logLevel, binariesDirectory, cancelSignal, }) => {
6
+ const createSilentAudio = async ({ outName, indent, logLevel, binariesDirectory, cancelSignal, chunkLengthInSeconds, }) => {
7
7
  await (0, call_ffmpeg_1.callFf)({
8
8
  bin: 'ffmpeg',
9
9
  args: [
@@ -14,7 +14,7 @@ const createSilentAudio = async ({ numberOfSeconds, outName, indent, logLevel, b
14
14
  '-c:a',
15
15
  'pcm_s16le',
16
16
  '-t',
17
- String(numberOfSeconds),
17
+ String(chunkLengthInSeconds),
18
18
  '-ar',
19
19
  String(sample_rate_1.DEFAULT_SAMPLE_RATE),
20
20
  outName,
@@ -0,0 +1,3 @@
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;
@@ -0,0 +1,12 @@
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;
@@ -1,2 +1,2 @@
1
- import type { AudioCodec } from './options/audio-codec';
2
- export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "aac" | "mp3" | "opus" | "wav";
1
+ import type { AudioCodec } from './audio-codec';
2
+ export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "mp3" | "aac" | "wav" | "opus";
@@ -1,6 +1,6 @@
1
1
  import type { Codec } from './codec';
2
2
  import type { FileExtension } from './file-extensions';
3
3
  import type { AudioCodec } from './options/audio-codec';
4
- export declare const getFileExtensionFromCodec: <T extends "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
5
- export declare const makeFileExtensionMap: () => Record<string, ("aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
4
+ export declare const getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: AudioCodec | null) => FileExtension;
5
+ export declare const makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
6
6
  export declare const defaultCodecsForFileExtension: Record<FileExtension, Codec>;
@@ -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,63 @@
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
+ // Inspired by https://github.com/wistia/seamless-aac-split-and-stitch-demo
9
+ // We can seamlessly concatenate AAC files if we capture a bit of extra audio on both sides in each chunk and then align the audio correctly.
10
+ // This function calculates which extra frames should be evaluated for their audio content.
11
+ const getExtraFramesToCapture = ({ compositionStart, realFrameRange, fps, forSeamlessAacConcatenation, }) => {
12
+ // If the feature is disabled, don't capture extra frames.
13
+ if (!forSeamlessAacConcatenation) {
14
+ return {
15
+ extraFramesToCaptureAssets: [],
16
+ chunkLengthInSeconds: (realFrameRange[1] - realFrameRange[0] + 1) / fps,
17
+ trimLeftOffset: 0,
18
+ trimRightOffset: 0,
19
+ };
20
+ }
21
+ // If this video is just a chunk as part of a larger video,
22
+ // We also need to know the start time of this chunk to align it correctly.
23
+ const chunkStart = realFrameRange[0];
24
+ // If we are only rendering a portion of the composition, we also need to account for that.
25
+ // It cannot be that the chunk start time is earlier than the composition time.
26
+ if (chunkStart < compositionStart) {
27
+ throw new Error('chunkStart may not be below compositionStart');
28
+ }
29
+ const realLeftEnd = chunkStart - compositionStart;
30
+ if (realLeftEnd < 0) {
31
+ throw new Error('chunkStat - compositionStart may not be below 0');
32
+ }
33
+ const realRightEnd = realLeftEnd + (realFrameRange[1] - realFrameRange[0] + 1);
34
+ // Find the closest AAC packet border and add two AAC packet padding.
35
+ const aacAdjustedLeftEnd = Math.max(0, (0, combine_audio_1.getClosestAlignedTime)(realLeftEnd / fps) - 2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE));
36
+ const aacAdjustedRightEnd = (0, combine_audio_1.getClosestAlignedTime)(realRightEnd / fps) +
37
+ 2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE);
38
+ // Now find the additional frames that we need to capture to have enough audio
39
+ const alignedStartFrameWithoutOffset = Math.floor(aacAdjustedLeftEnd * fps);
40
+ const alignedStartFrame = alignedStartFrameWithoutOffset + compositionStart;
41
+ const alignedEndFrame = Math.ceil(aacAdjustedRightEnd * fps) + compositionStart;
42
+ const extraFramesToCaptureAudioOnlyFrontend = new Array(realFrameRange[0] - alignedStartFrame)
43
+ .fill(true)
44
+ .map((_, f) => f + alignedStartFrame);
45
+ const extraFramesToCaptureAudioOnlyBackend = new Array(alignedEndFrame - realFrameRange[1] - 1)
46
+ .fill(true)
47
+ .map((_, f) => f + realFrameRange[1] + 1);
48
+ // But now, we might have too much audio, since the extra frames only have a `1 / fps` step.
49
+ // When creating the lossless audio for a chunk, we need to shave that extra audio off.
50
+ const trimLeftOffset = (aacAdjustedLeftEnd * fps - alignedStartFrameWithoutOffset) / fps;
51
+ const trimRightOffset = (aacAdjustedRightEnd * fps - Math.ceil(aacAdjustedRightEnd * fps)) / fps;
52
+ const chunkLengthInSeconds = aacAdjustedRightEnd - aacAdjustedLeftEnd;
53
+ return {
54
+ extraFramesToCaptureAssets: [
55
+ ...extraFramesToCaptureAudioOnlyFrontend,
56
+ ...extraFramesToCaptureAudioOnlyBackend,
57
+ ],
58
+ chunkLengthInSeconds,
59
+ trimLeftOffset,
60
+ trimRightOffset,
61
+ };
62
+ };
63
+ exports.getExtraFramesToCapture = getExtraFramesToCapture;
package/dist/index.d.ts CHANGED
@@ -69,10 +69,10 @@ export declare const RenderInternals: {
69
69
  width: number;
70
70
  height: number;
71
71
  scale: number;
72
- codec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
72
+ codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
73
73
  wantsImageSequence: boolean;
74
74
  }) => void;
75
- getFileExtensionFromCodec: <T extends "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: "pcm-16" | "aac" | "mp3" | "opus" | null) => import("./file-extensions").FileExtension;
75
+ getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
76
76
  tmpDir: (str: string) => string;
77
77
  deleteDirectory: (directory: string) => void;
78
78
  isServeUrl: (potentialUrl: string) => boolean;
@@ -129,7 +129,7 @@ export declare const RenderInternals: {
129
129
  };
130
130
  registerErrorSymbolicationLock: () => number;
131
131
  unlockErrorSymbolicationLock: (id: number) => void;
132
- canUseParallelEncoding: (codec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
132
+ canUseParallelEncoding: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
133
133
  mimeContentType: typeof mimeContentType;
134
134
  mimeLookup: typeof mimeLookup;
135
135
  validateConcurrency: ({ setting, value, checkIfValidForCurrentMachine, }: {
@@ -146,8 +146,8 @@ export declare const RenderInternals: {
146
146
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
147
147
  validateJpegQuality: (q: unknown) => void;
148
148
  DEFAULT_TIMEOUT: number;
149
- DEFAULT_CODEC: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
150
- isAudioCodec: (codec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null | undefined) => boolean;
149
+ DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
150
+ isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null | undefined) => boolean;
151
151
  logLevels: readonly ["verbose", "info", "warn", "error"];
152
152
  isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
153
153
  isValidLogLevel: (level: string) => boolean;
@@ -164,10 +164,10 @@ export declare const RenderInternals: {
164
164
  output: string;
165
165
  onProgress: (p: number) => void;
166
166
  numberOfFrames: number;
167
- codec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
167
+ codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
168
168
  fps: number;
169
169
  numberOfGifLoops: number | null;
170
- resolvedAudioCodec: "pcm-16" | "aac" | "mp3" | "opus" | null;
170
+ resolvedAudioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
171
171
  audioBitrate: string | null;
172
172
  indent: boolean;
173
173
  logLevel: "verbose" | "info" | "warn" | "error";
@@ -180,14 +180,14 @@ export declare const RenderInternals: {
180
180
  getMinConcurrency: () => number;
181
181
  getMaxConcurrency: () => number;
182
182
  getDefaultAudioCodec: ({ codec, preferLossless, }: {
183
- codec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
183
+ codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
184
184
  preferLossless: boolean;
185
- }) => "pcm-16" | "aac" | "mp3" | "opus" | null;
185
+ }) => "mp3" | "aac" | "pcm-16" | "opus" | null;
186
186
  defaultFileExtensionMap: {
187
- aac: {
187
+ h264: {
188
188
  default: import("./file-extensions").FileExtension;
189
189
  forAudioCodec: {
190
- "pcm-16": {
190
+ mp3: {
191
191
  possible: import("./file-extensions").FileExtension[];
192
192
  default: import("./file-extensions").FileExtension;
193
193
  };
@@ -195,72 +195,72 @@ export declare const RenderInternals: {
195
195
  possible: import("./file-extensions").FileExtension[];
196
196
  default: import("./file-extensions").FileExtension;
197
197
  };
198
+ "pcm-16": {
199
+ possible: import("./file-extensions").FileExtension[];
200
+ default: import("./file-extensions").FileExtension;
201
+ };
198
202
  };
199
203
  };
200
- mp3: {
204
+ h265: {
201
205
  default: import("./file-extensions").FileExtension;
202
206
  forAudioCodec: {
203
- "pcm-16": {
207
+ aac: {
204
208
  possible: import("./file-extensions").FileExtension[];
205
209
  default: import("./file-extensions").FileExtension;
206
210
  };
207
- mp3: {
211
+ "pcm-16": {
208
212
  possible: import("./file-extensions").FileExtension[];
209
213
  default: import("./file-extensions").FileExtension;
210
214
  };
211
215
  };
212
216
  };
213
- h264: {
217
+ vp8: {
214
218
  default: import("./file-extensions").FileExtension;
215
219
  forAudioCodec: {
216
220
  "pcm-16": {
217
221
  possible: import("./file-extensions").FileExtension[];
218
222
  default: import("./file-extensions").FileExtension;
219
223
  };
220
- aac: {
221
- possible: import("./file-extensions").FileExtension[];
222
- default: import("./file-extensions").FileExtension;
223
- };
224
- mp3: {
224
+ opus: {
225
225
  possible: import("./file-extensions").FileExtension[];
226
226
  default: import("./file-extensions").FileExtension;
227
227
  };
228
228
  };
229
229
  };
230
- h265: {
230
+ vp9: {
231
231
  default: import("./file-extensions").FileExtension;
232
232
  forAudioCodec: {
233
233
  "pcm-16": {
234
234
  possible: import("./file-extensions").FileExtension[];
235
235
  default: import("./file-extensions").FileExtension;
236
236
  };
237
- aac: {
237
+ opus: {
238
238
  possible: import("./file-extensions").FileExtension[];
239
239
  default: import("./file-extensions").FileExtension;
240
240
  };
241
241
  };
242
242
  };
243
- vp8: {
243
+ mp3: {
244
244
  default: import("./file-extensions").FileExtension;
245
245
  forAudioCodec: {
246
- "pcm-16": {
246
+ mp3: {
247
247
  possible: import("./file-extensions").FileExtension[];
248
248
  default: import("./file-extensions").FileExtension;
249
249
  };
250
- opus: {
250
+ "pcm-16": {
251
251
  possible: import("./file-extensions").FileExtension[];
252
252
  default: import("./file-extensions").FileExtension;
253
253
  };
254
254
  };
255
255
  };
256
- vp9: {
256
+ aac: {
257
257
  default: import("./file-extensions").FileExtension;
258
258
  forAudioCodec: {
259
- "pcm-16": {
259
+ aac: {
260
260
  possible: import("./file-extensions").FileExtension[];
261
261
  default: import("./file-extensions").FileExtension;
262
262
  };
263
- opus: {
263
+ "pcm-16": {
264
264
  possible: import("./file-extensions").FileExtension[];
265
265
  default: import("./file-extensions").FileExtension;
266
266
  };
@@ -278,11 +278,11 @@ export declare const RenderInternals: {
278
278
  prores: {
279
279
  default: import("./file-extensions").FileExtension;
280
280
  forAudioCodec: {
281
- "pcm-16": {
281
+ aac: {
282
282
  possible: import("./file-extensions").FileExtension[];
283
283
  default: import("./file-extensions").FileExtension;
284
284
  };
285
- aac: {
285
+ "pcm-16": {
286
286
  possible: import("./file-extensions").FileExtension[];
287
287
  default: import("./file-extensions").FileExtension;
288
288
  };
@@ -291,11 +291,11 @@ export declare const RenderInternals: {
291
291
  "h264-mkv": {
292
292
  default: import("./file-extensions").FileExtension;
293
293
  forAudioCodec: {
294
- "pcm-16": {
294
+ mp3: {
295
295
  possible: import("./file-extensions").FileExtension[];
296
296
  default: import("./file-extensions").FileExtension;
297
297
  };
298
- mp3: {
298
+ "pcm-16": {
299
299
  possible: import("./file-extensions").FileExtension[];
300
300
  default: import("./file-extensions").FileExtension;
301
301
  };
@@ -304,11 +304,11 @@ export declare const RenderInternals: {
304
304
  "h264-ts": {
305
305
  default: import("./file-extensions").FileExtension;
306
306
  forAudioCodec: {
307
- "pcm-16": {
307
+ aac: {
308
308
  possible: import("./file-extensions").FileExtension[];
309
309
  default: import("./file-extensions").FileExtension;
310
310
  };
311
- aac: {
311
+ "pcm-16": {
312
312
  possible: import("./file-extensions").FileExtension[];
313
313
  default: import("./file-extensions").FileExtension;
314
314
  };
@@ -332,8 +332,8 @@ export declare const RenderInternals: {
332
332
  readonly vp9: readonly ["opus", "pcm-16"];
333
333
  readonly wav: readonly ["pcm-16"];
334
334
  };
335
- makeFileExtensionMap: () => Record<string, ("aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
336
- defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
335
+ makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
336
+ defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
337
337
  getExecutablePath: ({ indent, logLevel, type, binariesDirectory, }: {
338
338
  type: "ffmpeg" | "ffprobe" | "compositor";
339
339
  indent: boolean;
@@ -737,12 +737,12 @@ export declare const RenderInternals: {
737
737
  hostsToTry: string[];
738
738
  };
739
739
  makeDownloadMap: () => import("./assets/download-map").DownloadMap;
740
- getExtensionFromAudioCodec: (audioCodec: "pcm-16" | "aac" | "mp3" | "opus") => "aac" | "mp3" | "opus" | "wav";
740
+ getExtensionFromAudioCodec: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus") => "mp3" | "aac" | "wav" | "opus";
741
741
  makeFileExecutableIfItIsNot: (path: string) => void;
742
742
  resolveAudioCodec: ({ codec, setting, preferLossless, separateAudioTo, }: {
743
- setting: "pcm-16" | "aac" | "mp3" | "opus" | null;
744
- codec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
743
+ setting: "mp3" | "aac" | "pcm-16" | "opus" | null;
744
+ codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
745
745
  preferLossless: boolean;
746
746
  separateAudioTo: string | null;
747
- }) => "pcm-16" | "aac" | "mp3" | "opus" | null;
747
+ }) => "mp3" | "aac" | "pcm-16" | "opus" | null;
748
748
  };
package/dist/logger.js CHANGED
@@ -29,7 +29,9 @@ exports.Log = {
29
29
  },
30
30
  info: (options, ...args) => {
31
31
  (0, repro_1.writeInRepro)('info', ...args);
32
- return console.log(...[options.indent ? exports.INDENT_TOKEN : null].filter(truthy_1.truthy).concat(args));
32
+ if ((0, log_level_1.isEqualOrBelowLogLevel)(options.logLevel, 'info')) {
33
+ return console.log(...[options.indent ? exports.INDENT_TOKEN : null].filter(truthy_1.truthy).concat(args));
34
+ }
33
35
  },
34
36
  warn: (options, ...args) => {
35
37
  (0, repro_1.writeInRepro)('warn', ...args);
@@ -13,7 +13,7 @@ type Options = {
13
13
  cancelSignal: CancelSignal | undefined;
14
14
  onProgress: (progress: number) => void;
15
15
  fps: number;
16
- expectedFrames: number;
16
+ chunkLengthInSeconds: number;
17
17
  };
18
18
  export declare const mergeAudioTrack: (options: Options) => Promise<void>;
19
19
  export {};
@@ -11,18 +11,16 @@ const create_ffmpeg_complex_filter_1 = require("./create-ffmpeg-complex-filter")
11
11
  const create_ffmpeg_merge_filter_1 = require("./create-ffmpeg-merge-filter");
12
12
  const create_silent_audio_1 = require("./create-silent-audio");
13
13
  const delete_directory_1 = require("./delete-directory");
14
- const logger_1 = require("./logger");
15
14
  const p_limit_1 = require("./p-limit");
16
15
  const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
17
16
  const tmp_dir_1 = require("./tmp-dir");
18
17
  const truthy_1 = require("./truthy");
19
- const mergeAudioTrackUnlimited = async ({ outName, files, downloadMap, remotionRoot, indent, logLevel, binariesDirectory, cancelSignal, onProgress, fps, expectedFrames, }) => {
18
+ const mergeAudioTrackUnlimited = async ({ outName, files, downloadMap, remotionRoot, indent, logLevel, binariesDirectory, cancelSignal, onProgress, fps, chunkLengthInSeconds, }) => {
20
19
  var _a;
21
- const numberOfSeconds = Number((expectedFrames / fps).toFixed(3));
22
20
  if (files.length === 0) {
23
21
  await (0, create_silent_audio_1.createSilentAudio)({
24
22
  outName,
25
- numberOfSeconds,
23
+ chunkLengthInSeconds,
26
24
  indent,
27
25
  logLevel,
28
26
  binariesDirectory,
@@ -48,7 +46,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, downloadMap, remotionR
48
46
  const chunkOutname = node_path_1.default.join(tempPath, `chunk-${i}.wav`);
49
47
  await (0, exports.mergeAudioTrack)({
50
48
  files: chunkFiles,
51
- expectedFrames,
49
+ chunkLengthInSeconds,
52
50
  outName: chunkOutname,
53
51
  downloadMap,
54
52
  remotionRoot,
@@ -84,7 +82,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, downloadMap, remotionR
84
82
  callProgress();
85
83
  },
86
84
  fps,
87
- expectedFrames,
85
+ chunkLengthInSeconds,
88
86
  });
89
87
  return;
90
88
  }
@@ -97,6 +95,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, downloadMap, remotionR
97
95
  downloadMap,
98
96
  });
99
97
  const args = [
98
+ ['-hide_banner'],
100
99
  ...files.map((f) => ['-i', f.outName]),
101
100
  mergeFilter,
102
101
  ['-c:a', 'pcm_s16le'],
@@ -116,11 +115,8 @@ const mergeAudioTrackUnlimited = async ({ outName, files, downloadMap, remotionR
116
115
  (_a = task.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
117
116
  const utf8 = data.toString('utf8');
118
117
  const parsed = (0, parse_ffmpeg_progress_1.parseFfmpegProgress)(utf8, fps);
119
- if (parsed === undefined) {
120
- logger_1.Log.verbose({ indent, logLevel }, utf8);
121
- }
122
- else {
123
- onProgress(parsed / expectedFrames);
118
+ if (parsed !== undefined) {
119
+ onProgress(parsed / (chunkLengthInSeconds * fps));
124
120
  }
125
121
  });
126
122
  await task;
@@ -23,25 +23,25 @@ export declare const defaultAudioCodecs: {
23
23
  [k in 'compressed' | 'lossless']: (typeof supportedAudioCodecs)[key][number] | null;
24
24
  };
25
25
  };
26
- export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "aac" | "mp3" | "opus" | "wav";
26
+ export declare const getExtensionFromAudioCodec: (audioCodec: AudioCodec) => "mp3" | "aac" | "wav" | "opus";
27
27
  export declare const resolveAudioCodec: ({ codec, setting, preferLossless, separateAudioTo, }: {
28
28
  setting: AudioCodec | null;
29
29
  codec: Codec;
30
30
  preferLossless: boolean;
31
31
  separateAudioTo: string | null;
32
- }) => "pcm-16" | "aac" | "mp3" | "opus" | null;
32
+ }) => "mp3" | "aac" | "pcm-16" | "opus" | null;
33
33
  export declare const getDefaultAudioCodec: ({ codec, preferLossless, }: {
34
34
  codec: Codec;
35
35
  preferLossless: boolean;
36
36
  }) => AudioCodec | null;
37
37
  export declare const audioCodecOption: {
38
38
  cliFlag: "audio-codec";
39
- setConfig: (audioCodec: "pcm-16" | "aac" | "mp3" | "opus" | null) => void;
39
+ setConfig: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => void;
40
40
  getValue: ({ commandLine }: {
41
41
  commandLine: Record<string, unknown>;
42
42
  }) => {
43
43
  source: string;
44
- value: "pcm-16" | "aac" | "mp3" | "opus";
44
+ value: "mp3" | "aac" | "pcm-16" | "opus";
45
45
  } | {
46
46
  source: string;
47
47
  value: null;
@@ -50,6 +50,6 @@ export declare const audioCodecOption: {
50
50
  docLink: string;
51
51
  name: string;
52
52
  ssrName: "audioCodec";
53
- type: "pcm-16" | "aac" | "mp3" | "opus";
53
+ type: "mp3" | "aac" | "pcm-16" | "opus";
54
54
  };
55
55
  export {};
@@ -2,12 +2,12 @@ import type { AnyRemotionOption } from './option';
2
2
  export declare const allOptions: {
3
3
  audioCodecOption: {
4
4
  cliFlag: "audio-codec";
5
- setConfig: (audioCodec: "pcm-16" | "aac" | "mp3" | "opus" | null) => void;
5
+ setConfig: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => void;
6
6
  getValue: ({ commandLine }: {
7
7
  commandLine: Record<string, unknown>;
8
8
  }) => {
9
9
  source: string;
10
- value: "pcm-16" | "aac" | "mp3" | "opus";
10
+ value: "mp3" | "aac" | "pcm-16" | "opus";
11
11
  } | {
12
12
  source: string;
13
13
  value: null;
@@ -16,7 +16,7 @@ export declare const allOptions: {
16
16
  docLink: string;
17
17
  name: string;
18
18
  ssrName: "audioCodec";
19
- type: "pcm-16" | "aac" | "mp3" | "opus";
19
+ type: "mp3" | "aac" | "pcm-16" | "opus";
20
20
  };
21
21
  scaleOption: {
22
22
  name: string;
@@ -135,17 +135,17 @@ export declare const allOptions: {
135
135
  description: () => import("react/jsx-runtime").JSX.Element;
136
136
  ssrName: string;
137
137
  docLink: string;
138
- type: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
138
+ type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
139
139
  getValue: ({ commandLine }: {
140
140
  commandLine: Record<string, unknown>;
141
141
  }, { compositionCodec, configFile, downloadName, outName, uiCodec, }: {
142
142
  outName: string | null;
143
143
  downloadName: string | null;
144
- configFile: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
145
- uiCodec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
146
- compositionCodec: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
144
+ configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
145
+ uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
146
+ compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
147
147
  }) => {
148
- value: "aac" | "mp3" | "h264" | "h265" | "vp8" | "vp9" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
148
+ value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
149
149
  source: string;
150
150
  };
151
151
  setConfig: (newCodec: import("..").CodecOrUndefined) => void;
@@ -505,6 +505,42 @@ export declare const allOptions: {
505
505
  ssrName: string;
506
506
  type: string | null;
507
507
  };
508
+ publicPathOption: {
509
+ name: string;
510
+ cliFlag: "public-path";
511
+ description: () => import("react/jsx-runtime").JSX.Element;
512
+ ssrName: "publicPath";
513
+ docLink: string;
514
+ getValue: ({ commandLine }: {
515
+ commandLine: Record<string, unknown>;
516
+ }) => {
517
+ source: string;
518
+ value: string;
519
+ } | {
520
+ source: string;
521
+ value: null;
522
+ };
523
+ setConfig: (value: string | null) => void;
524
+ type: string | null;
525
+ };
526
+ publicDirOption: {
527
+ name: string;
528
+ cliFlag: "public-dir";
529
+ description: () => import("react/jsx-runtime").JSX.Element;
530
+ ssrName: "publicDir";
531
+ docLink: string;
532
+ getValue: ({ commandLine }: {
533
+ commandLine: Record<string, unknown>;
534
+ }) => {
535
+ source: string;
536
+ value: string;
537
+ } | {
538
+ source: string;
539
+ value: null;
540
+ };
541
+ setConfig: (value: string | null) => void;
542
+ type: string | null;
543
+ };
508
544
  };
509
545
  export type AvailableOptions = keyof typeof allOptions;
510
546
  export type TypeOfOption<Type> = Type extends AnyRemotionOption<infer X> ? X : never;
@@ -24,6 +24,8 @@ const number_of_gif_loops_1 = require("./number-of-gif-loops");
24
24
  const offthreadvideo_cache_size_1 = require("./offthreadvideo-cache-size");
25
25
  const overwrite_1 = require("./overwrite");
26
26
  const prefer_lossless_1 = require("./prefer-lossless");
27
+ const public_dir_1 = require("./public-dir");
28
+ const public_path_1 = require("./public-path");
27
29
  const repro_1 = require("./repro");
28
30
  const scale_1 = require("./scale");
29
31
  const separate_audio_1 = require("./separate-audio");
@@ -64,4 +66,6 @@ exports.allOptions = {
64
66
  binariesDirectoryOption: binaries_directory_1.binariesDirectoryOption,
65
67
  forSeamlessAacConcatenationOption: for_seamless_aac_concatenation_1.forSeamlessAacConcatenationOption,
66
68
  separateAudioOption: separate_audio_1.separateAudioOption,
69
+ publicPathOption: public_path_1.publicPathOption,
70
+ publicDirOption: public_dir_1.publicDirOption,
67
71
  };