@hyperframes/producer 0.8.209 → 0.8.210

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.
@@ -827,9 +827,26 @@ function outputNeedsAlpha(format) {
827
827
  import { keyframeIntervalToGopSize } from "@hyperframes/engine";
828
828
 
829
829
  // src/services/render/deliveryEncoder.ts
830
- import { appendRateCapArgs, keyframeIntervalToGopSize as keyframeIntervalToGopSize2 } from "@hyperframes/engine";
830
+ import {
831
+ PRORES_PROFILE_NAMES,
832
+ appendRateCapArgs,
833
+ isProresProfile,
834
+ keyframeIntervalToGopSize as keyframeIntervalToGopSize2
835
+ } from "@hyperframes/engine";
836
+ function validateProresProfile(format, proresProfile) {
837
+ if (proresProfile === void 0) return;
838
+ if (!isProresProfile(proresProfile)) {
839
+ throw new Error(
840
+ `proresProfile must be one of ${PRORES_PROFILE_NAMES.join(", ")}; got ${JSON.stringify(proresProfile)}`
841
+ );
842
+ }
843
+ if (format !== void 0 && format !== "mov") {
844
+ throw new Error(`proresProfile applies to mov renders, not ${format}`);
845
+ }
846
+ }
831
847
  function validateDeliveryEncoderConfig(config) {
832
- const { keyframeIntervalSeconds, maxBitrate, bufferSize, format } = config;
848
+ const { keyframeIntervalSeconds, maxBitrate, bufferSize, format, proresProfile } = config;
849
+ validateProresProfile(format, proresProfile);
833
850
  if (keyframeIntervalSeconds === void 0 && maxBitrate === void 0 && bufferSize === void 0)
834
851
  return;
835
852
  if (keyframeIntervalSeconds !== void 0) {
@@ -1396,6 +1413,12 @@ import {
1396
1413
  isHdrColorSpace,
1397
1414
  sanitizeHdrAutoPromotionAsset
1398
1415
  } from "@hyperframes/engine";
1416
+ function formatCarriesHdr(format) {
1417
+ return format === "mp4";
1418
+ }
1419
+ function rendersSdrOnly(config) {
1420
+ return config.hdrMode === "force-sdr" || !formatCarriesHdr(config.format ?? "mp4");
1421
+ }
1399
1422
 
1400
1423
  // src/services/render/captureBeyondViewport.ts
1401
1424
  function resolveVideoCaptureBeyondViewport(videoCount) {
@@ -5667,7 +5690,7 @@ async function runExtractVideosStage(input) {
5667
5690
  fps: job.config.fps,
5668
5691
  outputDir: join9(compiledDir, "__hyperframes_video_frames"),
5669
5692
  format: job.config.videoFrameFormat ?? "auto",
5670
- toneMapHdrToSdr: job.config.hdrMode === "force-sdr",
5693
+ toneMapHdrToSdr: rendersSdrOnly(job.config),
5671
5694
  timelineEnd: composition.duration,
5672
5695
  maxTransientRetries: extractionPolicy.maxTransientRetries,
5673
5696
  collectProbeFailures: extractionPolicy.failureMode === "enforce",
@@ -9499,6 +9522,8 @@ function buildLockedRenderConfig(input) {
9499
9522
  closedGop: true,
9500
9523
  forceKeyframes: "n=0",
9501
9524
  pixelFormat,
9525
+ // Omitted for the default so existing 4444 plans keep their planHash.
9526
+ ...config.proresProfile && config.proresProfile !== "4444" ? { proresProfile: config.proresProfile } : {},
9502
9527
  chunkSize: input.effectiveChunkSize,
9503
9528
  chunkCount: input.chunkCount,
9504
9529
  runtimeEnv: input.runtimeEnv,
@@ -9520,7 +9545,11 @@ function resolveEncoderTriple(config) {
9520
9545
  `[plan] DistributedRenderConfig.codec is only valid for format="mp4"; received codec=${JSON.stringify(config.codec)} with format=${JSON.stringify(config.format)}. Omit codec for non-mp4 formats: mov is always ProRes 4444, webm is always libvpx-vp9, and png-sequence has no encoder.`
9521
9546
  );
9522
9547
  }
9523
- return resolveNonMp4EncoderTriple(config.format, config.quality ?? "standard");
9548
+ return resolveNonMp4EncoderTriple(
9549
+ config.format,
9550
+ config.quality ?? "standard",
9551
+ config.proresProfile
9552
+ );
9524
9553
  }
9525
9554
  function resolveMp4EncoderTriple(codec) {
9526
9555
  const c = codec ?? "h264";
@@ -9534,9 +9563,10 @@ function resolveMp4EncoderTriple(codec) {
9534
9563
  }
9535
9564
  return { encoder: "libx264-software", pixelFormat: "yuv420p", preset: "medium" };
9536
9565
  }
9537
- function resolveNonMp4EncoderTriple(format, quality) {
9566
+ function resolveNonMp4EncoderTriple(format, quality, proresProfile) {
9538
9567
  if (format === "mov") {
9539
- return { encoder: "prores-software", pixelFormat: "yuva444p10le", preset: "4444" };
9568
+ const { pixelFormat, preset } = getEncoderPreset4(quality, "mov", void 0, proresProfile);
9569
+ return { encoder: "prores-software", pixelFormat, preset };
9540
9570
  }
9541
9571
  if (format === "webm") {
9542
9572
  const enginePreset = getEncoderPreset4(quality, "webm");
@@ -11784,7 +11814,12 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
11784
11814
  const isPngSequence = plan2.dimensions.format === "png-sequence";
11785
11815
  outputKind = isPngSequence ? "frame-dir" : "file";
11786
11816
  const presetFormat = isPngSequence ? "mp4" : plan2.dimensions.format;
11787
- const basePreset = getEncoderPreset6(job.config.quality, presetFormat, void 0);
11817
+ const basePreset = getEncoderPreset6(
11818
+ job.config.quality,
11819
+ presetFormat,
11820
+ void 0,
11821
+ encoder.proresProfile
11822
+ );
11788
11823
  const preset = resolvePresetForLockedEncoder(basePreset, encoder.encoder);
11789
11824
  const effectiveQuality = encoder.crf ?? preset.quality;
11790
11825
  const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
@@ -12169,6 +12204,18 @@ function validateDistributedRenderConfig(config) {
12169
12204
  error instanceof Error ? error.message : String(error)
12170
12205
  );
12171
12206
  }
12207
+ try {
12208
+ validateDeliveryEncoderConfig({
12209
+ format: config.format,
12210
+ fps: { num: config.fps, den: 1 },
12211
+ proresProfile: config.proresProfile
12212
+ });
12213
+ } catch (error) {
12214
+ throw new InvalidConfigError(
12215
+ "config.proresProfile",
12216
+ error instanceof Error ? error.message : String(error)
12217
+ );
12218
+ }
12172
12219
  if (config.chunkSize !== void 0) {
12173
12220
  if (!Number.isInteger(config.chunkSize) || config.chunkSize < 1) {
12174
12221
  throw new InvalidConfigError(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "d294fc169f5c0e16d5272a816ae4f0fd6e78a652c61fd6939c882c9bee81efeb",
4
+ "sha256": "7ab9e58fd46ca6b2743d6347ac25614c879b13b5dc8f6da20c0261d275d7b685",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"