@hyperframes/producer 0.8.150 → 0.8.151
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/distributed.js +9 -3
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +54 -54
- package/dist/index.js +14 -6
- package/dist/public-server.js +13 -5
- package/dist/services/render/captureImageFormat.d.ts +6 -1
- package/dist/services/render/segmentManifest.d.ts +1 -0
- package/package.json +7 -7
package/dist/distributed.js
CHANGED
|
@@ -3814,6 +3814,9 @@ function isActionableProbeFailure(line) {
|
|
|
3814
3814
|
function resolveCaptureImageFormat(input) {
|
|
3815
3815
|
return input.needsAlpha || input.motionBlur ? "png" : "jpeg";
|
|
3816
3816
|
}
|
|
3817
|
+
function resolveCaptureJpegQuality(quality) {
|
|
3818
|
+
return quality === "draft" ? 80 : 100;
|
|
3819
|
+
}
|
|
3817
3820
|
|
|
3818
3821
|
// src/services/render/stages/probeStage.ts
|
|
3819
3822
|
var FRAME_BOUNDARY_EPSILON = 1e-3;
|
|
@@ -3969,7 +3972,7 @@ async function runProbeStage(input) {
|
|
|
3969
3972
|
height,
|
|
3970
3973
|
fps: job.config.fps,
|
|
3971
3974
|
format: captureFormat,
|
|
3972
|
-
quality: captureFormat === "png" ? void 0 :
|
|
3975
|
+
quality: captureFormat === "png" ? void 0 : resolveCaptureJpegQuality(job.config.quality),
|
|
3973
3976
|
variables: job.config.variables,
|
|
3974
3977
|
deviceScaleFactor,
|
|
3975
3978
|
motionBlur,
|
|
@@ -4953,13 +4956,16 @@ function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
|
|
|
4953
4956
|
return workerCount > 1;
|
|
4954
4957
|
}
|
|
4955
4958
|
var JPEG_RAW_RGBA_DIVISOR = 8;
|
|
4959
|
+
var HIGH_QUALITY_JPEG_RAW_RGBA_DIVISOR = 4;
|
|
4956
4960
|
var DISK_PROJECTION_SAMPLE_FRAMES = 10;
|
|
4957
4961
|
function estimateDiskCaptureBytes(totalFrames, captureOptions) {
|
|
4958
4962
|
const scale = captureOptions.deviceScaleFactor ?? 1;
|
|
4959
4963
|
const outputWidth = Math.ceil(captureOptions.width * scale);
|
|
4960
4964
|
const outputHeight = Math.ceil(captureOptions.height * scale);
|
|
4961
4965
|
const rawBytes = Math.ceil(totalFrames) * outputWidth * outputHeight * 4;
|
|
4962
|
-
return frameFileExtension(captureOptions.format) === "jpg" ? Math.ceil(
|
|
4966
|
+
return frameFileExtension(captureOptions.format) === "jpg" ? Math.ceil(
|
|
4967
|
+
rawBytes / ((captureOptions.quality ?? 80) > 80 ? HIGH_QUALITY_JPEG_RAW_RGBA_DIVISOR : JPEG_RAW_RGBA_DIVISOR)
|
|
4968
|
+
) : rawBytes;
|
|
4963
4969
|
}
|
|
4964
4970
|
function freeDiskBytesAt(path) {
|
|
4965
4971
|
try {
|
|
@@ -9160,7 +9166,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
|
|
|
9160
9166
|
height: plan2.dimensions.height,
|
|
9161
9167
|
fps: { num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen },
|
|
9162
9168
|
format: plan2.dimensions.format === "mp4" ? "jpeg" : "png",
|
|
9163
|
-
quality: plan2.dimensions.format === "mp4" ?
|
|
9169
|
+
quality: plan2.dimensions.format === "mp4" ? resolveCaptureJpegQuality(job.config.quality) : void 0,
|
|
9164
9170
|
deviceScaleFactor: encoder.deviceScaleFactor,
|
|
9165
9171
|
// Re-inject the controller's snapshotted variables so the chunk's
|
|
9166
9172
|
// first capture sees the same `window.__hfVariables` the in-process
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.0",
|
|
3
3
|
"buildId": "dev",
|
|
4
|
-
"sha256": "
|
|
4
|
+
"sha256": "06d59f28d4f4b00706a3efda6cffaeb85060b7595694fd753a5240d18337d11f",
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"iife": "hyperframe.runtime.iife.js",
|
|
7
7
|
"esm": "hyperframe.runtime.mjs"
|