@hyperframes/producer 0.10.0 → 0.10.2

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.
@@ -13798,8 +13798,8 @@ import { join as join34 } from "node:path";
13798
13798
  import {
13799
13799
  assertSwiftShader,
13800
13800
  BROWSER_GPU_NOT_SOFTWARE as BROWSER_GPU_NOT_SOFTWARE4,
13801
- calculateOptimalWorkers as calculateOptimalWorkers2,
13802
13801
  classifyCaptureFailure as classifyCaptureFailure4,
13802
+ computeWorkerSizing as computeWorkerSizing2,
13803
13803
  closeCaptureSession as closeCaptureSession11,
13804
13804
  createCaptureSession as createCaptureSession11,
13805
13805
  createFrameLookupTable as createFrameLookupTable6,
@@ -13835,6 +13835,23 @@ function resolveChunkCaptureWorkers(framesInChunk, machineSized, maxCaptureWorke
13835
13835
  const byFrames = Math.floor(framesInChunk / MIN_FRAMES_PER_CHUNK_BROWSER);
13836
13836
  return Math.max(machineSized, Math.floor(Math.min(maxCaptureWorkers, byFrames)));
13837
13837
  }
13838
+ function chunkCaptureSizingLog(input) {
13839
+ const { machineSizing } = input;
13840
+ return {
13841
+ chunkIndex: input.chunkIndex,
13842
+ frames: input.framesEncoded,
13843
+ workers: input.workers,
13844
+ machineSizedWorkers: machineSizing.workers,
13845
+ boundBy: machineSizing.boundBy,
13846
+ cpuBasedWorkers: machineSizing.cpuBasedWorkers,
13847
+ memoryBasedWorkers: machineSizing.memoryBasedWorkers,
13848
+ frameBasedWorkers: machineSizing.frameBasedWorkers,
13849
+ maxCaptureWorkers: input.maxCaptureWorkers ?? null,
13850
+ captureMode: input.captureMode,
13851
+ captureStageMs: input.captureStageMs,
13852
+ captureMsPerFrame: input.framesEncoded > 0 ? Math.round(input.captureStageMs / input.framesEncoded * 10) / 10 : null
13853
+ };
13854
+ }
13838
13855
  function resolveChunkFrameRange(slice, chunkIndex, frameRange) {
13839
13856
  if (frameRange === void 0) return { startFrame: slice.startFrame, endFrame: slice.endFrame };
13840
13857
  const { startFrame, endFrame } = frameRange;
@@ -14133,9 +14150,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
14133
14150
  });
14134
14151
  captureOptions.onStaticDedupActivity = () => noteCaptureActivity(job);
14135
14152
  const captureFrames = effectiveChunkFrames(framesInChunk, slice.captureCost);
14153
+ const machineSizing = computeWorkerSizing2(captureFrames, void 0, cfg);
14136
14154
  const chunkWorkerCount = resolveChunkCaptureWorkers(
14137
14155
  captureFrames,
14138
- calculateOptimalWorkers2(captureFrames, void 0, cfg),
14156
+ machineSizing.workers,
14139
14157
  options?.maxCaptureWorkers
14140
14158
  );
14141
14159
  let session = null;
@@ -14523,6 +14541,18 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
14523
14541
  };
14524
14542
  writeFileSync12(perfPath, `${JSON.stringify(perfPayload, null, 2)}
14525
14543
  `, "utf-8");
14544
+ log.info(
14545
+ "[renderChunk] capture sizing",
14546
+ chunkCaptureSizingLog({
14547
+ chunkIndex,
14548
+ framesEncoded,
14549
+ workers: chunkWorkerCount,
14550
+ machineSizing,
14551
+ maxCaptureWorkers: options?.maxCaptureWorkers,
14552
+ captureMode,
14553
+ captureStageMs
14554
+ })
14555
+ );
14526
14556
  try {
14527
14557
  rmSync12(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
14528
14558
  rmSync12(videoFramesDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "82bb6f5b055041dbe4a42d8eae51c8d405236b4ae160e7c43bf13c2b6ea431af",
4
+ "sha256": "f5b34d6fb215747bc41a1920bf7288787cdc00339641d9c28b18a8dfbbf02810",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"