@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.
@@ -102759,7 +102759,7 @@ ${right2.raw}`)
102759
102759
  return findings;
102760
102760
  },
102761
102761
  // gsap_css_transform_conflict
102762
- ({ styles, scripts }) => {
102762
+ ({ styles, scripts, tags }) => {
102763
102763
  const findings = [];
102764
102764
  const cssTranslateSelectors = /* @__PURE__ */ new Map();
102765
102765
  const cssScaleSelectors = /* @__PURE__ */ new Map();
@@ -102776,6 +102776,25 @@ ${right2.raw}`)
102776
102776
  cssScaleSelectors.set((selector ?? "").trim(), transformVal);
102777
102777
  }
102778
102778
  }
102779
+ for (const tag of tags) {
102780
+ const inlineStyle = readAttr(tag.raw, "style");
102781
+ if (!inlineStyle) continue;
102782
+ const tMatch = inlineStyle.match(/transform\s*:\s*([^;]+)/);
102783
+ if (!tMatch || !tMatch[1]) continue;
102784
+ const transformVal = tMatch[1].trim();
102785
+ const id = readAttr(tag.raw, "id");
102786
+ const classes = readAttr(tag.raw, "class")?.split(/\s+/).filter(Boolean) ?? [];
102787
+ const selectors = [];
102788
+ if (id) selectors.push(`#${id}`);
102789
+ for (const cls of classes) selectors.push(`.${cls}`);
102790
+ if (selectors.length === 0) continue;
102791
+ for (const sel of selectors) {
102792
+ if (/translate/i.test(transformVal) && !cssTranslateSelectors.has(sel))
102793
+ cssTranslateSelectors.set(sel, transformVal);
102794
+ if (/scale/i.test(transformVal) && !cssScaleSelectors.has(sel))
102795
+ cssScaleSelectors.set(sel, transformVal);
102796
+ }
102797
+ }
102779
102798
  if (cssTranslateSelectors.size === 0 && cssScaleSelectors.size === 0) return findings;
102780
102799
  for (const script of scripts) {
102781
102800
  if (!/gsap\.timeline/.test(script.content)) continue;
@@ -104130,8 +104149,8 @@ async function runFfmpeg(args, opts) {
104130
104149
  // ../engine/src/services/chunkEncoder.ts
104131
104150
  var ENCODER_PRESETS = {
104132
104151
  draft: { preset: "ultrafast", quality: 28, codec: "h264" },
104133
- standard: { preset: "medium", quality: 23, codec: "h264" },
104134
- high: { preset: "slow", quality: 18, codec: "h264" }
104152
+ standard: { preset: "medium", quality: 18, codec: "h264" },
104153
+ high: { preset: "slow", quality: 15, codec: "h264" }
104135
104154
  };
104136
104155
  function getEncoderPreset(quality, format3 = "mp4") {
104137
104156
  const base = ENCODER_PRESETS[quality];
@@ -107835,20 +107854,26 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
107835
107854
  const videoExt = FORMAT_EXT[outputFormat] ?? ".mp4";
107836
107855
  const videoOnlyPath = join14(workDir, `video-only${videoExt}`);
107837
107856
  const preset = getEncoderPreset(job.config.quality, outputFormat);
107857
+ const effectiveQuality = job.config.crf ?? preset.quality;
107858
+ const effectiveBitrate = job.config.videoBitrate;
107859
+ const baseEncoderOpts = {
107860
+ fps: job.config.fps,
107861
+ width,
107862
+ height,
107863
+ codec: preset.codec,
107864
+ preset: preset.preset,
107865
+ quality: effectiveQuality,
107866
+ bitrate: effectiveBitrate,
107867
+ pixelFormat: preset.pixelFormat,
107868
+ useGpu: job.config.useGpu
107869
+ };
107838
107870
  job.framesRendered = 0;
107839
107871
  let streamingEncoder = null;
107840
107872
  if (enableStreamingEncode) {
107841
107873
  streamingEncoder = await spawnStreamingEncoder(
107842
107874
  videoOnlyPath,
107843
107875
  {
107844
- fps: job.config.fps,
107845
- width,
107846
- height,
107847
- codec: preset.codec,
107848
- preset: preset.preset,
107849
- quality: preset.quality,
107850
- pixelFormat: preset.pixelFormat,
107851
- useGpu: job.config.useGpu,
107876
+ ...baseEncoderOpts,
107852
107877
  imageFormat: captureOptions.format || "jpeg"
107853
107878
  },
107854
107879
  abortSignal
@@ -108020,16 +108045,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
108020
108045
  updateJobStatus(job, "encoding", "Encoding video", 75, onProgress);
108021
108046
  const frameExt = needsAlpha ? "png" : "jpg";
108022
108047
  const framePattern = `frame_%06d.${frameExt}`;
108023
- const encoderOpts = {
108024
- fps: job.config.fps,
108025
- width,
108026
- height,
108027
- codec: preset.codec,
108028
- preset: preset.preset,
108029
- quality: preset.quality,
108030
- pixelFormat: preset.pixelFormat,
108031
- useGpu: job.config.useGpu
108032
- };
108048
+ const encoderOpts = baseEncoderOpts;
108033
108049
  const encodeResult = enableChunkedEncode ? await encodeFramesChunkedConcat(
108034
108050
  framesDir,
108035
108051
  framePattern,