@hyperframes/producer 0.3.1 → 0.4.0

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/index.js CHANGED
@@ -99970,7 +99970,7 @@ ${right2.raw}`)
99970
99970
  return findings;
99971
99971
  },
99972
99972
  // gsap_css_transform_conflict
99973
- ({ styles, scripts }) => {
99973
+ ({ styles, scripts, tags }) => {
99974
99974
  const findings = [];
99975
99975
  const cssTranslateSelectors = /* @__PURE__ */ new Map();
99976
99976
  const cssScaleSelectors = /* @__PURE__ */ new Map();
@@ -99987,6 +99987,25 @@ ${right2.raw}`)
99987
99987
  cssScaleSelectors.set((selector ?? "").trim(), transformVal);
99988
99988
  }
99989
99989
  }
99990
+ for (const tag of tags) {
99991
+ const inlineStyle = readAttr(tag.raw, "style");
99992
+ if (!inlineStyle) continue;
99993
+ const tMatch = inlineStyle.match(/transform\s*:\s*([^;]+)/);
99994
+ if (!tMatch || !tMatch[1]) continue;
99995
+ const transformVal = tMatch[1].trim();
99996
+ const id = readAttr(tag.raw, "id");
99997
+ const classes = readAttr(tag.raw, "class")?.split(/\s+/).filter(Boolean) ?? [];
99998
+ const selectors = [];
99999
+ if (id) selectors.push(`#${id}`);
100000
+ for (const cls of classes) selectors.push(`.${cls}`);
100001
+ if (selectors.length === 0) continue;
100002
+ for (const sel of selectors) {
100003
+ if (/translate/i.test(transformVal) && !cssTranslateSelectors.has(sel))
100004
+ cssTranslateSelectors.set(sel, transformVal);
100005
+ if (/scale/i.test(transformVal) && !cssScaleSelectors.has(sel))
100006
+ cssScaleSelectors.set(sel, transformVal);
100007
+ }
100008
+ }
99990
100009
  if (cssTranslateSelectors.size === 0 && cssScaleSelectors.size === 0) return findings;
99991
100010
  for (const script of scripts) {
99992
100011
  if (!/gsap\.timeline/.test(script.content)) continue;
@@ -101341,8 +101360,8 @@ async function runFfmpeg(args, opts) {
101341
101360
  // ../engine/src/services/chunkEncoder.ts
101342
101361
  var ENCODER_PRESETS = {
101343
101362
  draft: { preset: "ultrafast", quality: 28, codec: "h264" },
101344
- standard: { preset: "medium", quality: 23, codec: "h264" },
101345
- high: { preset: "slow", quality: 18, codec: "h264" }
101363
+ standard: { preset: "medium", quality: 18, codec: "h264" },
101364
+ high: { preset: "slow", quality: 15, codec: "h264" }
101346
101365
  };
101347
101366
  function getEncoderPreset(quality, format3 = "mp4") {
101348
101367
  const base = ENCODER_PRESETS[quality];
@@ -107670,20 +107689,26 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
107670
107689
  const videoExt = FORMAT_EXT[outputFormat] ?? ".mp4";
107671
107690
  const videoOnlyPath = join14(workDir, `video-only${videoExt}`);
107672
107691
  const preset = getEncoderPreset(job.config.quality, outputFormat);
107692
+ const effectiveQuality = job.config.crf ?? preset.quality;
107693
+ const effectiveBitrate = job.config.videoBitrate;
107694
+ const baseEncoderOpts = {
107695
+ fps: job.config.fps,
107696
+ width,
107697
+ height,
107698
+ codec: preset.codec,
107699
+ preset: preset.preset,
107700
+ quality: effectiveQuality,
107701
+ bitrate: effectiveBitrate,
107702
+ pixelFormat: preset.pixelFormat,
107703
+ useGpu: job.config.useGpu
107704
+ };
107673
107705
  job.framesRendered = 0;
107674
107706
  let streamingEncoder = null;
107675
107707
  if (enableStreamingEncode) {
107676
107708
  streamingEncoder = await spawnStreamingEncoder(
107677
107709
  videoOnlyPath,
107678
107710
  {
107679
- fps: job.config.fps,
107680
- width,
107681
- height,
107682
- codec: preset.codec,
107683
- preset: preset.preset,
107684
- quality: preset.quality,
107685
- pixelFormat: preset.pixelFormat,
107686
- useGpu: job.config.useGpu,
107711
+ ...baseEncoderOpts,
107687
107712
  imageFormat: captureOptions.format || "jpeg"
107688
107713
  },
107689
107714
  abortSignal
@@ -107855,16 +107880,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
107855
107880
  updateJobStatus(job, "encoding", "Encoding video", 75, onProgress);
107856
107881
  const frameExt = needsAlpha ? "png" : "jpg";
107857
107882
  const framePattern = `frame_%06d.${frameExt}`;
107858
- const encoderOpts = {
107859
- fps: job.config.fps,
107860
- width,
107861
- height,
107862
- codec: preset.codec,
107863
- preset: preset.preset,
107864
- quality: preset.quality,
107865
- pixelFormat: preset.pixelFormat,
107866
- useGpu: job.config.useGpu
107867
- };
107883
+ const encoderOpts = baseEncoderOpts;
107868
107884
  const encodeResult = enableChunkedEncode ? await encodeFramesChunkedConcat(
107869
107885
  framesDir,
107870
107886
  framePattern,