@remotion/renderer 4.0.446 → 4.0.448
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.
- package/dist/assets/apply-tone-frequency.d.ts +2 -1
- package/dist/assets/apply-tone-frequency.js +3 -4
- package/dist/assets/download-map.d.ts +1 -1
- package/dist/assets/download-map.js +2 -2
- package/dist/assets/inline-audio-mixing.d.ts +3 -2
- package/dist/assets/inline-audio-mixing.js +9 -9
- package/dist/check-version-requirements.js +21 -0
- package/dist/client.d.ts +96 -0
- package/dist/combine-audio.d.ts +4 -3
- package/dist/combine-audio.js +14 -12
- package/dist/combine-chunks.d.ts +2 -1
- package/dist/combine-chunks.js +4 -2
- package/dist/create-audio.d.ts +2 -1
- package/dist/create-audio.js +4 -1
- package/dist/create-silent-audio.d.ts +2 -1
- package/dist/create-silent-audio.js +3 -4
- package/dist/esm/client.mjs +885 -799
- package/dist/esm/error-handling.mjs +4 -0
- package/dist/esm/index.mjs +191 -112
- package/dist/get-compositions.js +4 -1
- package/dist/get-extra-frames-to-capture.d.ts +2 -1
- package/dist/get-extra-frames-to-capture.js +5 -5
- package/dist/index.d.ts +22 -3
- package/dist/make-page.d.ts +2 -1
- package/dist/make-page.js +5 -2
- package/dist/merge-audio-track.d.ts +1 -0
- package/dist/merge-audio-track.js +4 -1
- package/dist/options/allow-html-in-canvas.d.ts +16 -0
- package/dist/options/allow-html-in-canvas.js +31 -0
- package/dist/options/index.d.ts +32 -0
- package/dist/options/index.js +4 -0
- package/dist/options/options-map.d.ts +64 -0
- package/dist/options/options-map.js +5 -0
- package/dist/options/public-license-key.js +1 -1
- package/dist/options/sample-rate.d.ts +16 -0
- package/dist/options/sample-rate.js +34 -0
- package/dist/prepare-server.d.ts +2 -1
- package/dist/prepare-server.js +2 -2
- package/dist/preprocess-audio-track.d.ts +1 -0
- package/dist/preprocess-audio-track.js +3 -3
- package/dist/print-useful-error-message.js +4 -0
- package/dist/render-frames.d.ts +1 -0
- package/dist/render-frames.js +9 -3
- package/dist/render-media.d.ts +1 -1
- package/dist/render-media.js +7 -3
- package/dist/render-still.js +5 -1
- package/dist/select-composition.js +4 -1
- package/dist/set-props-and-env.d.ts +1 -0
- package/dist/set-props-and-env.js +7 -3
- package/dist/stitch-frames-to-video.d.ts +3 -1
- package/dist/stitch-frames-to-video.js +4 -2
- package/dist/stringify-ffmpeg-filter.d.ts +2 -1
- package/dist/stringify-ffmpeg-filter.js +4 -5
- package/package.json +13 -13
package/dist/render-frames.js
CHANGED
|
@@ -35,7 +35,7 @@ const validate_1 = require("./validate");
|
|
|
35
35
|
const validate_scale_1 = require("./validate-scale");
|
|
36
36
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
37
37
|
const MAX_RETRIES_PER_FRAME = 1;
|
|
38
|
-
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, imageSequencePattern, mediaCacheSizeInBytes, onLog, darkMode, }) => {
|
|
38
|
+
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, imageSequencePattern, mediaCacheSizeInBytes, onLog, darkMode, sampleRate, }) => {
|
|
39
39
|
if (outputDir) {
|
|
40
40
|
if (!node_fs_1.default.existsSync(outputDir)) {
|
|
41
41
|
node_fs_1.default.mkdirSync(outputDir, {
|
|
@@ -50,6 +50,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
50
50
|
compositionStart,
|
|
51
51
|
realFrameRange,
|
|
52
52
|
forSeamlessAacConcatenation,
|
|
53
|
+
sampleRate,
|
|
53
54
|
});
|
|
54
55
|
const framesToRender = (0, get_duration_from_frame_range_1.getFramesToRender)(realFrameRange, everyNthFrame);
|
|
55
56
|
const lastFrame = framesToRender[framesToRender.length - 1];
|
|
@@ -78,6 +79,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
78
79
|
mediaCacheSizeInBytes,
|
|
79
80
|
onLog,
|
|
80
81
|
darkMode,
|
|
82
|
+
sampleRate,
|
|
81
83
|
});
|
|
82
84
|
};
|
|
83
85
|
const getPool = async () => {
|
|
@@ -196,7 +198,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
|
|
|
196
198
|
frameCount: framesToRender.length,
|
|
197
199
|
};
|
|
198
200
|
};
|
|
199
|
-
const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, imageSequencePattern, mediaCacheSizeInBytes, onLog, }) => {
|
|
201
|
+
const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, imageSequencePattern, mediaCacheSizeInBytes, onLog, sampleRate, }) => {
|
|
200
202
|
(0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderFrames()`');
|
|
201
203
|
(0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderFrames()`');
|
|
202
204
|
(0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderFrames()`', false);
|
|
@@ -242,6 +244,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
|
|
|
242
244
|
offthreadVideoCacheSizeInBytes,
|
|
243
245
|
binariesDirectory,
|
|
244
246
|
forceIPv4: false,
|
|
247
|
+
sampleRate,
|
|
245
248
|
}, {
|
|
246
249
|
onDownload,
|
|
247
250
|
}),
|
|
@@ -303,6 +306,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
|
|
|
303
306
|
mediaCacheSizeInBytes,
|
|
304
307
|
onLog,
|
|
305
308
|
darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
|
|
309
|
+
sampleRate,
|
|
306
310
|
});
|
|
307
311
|
}),
|
|
308
312
|
])
|
|
@@ -351,7 +355,8 @@ exports.internalRenderFrames = (0, wrap_with_error_handling_1.wrapWithErrorHandl
|
|
|
351
355
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
|
|
352
356
|
*/
|
|
353
357
|
const renderFrames = (options) => {
|
|
354
|
-
|
|
358
|
+
var _a;
|
|
359
|
+
const { composition, inputProps, onFrameUpdate, onStart, outputDir, serveUrl, browserExecutable, cancelSignal, chromiumOptions, concurrency, dumpBrowserLogs, envVariables, everyNthFrame, frameRange, imageFormat, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onArtifact, chromeMode, offthreadVideoThreads, imageSequencePattern, mediaCacheSizeInBytes, sampleRate, } = options;
|
|
355
360
|
if (!composition) {
|
|
356
361
|
throw new Error('No `composition` option has been specified for renderFrames()');
|
|
357
362
|
}
|
|
@@ -411,6 +416,7 @@ const renderFrames = (options) => {
|
|
|
411
416
|
imageSequencePattern: imageSequencePattern !== null && imageSequencePattern !== void 0 ? imageSequencePattern : null,
|
|
412
417
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
413
418
|
onLog: default_on_log_1.defaultOnLog,
|
|
419
|
+
sampleRate: (_a = sampleRate !== null && sampleRate !== void 0 ? sampleRate : composition.defaultSampleRate) !== null && _a !== void 0 ? _a : 48000,
|
|
414
420
|
});
|
|
415
421
|
};
|
|
416
422
|
exports.renderFrames = renderFrames;
|
package/dist/render-media.d.ts
CHANGED
|
@@ -148,5 +148,5 @@ type RenderMediaResult = {
|
|
|
148
148
|
contentType: string;
|
|
149
149
|
};
|
|
150
150
|
export declare const internalRenderMedia: (args_0: InternalRenderMediaOptions) => Promise<RenderMediaResult>;
|
|
151
|
-
export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, isProduction, ...apiKeyOrLicenseKey }: RenderMediaOptions) => Promise<RenderMediaResult>;
|
|
151
|
+
export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, isProduction, sampleRate, ...apiKeyOrLicenseKey }: RenderMediaOptions) => Promise<RenderMediaResult>;
|
|
152
152
|
export {};
|
package/dist/render-media.js
CHANGED
|
@@ -55,7 +55,7 @@ const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
|
55
55
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
56
56
|
const SLOWEST_FRAME_COUNT = 10;
|
|
57
57
|
const MAX_RECENT_FRAME_TIMINGS = 150;
|
|
58
|
-
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: compositionWithPossibleUnevenDimensions, serializedInputPropsWithCustomSchema, pixelFormat: userPixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, onLog, licenseKey, isProduction, }) => {
|
|
58
|
+
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: compositionWithPossibleUnevenDimensions, serializedInputPropsWithCustomSchema, pixelFormat: userPixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, mediaCacheSizeInBytes, onLog, licenseKey, isProduction, sampleRate, }) => {
|
|
59
59
|
var _a, _b;
|
|
60
60
|
const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : compositionWithPossibleUnevenDimensions.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
|
|
61
61
|
if (repro) {
|
|
@@ -307,6 +307,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
|
|
|
307
307
|
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
|
|
308
308
|
binariesDirectory,
|
|
309
309
|
forceIPv4: false,
|
|
310
|
+
sampleRate,
|
|
310
311
|
}, {
|
|
311
312
|
onDownload,
|
|
312
313
|
});
|
|
@@ -395,6 +396,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
|
|
|
395
396
|
imageSequencePattern: null,
|
|
396
397
|
mediaCacheSizeInBytes,
|
|
397
398
|
onLog,
|
|
399
|
+
sampleRate,
|
|
398
400
|
});
|
|
399
401
|
return renderFramesProc;
|
|
400
402
|
})
|
|
@@ -461,6 +463,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition: c
|
|
|
461
463
|
separateAudioTo,
|
|
462
464
|
metadata,
|
|
463
465
|
hardwareAcceleration,
|
|
466
|
+
sampleRate,
|
|
464
467
|
});
|
|
465
468
|
})
|
|
466
469
|
.then((buffer) => {
|
|
@@ -567,8 +570,8 @@ exports.internalRenderMedia = (0, wrap_with_error_handling_1.wrapWithErrorHandli
|
|
|
567
570
|
* @description Render a video or an audio programmatically.
|
|
568
571
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
|
|
569
572
|
*/
|
|
570
|
-
const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, isProduction, ...apiKeyOrLicenseKey }) => {
|
|
571
|
-
var _a, _b, _c;
|
|
573
|
+
const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, metadata, hardwareAcceleration, chromeMode, offthreadVideoThreads, compositionStart, mediaCacheSizeInBytes, isProduction, sampleRate, ...apiKeyOrLicenseKey }) => {
|
|
574
|
+
var _a, _b, _c, _d;
|
|
572
575
|
const indent = false;
|
|
573
576
|
const logLevel = verbose || dumpBrowserLogs ? 'verbose' : (passedLogLevel !== null && passedLogLevel !== void 0 ? passedLogLevel : 'info');
|
|
574
577
|
if (quality !== undefined) {
|
|
@@ -649,6 +652,7 @@ const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps,
|
|
|
649
652
|
licenseKey: (_c = licenseKey !== null && licenseKey !== void 0 ? licenseKey : apiKey) !== null && _c !== void 0 ? _c : null,
|
|
650
653
|
onLog: default_on_log_1.defaultOnLog,
|
|
651
654
|
isProduction: isProduction !== null && isProduction !== void 0 ? isProduction : null,
|
|
655
|
+
sampleRate: (_d = sampleRate !== null && sampleRate !== void 0 ? sampleRate : composition.defaultSampleRate) !== null && _d !== void 0 ? _d : 48000,
|
|
652
656
|
});
|
|
653
657
|
};
|
|
654
658
|
exports.renderMedia = renderMedia;
|
package/dist/render-still.js
CHANGED
|
@@ -169,10 +169,11 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
169
169
|
mediaCacheSizeInBytes,
|
|
170
170
|
initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
|
|
171
171
|
darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
|
|
172
|
+
sampleRate: 48000,
|
|
172
173
|
});
|
|
173
174
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
174
175
|
// eslint-disable-next-line max-params
|
|
175
|
-
pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile) => {
|
|
176
|
+
pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile, defaultSampleRate) => {
|
|
176
177
|
window.remotion_setBundleMode({
|
|
177
178
|
type: 'composition',
|
|
178
179
|
compositionName: id,
|
|
@@ -186,6 +187,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
186
187
|
compositionDefaultVideoImageFormat: defaultVideoImageFormat,
|
|
187
188
|
compositionDefaultPixelFormat: defaultPixelFormat,
|
|
188
189
|
compositionDefaultProResProfile: defaultProResProfile,
|
|
190
|
+
compositionDefaultSampleRate: defaultSampleRate,
|
|
189
191
|
});
|
|
190
192
|
},
|
|
191
193
|
args: [
|
|
@@ -200,6 +202,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
|
|
|
200
202
|
composition.defaultVideoImageFormat,
|
|
201
203
|
composition.defaultPixelFormat,
|
|
202
204
|
composition.defaultProResProfile,
|
|
205
|
+
composition.defaultSampleRate,
|
|
203
206
|
],
|
|
204
207
|
frame: null,
|
|
205
208
|
page,
|
|
@@ -267,6 +270,7 @@ const internalRenderStillRaw = (options) => {
|
|
|
267
270
|
offthreadVideoCacheSizeInBytes: options.offthreadVideoCacheSizeInBytes,
|
|
268
271
|
binariesDirectory: options.binariesDirectory,
|
|
269
272
|
forceIPv4: false,
|
|
273
|
+
sampleRate: 48000,
|
|
270
274
|
}, {
|
|
271
275
|
onDownload: options.onDownload,
|
|
272
276
|
})
|
|
@@ -37,6 +37,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
|
|
|
37
37
|
mediaCacheSizeInBytes,
|
|
38
38
|
initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
|
|
39
39
|
darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
|
|
40
|
+
sampleRate: 48000,
|
|
40
41
|
});
|
|
41
42
|
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
42
43
|
page,
|
|
@@ -77,7 +78,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
|
|
|
77
78
|
logLevel,
|
|
78
79
|
}, `calculateMetadata() took ${Date.now() - time}ms`);
|
|
79
80
|
const res = result;
|
|
80
|
-
const { width, durationInFrames, fps, height, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile, } = res;
|
|
81
|
+
const { width, durationInFrames, fps, height, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile, defaultSampleRate, } = res;
|
|
81
82
|
return {
|
|
82
83
|
metadata: {
|
|
83
84
|
id,
|
|
@@ -92,6 +93,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
|
|
|
92
93
|
defaultVideoImageFormat,
|
|
93
94
|
defaultPixelFormat,
|
|
94
95
|
defaultProResProfile,
|
|
96
|
+
defaultSampleRate,
|
|
95
97
|
},
|
|
96
98
|
propsSize: size,
|
|
97
99
|
};
|
|
@@ -123,6 +125,7 @@ const internalSelectCompositionRaw = async (options) => {
|
|
|
123
125
|
offthreadVideoCacheSizeInBytes,
|
|
124
126
|
binariesDirectory,
|
|
125
127
|
forceIPv4: false,
|
|
128
|
+
sampleRate: 48000,
|
|
126
129
|
}, {
|
|
127
130
|
onDownload: () => undefined,
|
|
128
131
|
}).then((result) => {
|
|
@@ -10,17 +10,20 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
|
10
10
|
const redirect_status_codes_1 = require("./redirect-status-codes");
|
|
11
11
|
const truthy_1 = require("./truthy");
|
|
12
12
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
13
|
-
const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, darkMode, }) => {
|
|
13
|
+
const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, darkMode, sampleRate, }) => {
|
|
14
14
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
15
15
|
const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
|
|
16
16
|
page.setDefaultTimeout(actualTimeout);
|
|
17
17
|
page.setDefaultNavigationTimeout(actualTimeout);
|
|
18
18
|
const urlToVisit = (0, normalize_serve_url_1.normalizeServeUrl)(serveUrl);
|
|
19
|
-
await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, initMemoryAvailable
|
|
19
|
+
await page.evaluateOnNewDocument((timeout, mainTab, cacheSizeInBytes, initMemoryAvailable, sRate
|
|
20
|
+
// eslint-disable-next-line max-params
|
|
21
|
+
) => {
|
|
20
22
|
window.remotion_puppeteerTimeout = timeout;
|
|
21
23
|
window.remotion_isMainTab = mainTab;
|
|
22
24
|
window.remotion_mediaCacheSizeInBytes = cacheSizeInBytes;
|
|
23
25
|
window.remotion_initialMemoryAvailable = initMemoryAvailable;
|
|
26
|
+
window.remotion_sampleRate = sRate;
|
|
24
27
|
// To make useRemotionEnvironment() work
|
|
25
28
|
if (window.process === undefined) {
|
|
26
29
|
// @ts-expect-error
|
|
@@ -30,7 +33,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
|
|
|
30
33
|
window.process.env = {};
|
|
31
34
|
}
|
|
32
35
|
window.process.env.NODE_ENV = 'production';
|
|
33
|
-
}, actualTimeout, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable);
|
|
36
|
+
}, actualTimeout, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, sampleRate);
|
|
34
37
|
await page.evaluateOnNewDocument('window.remotion_broadcastChannel = new BroadcastChannel("remotion-video-frame-extraction")');
|
|
35
38
|
if (envVariables) {
|
|
36
39
|
await page.evaluateOnNewDocument((input) => {
|
|
@@ -92,6 +95,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
|
|
|
92
95
|
mediaCacheSizeInBytes,
|
|
93
96
|
initialMemoryAvailable,
|
|
94
97
|
darkMode,
|
|
98
|
+
sampleRate,
|
|
95
99
|
});
|
|
96
100
|
};
|
|
97
101
|
const [pageRes, error] = await (0, goto_page_or_throw_1.gotoPageOrThrow)(page, urlToVisit, actualTimeout);
|
|
@@ -42,6 +42,7 @@ type InternalStitchFramesToVideoOptions = {
|
|
|
42
42
|
colorSpace: ColorSpace | null;
|
|
43
43
|
binariesDirectory: string | null;
|
|
44
44
|
metadata: Record<string, string> | null;
|
|
45
|
+
sampleRate: number;
|
|
45
46
|
} & ToOptions<typeof optionsMap.stitchFramesToVideo>;
|
|
46
47
|
export type StitchFramesToVideoOptions = {
|
|
47
48
|
fps: number;
|
|
@@ -71,7 +72,8 @@ export type StitchFramesToVideoOptions = {
|
|
|
71
72
|
colorSpace?: ColorSpace;
|
|
72
73
|
binariesDirectory?: string | null;
|
|
73
74
|
metadata?: Record<string, string> | null;
|
|
75
|
+
sampleRate?: number;
|
|
74
76
|
} & Partial<ToOptions<typeof optionsMap.stitchFramesToVideo>>;
|
|
75
77
|
export declare const internalStitchFramesToVideo: (options: InternalStitchFramesToVideoOptions) => Promise<Buffer | null>;
|
|
76
|
-
export declare const stitchFramesToVideo: ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, }: StitchFramesToVideoOptions) => Promise<Buffer | null>;
|
|
78
|
+
export declare const stitchFramesToVideo: ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, sampleRate, }: StitchFramesToVideoOptions) => Promise<Buffer | null>;
|
|
77
79
|
export {};
|
|
@@ -30,7 +30,7 @@ const render_has_audio_1 = require("./render-has-audio");
|
|
|
30
30
|
const validate_1 = require("./validate");
|
|
31
31
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
32
32
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
33
|
-
const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec: audioCodecSetting, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile, logLevel, videoBitrate, maxRate, bufferSize, width, numberOfGifLoops, onProgress, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, }, remotionRoot) => {
|
|
33
|
+
const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec: audioCodecSetting, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, force, fps, height, indent, muted, onDownload, outputLocation, pixelFormat, preEncodedFileLocation, preferLossless, proResProfile, logLevel, videoBitrate, maxRate, bufferSize, width, numberOfGifLoops, onProgress, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, sampleRate, }, remotionRoot) => {
|
|
34
34
|
var _a;
|
|
35
35
|
(0, validate_1.validateDimension)(height, 'height', 'passed to `stitchFramesToVideo()`');
|
|
36
36
|
(0, validate_1.validateDimension)(width, 'width', 'passed to `stitchFramesToVideo()`');
|
|
@@ -141,6 +141,7 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec:
|
|
|
141
141
|
trimLeftOffset: assetsInfo.trimLeftOffset,
|
|
142
142
|
trimRightOffset: assetsInfo.trimRightOffset,
|
|
143
143
|
forSeamlessAacConcatenation: assetsInfo.forSeamlessAacConcatenation,
|
|
144
|
+
sampleRate,
|
|
144
145
|
})
|
|
145
146
|
: null;
|
|
146
147
|
if (mediaSupport.audio && !mediaSupport.video) {
|
|
@@ -311,7 +312,7 @@ exports.internalStitchFramesToVideo = internalStitchFramesToVideo;
|
|
|
311
312
|
* @description Takes a series of images and audio information generated by renderFrames() and encodes it to a video.
|
|
312
313
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/stitch-frames-to-video)
|
|
313
314
|
*/
|
|
314
|
-
const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, }) => {
|
|
315
|
+
const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitrate, audioCodec, cancelSignal, codec, crf, enforceAudioTrack, ffmpegOverride, muted, numberOfGifLoops, onDownload, onProgress, outputLocation, pixelFormat, proResProfile, verbose, videoBitrate, maxRate, bufferSize, x264Preset, colorSpace, binariesDirectory, separateAudioTo, metadata, hardwareAcceleration, sampleRate, }) => {
|
|
315
316
|
return (0, exports.internalStitchFramesToVideo)({
|
|
316
317
|
assetsInfo,
|
|
317
318
|
audioBitrate: audioBitrate !== null && audioBitrate !== void 0 ? audioBitrate : null,
|
|
@@ -345,6 +346,7 @@ const stitchFramesToVideo = ({ assetsInfo, force, fps, height, width, audioBitra
|
|
|
345
346
|
metadata: metadata !== null && metadata !== void 0 ? metadata : null,
|
|
346
347
|
separateAudioTo: separateAudioTo !== null && separateAudioTo !== void 0 ? separateAudioTo : null,
|
|
347
348
|
hardwareAcceleration: hardwareAcceleration !== null && hardwareAcceleration !== void 0 ? hardwareAcceleration : 'disable',
|
|
349
|
+
sampleRate: sampleRate !== null && sampleRate !== void 0 ? sampleRate : 48000,
|
|
348
350
|
});
|
|
349
351
|
};
|
|
350
352
|
exports.stitchFramesToVideo = stitchFramesToVideo;
|
|
@@ -7,7 +7,7 @@ export type ProcessedTrack = {
|
|
|
7
7
|
pad_start: string | null;
|
|
8
8
|
pad_end: string | null;
|
|
9
9
|
};
|
|
10
|
-
export declare const stringifyFfmpegFilter: ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, indent, logLevel, presentationTimeOffsetInSeconds, }: {
|
|
10
|
+
export declare const stringifyFfmpegFilter: ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, indent, logLevel, presentationTimeOffsetInSeconds, sampleRate, }: {
|
|
11
11
|
channels: number;
|
|
12
12
|
volume: AssetVolume;
|
|
13
13
|
fps: number;
|
|
@@ -20,4 +20,5 @@ export declare const stringifyFfmpegFilter: ({ channels, volume, fps, assetDurat
|
|
|
20
20
|
indent: boolean;
|
|
21
21
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
22
22
|
presentationTimeOffsetInSeconds: number;
|
|
23
|
+
sampleRate: number;
|
|
23
24
|
}) => FilterWithoutPaddingApplied | null;
|
|
@@ -4,7 +4,6 @@ exports.stringifyFfmpegFilter = void 0;
|
|
|
4
4
|
const calculate_atempo_1 = require("./assets/calculate-atempo");
|
|
5
5
|
const ffmpeg_volume_expression_1 = require("./assets/ffmpeg-volume-expression");
|
|
6
6
|
const logger_1 = require("./logger");
|
|
7
|
-
const sample_rate_1 = require("./sample-rate");
|
|
8
7
|
const seamless_aac_trim_1 = require("./seamless-aac-trim");
|
|
9
8
|
const truthy_1 = require("./truthy");
|
|
10
9
|
const cleanUpFloatingPointError = (value) => {
|
|
@@ -62,7 +61,7 @@ const trimAndSetTempo = ({ assetDuration, asset, trimLeftOffset, trimRightOffset
|
|
|
62
61
|
audibleDuration: trimRightOrAssetDuration - trimLeft,
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, indent, logLevel, presentationTimeOffsetInSeconds, }) => {
|
|
64
|
+
const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, indent, logLevel, presentationTimeOffsetInSeconds, sampleRate, }) => {
|
|
66
65
|
if (channels === 0) {
|
|
67
66
|
return null;
|
|
68
67
|
}
|
|
@@ -104,7 +103,7 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
104
103
|
return {
|
|
105
104
|
filter: '[0:a]' +
|
|
106
105
|
[
|
|
107
|
-
`aformat=sample_fmts=s16:sample_rates=${
|
|
106
|
+
`aformat=sample_fmts=s16:sample_rates=${sampleRate}`,
|
|
108
107
|
// The order matters here! For speed and correctness, we first trim the audio
|
|
109
108
|
...trimAndTempoFilter,
|
|
110
109
|
// The timings for volume must include whatever is in atrim, unless the volume
|
|
@@ -113,14 +112,14 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
113
112
|
? null
|
|
114
113
|
: `volume=${volumeFilter.value}:eval=${volumeFilter.eval}`,
|
|
115
114
|
toneFrequency && toneFrequency !== 1
|
|
116
|
-
? `asetrate=${
|
|
115
|
+
? `asetrate=${sampleRate}*${toneFrequency},aresample=${sampleRate},atempo=1/${toneFrequency}`
|
|
117
116
|
: null,
|
|
118
117
|
]
|
|
119
118
|
.filter(truthy_1.truthy)
|
|
120
119
|
.join(',') +
|
|
121
120
|
`[a0]`,
|
|
122
121
|
pad_end: padAtEnd > 0.0000001
|
|
123
|
-
? 'apad=pad_len=' + Math.round(padAtEnd *
|
|
122
|
+
? 'apad=pad_len=' + Math.round(padAtEnd * sampleRate)
|
|
124
123
|
: null,
|
|
125
124
|
pad_start:
|
|
126
125
|
// For n channels, we delay n + 1 channels.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/renderer",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.448",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"execa": "5.1.1",
|
|
26
26
|
"extract-zip": "2.0.1",
|
|
27
|
-
"remotion": "4.0.
|
|
28
|
-
"@remotion/streaming": "4.0.
|
|
27
|
+
"remotion": "4.0.448",
|
|
28
|
+
"@remotion/streaming": "4.0.448",
|
|
29
29
|
"source-map": "^0.8.0-beta.0",
|
|
30
30
|
"ws": "8.17.1",
|
|
31
|
-
"@remotion/licensing": "4.0.
|
|
31
|
+
"@remotion/licensing": "4.0.448"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=16.8.0",
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"react-dom": "19.2.3",
|
|
43
43
|
"@typescript/native-preview": "7.0.0-dev.20260217.1",
|
|
44
44
|
"@types/ws": "8.5.10",
|
|
45
|
-
"@remotion/example-videos": "4.0.
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
45
|
+
"@remotion/example-videos": "4.0.448",
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.448",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@types/node": "20.12.14"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
52
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
53
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
54
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
55
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
56
|
-
"@remotion/compositor-linux-x64-musl": "4.0.
|
|
57
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
51
|
+
"@remotion/compositor-darwin-arm64": "4.0.448",
|
|
52
|
+
"@remotion/compositor-darwin-x64": "4.0.448",
|
|
53
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.448",
|
|
54
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.448",
|
|
55
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.448",
|
|
56
|
+
"@remotion/compositor-linux-x64-musl": "4.0.448",
|
|
57
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.448"
|
|
58
58
|
},
|
|
59
59
|
"keywords": [
|
|
60
60
|
"remotion",
|