@remotion/renderer 4.0.319 → 4.0.320
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/esm/index.mjs +8 -3
- package/dist/render-media.js +10 -3
- package/ensure-browser.mjs +3 -0
- package/package.json +12 -12
package/dist/esm/index.mjs
CHANGED
|
@@ -21023,6 +21023,7 @@ var validateOutputFilename = ({
|
|
|
21023
21023
|
|
|
21024
21024
|
// src/render-media.ts
|
|
21025
21025
|
var SLOWEST_FRAME_COUNT = 10;
|
|
21026
|
+
var MAX_RECENT_FRAME_TIMINGS = 50;
|
|
21026
21027
|
var internalRenderMediaRaw = ({
|
|
21027
21028
|
proResProfile,
|
|
21028
21029
|
x264Preset,
|
|
@@ -21136,7 +21137,7 @@ var internalRenderMediaRaw = ({
|
|
|
21136
21137
|
let encodedDoneIn = null;
|
|
21137
21138
|
let cancelled = false;
|
|
21138
21139
|
let renderEstimatedTime = 0;
|
|
21139
|
-
|
|
21140
|
+
const recentFrameTimings = [];
|
|
21140
21141
|
const renderStart = Date.now();
|
|
21141
21142
|
const { estimatedUsage, freeMemory, hasEnoughMemory } = shouldUseParallelEncoding({
|
|
21142
21143
|
height: composition.height,
|
|
@@ -21312,8 +21313,12 @@ var internalRenderMediaRaw = ({
|
|
|
21312
21313
|
composition,
|
|
21313
21314
|
onFrameUpdate: (frame, frameIndex, timeToRenderInMilliseconds) => {
|
|
21314
21315
|
renderedFrames = frame;
|
|
21315
|
-
|
|
21316
|
-
|
|
21316
|
+
recentFrameTimings.push(timeToRenderInMilliseconds);
|
|
21317
|
+
if (recentFrameTimings.length > MAX_RECENT_FRAME_TIMINGS) {
|
|
21318
|
+
recentFrameTimings.shift();
|
|
21319
|
+
}
|
|
21320
|
+
const recentTimingsSum = recentFrameTimings.reduce((sum, time) => sum + time, 0);
|
|
21321
|
+
const newAverage = recentTimingsSum / recentFrameTimings.length;
|
|
21317
21322
|
const remainingFrames = totalFramesToRender - renderedFrames;
|
|
21318
21323
|
renderEstimatedTime = Math.round(remainingFrames * newAverage);
|
|
21319
21324
|
callUpdate();
|
package/dist/render-media.js
CHANGED
|
@@ -51,6 +51,7 @@ const validate_scale_1 = require("./validate-scale");
|
|
|
51
51
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
52
52
|
const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
|
|
53
53
|
const SLOWEST_FRAME_COUNT = 10;
|
|
54
|
+
const MAX_RECENT_FRAME_TIMINGS = 50;
|
|
54
55
|
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, 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, }) => {
|
|
55
56
|
var _a, _b;
|
|
56
57
|
const pixelFormat = (_a = userPixelFormat !== null && userPixelFormat !== void 0 ? userPixelFormat : composition.defaultPixelFormat) !== null && _a !== void 0 ? _a : pixel_format_1.DEFAULT_PIXEL_FORMAT;
|
|
@@ -111,7 +112,7 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
|
|
|
111
112
|
let encodedDoneIn = null;
|
|
112
113
|
let cancelled = false;
|
|
113
114
|
let renderEstimatedTime = 0;
|
|
114
|
-
|
|
115
|
+
const recentFrameTimings = [];
|
|
115
116
|
const renderStart = Date.now();
|
|
116
117
|
const { estimatedUsage, freeMemory, hasEnoughMemory } = (0, prestitcher_memory_usage_1.shouldUseParallelEncoding)({
|
|
117
118
|
height: composition.height,
|
|
@@ -303,8 +304,14 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
|
|
|
303
304
|
composition,
|
|
304
305
|
onFrameUpdate: (frame, frameIndex, timeToRenderInMilliseconds) => {
|
|
305
306
|
renderedFrames = frame;
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
// Track recent frame timings (at most 50)
|
|
308
|
+
recentFrameTimings.push(timeToRenderInMilliseconds);
|
|
309
|
+
if (recentFrameTimings.length > MAX_RECENT_FRAME_TIMINGS) {
|
|
310
|
+
recentFrameTimings.shift();
|
|
311
|
+
}
|
|
312
|
+
// Calculate average using only recent timings for better estimation
|
|
313
|
+
const recentTimingsSum = recentFrameTimings.reduce((sum, time) => sum + time, 0);
|
|
314
|
+
const newAverage = recentTimingsSum / recentFrameTimings.length;
|
|
308
315
|
const remainingFrames = totalFramesToRender - renderedFrames;
|
|
309
316
|
// Get estimated time by multiplying the avarage render time by the remaining frames
|
|
310
317
|
renderEstimatedTime = Math.round(remainingFrames * newAverage);
|
package/ensure-browser.mjs
CHANGED
|
@@ -3094,6 +3094,9 @@ function getChromeDownloadUrl({
|
|
|
3094
3094
|
chromeMode
|
|
3095
3095
|
}) {
|
|
3096
3096
|
if (platform2 === "linux-arm64") {
|
|
3097
|
+
if (chromeMode === "chrome-for-testing") {
|
|
3098
|
+
return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
|
|
3099
|
+
}
|
|
3097
3100
|
return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-headless-shell-linux-arm64.zip`;
|
|
3098
3101
|
}
|
|
3099
3102
|
if (chromeMode === "headless-shell") {
|
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.320",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.17.1",
|
|
21
|
-
"remotion": "4.0.
|
|
22
|
-
"@remotion/streaming": "4.0.
|
|
21
|
+
"remotion": "4.0.320",
|
|
22
|
+
"@remotion/streaming": "4.0.320"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"react-dom": "19.0.0",
|
|
34
34
|
"@types/ws": "8.5.10",
|
|
35
35
|
"eslint": "9.19.0",
|
|
36
|
-
"@remotion/
|
|
37
|
-
"@remotion/
|
|
36
|
+
"@remotion/example-videos": "4.0.320",
|
|
37
|
+
"@remotion/eslint-config-internal": "4.0.320"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
41
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
42
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
43
|
-
"@remotion/compositor-linux-
|
|
44
|
-
"@remotion/compositor-
|
|
45
|
-
"@remotion/compositor-linux-x64-
|
|
46
|
-
"@remotion/compositor-
|
|
40
|
+
"@remotion/compositor-darwin-arm64": "4.0.320",
|
|
41
|
+
"@remotion/compositor-darwin-x64": "4.0.320",
|
|
42
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.320",
|
|
43
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.320",
|
|
44
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.320",
|
|
45
|
+
"@remotion/compositor-linux-x64-musl": "4.0.320",
|
|
46
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.320"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"remotion",
|