hyperframes 0.8.21 → 0.8.22

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/cli.js CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.8.21" : "0.0.0-dev";
53
+ VERSION = true ? "0.8.22" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -70946,6 +70946,11 @@ var init_evenDimensions = __esm({
70946
70946
 
70947
70947
  // ../engine/src/utils/runFfmpeg.ts
70948
70948
  import { spawn as spawn2 } from "child_process";
70949
+ function isExternalFfmpegInterruption(result) {
70950
+ if (result.terminationReason !== "exit" || result.exitCode === 0) return false;
70951
+ if (result.signal === "SIGTERM") return true;
70952
+ return result.exitCode === 255 && FFMPEG_SIGTERM_EXIT_LINE.test(result.stderr);
70953
+ }
70949
70954
  function formatWindowsFfmpegExit(exitCode) {
70950
70955
  if (process.platform !== "win32" || exitCode === null) return void 0;
70951
70956
  if (exitCode === 3221225781 || exitCode === -1073741515) {
@@ -70985,22 +70990,28 @@ async function runFfmpeg(args, opts) {
70985
70990
  onStderr: opts?.onStderr
70986
70991
  });
70987
70992
  const outcome = await managed.wait();
70988
- return {
70993
+ const result = {
70989
70994
  success: outcome.reason === "exit" && outcome.exitCode === 0,
70990
70995
  exitCode: outcome.exitCode,
70996
+ signal: outcome.signal,
70991
70997
  stderr: outcome.stderr,
70992
70998
  durationMs: outcome.durationMs,
70993
70999
  terminationReason: outcome.reason,
70994
71000
  error: outcome.error
70995
71001
  };
71002
+ if (isExternalFfmpegInterruption(result)) {
71003
+ result.failureReason = "external_interruption";
71004
+ }
71005
+ return result;
70996
71006
  }
70997
- var DEFAULT_TIMEOUT, DEFAULT_STDERR_TAIL_LINES;
71007
+ var FFMPEG_SIGTERM_EXIT_LINE, DEFAULT_TIMEOUT, DEFAULT_STDERR_TAIL_LINES;
70998
71008
  var init_runFfmpeg = __esm({
70999
71009
  "../engine/src/utils/runFfmpeg.ts"() {
71000
71010
  "use strict";
71001
71011
  init_ffmpegBinaries();
71002
71012
  init_processTracker();
71003
71013
  init_managedChildProcess();
71014
+ FFMPEG_SIGTERM_EXIT_LINE = /^Exiting normally, received signal 15\.?\r?$/m;
71004
71015
  DEFAULT_TIMEOUT = 3e5;
71005
71016
  DEFAULT_STDERR_TAIL_LINES = 15;
71006
71017
  }
@@ -71949,7 +71960,8 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
71949
71960
  formatFfmpegError(result.exitCode, result.stderr),
71950
71961
  result.terminationReason === "deadline",
71951
71962
  encodeTimeout
71952
- )
71963
+ ),
71964
+ failureReason: isExternalFfmpegInterruption(result) ? "external_interruption" : void 0
71953
71965
  };
71954
71966
  }
71955
71967
  const fileSize = existsSync7(outputPath) ? statSync2(outputPath).size : 0;
@@ -72025,7 +72037,8 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
72025
72037
  durationMs: Date.now() - start,
72026
72038
  framesEncoded: 0,
72027
72039
  fileSize: 0,
72028
- error: chunkResult.error
72040
+ error: chunkResult.error,
72041
+ failureReason: isExternalFfmpegInterruption(processResult) ? "external_interruption" : void 0
72029
72042
  };
72030
72043
  }
72031
72044
  chunkPaths.push(chunkPath);
@@ -72053,7 +72066,8 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
72053
72066
  durationMs: Date.now() - start,
72054
72067
  framesEncoded: 0,
72055
72068
  fileSize: 0,
72056
- error: concatResult.error
72069
+ error: concatResult.error,
72070
+ failureReason: isExternalFfmpegInterruption(concatProcessResult) ? "external_interruption" : void 0
72057
72071
  };
72058
72072
  }
72059
72073
  const fileSize = existsSync7(outputPath) ? statSync2(outputPath).size : 0;
@@ -72106,7 +72120,8 @@ async function muxVideoWithAudio(videoPath, audioPath, outputPath, signal, confi
72106
72120
  success: result.success,
72107
72121
  outputPath,
72108
72122
  durationMs: result.durationMs,
72109
- error: !result.success ? formatFfmpegError(result.exitCode, result.stderr) : void 0
72123
+ error: !result.success ? formatFfmpegError(result.exitCode, result.stderr) : void 0,
72124
+ failureReason: result.failureReason
72110
72125
  };
72111
72126
  }
72112
72127
  async function applyFaststart(inputPath, outputPath, signal, config, fps) {
@@ -72134,7 +72149,8 @@ async function applyFaststart(inputPath, outputPath, signal, config, fps) {
72134
72149
  success: result.success,
72135
72150
  outputPath,
72136
72151
  durationMs: result.durationMs,
72137
- error: !result.success ? formatFfmpegError(result.exitCode, result.stderr) : void 0
72152
+ error: !result.success ? formatFfmpegError(result.exitCode, result.stderr) : void 0,
72153
+ failureReason: result.failureReason
72138
72154
  };
72139
72155
  }
72140
72156
  var ENCODER_PRESETS, KNOWN_NON_AAC_AUDIO_EXTENSIONS;
@@ -72424,6 +72440,7 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
72424
72440
  let exitStatus = "running";
72425
72441
  let stderr = "";
72426
72442
  let exitCode = null;
72443
+ let exitSignal = null;
72427
72444
  let terminationReason = "exit";
72428
72445
  ffmpeg.stdin?.on("error", () => {
72429
72446
  });
@@ -72436,6 +72453,7 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
72436
72453
  });
72437
72454
  const exitPromise = managed.wait().then((outcome) => {
72438
72455
  exitCode = outcome.exitCode;
72456
+ exitSignal = outcome.signal;
72439
72457
  stderr = outcome.stderr;
72440
72458
  terminationReason = outcome.reason;
72441
72459
  exitStatus = outcome.reason === "exit" && outcome.exitCode === 0 ? "success" : "error";
@@ -72467,7 +72485,11 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
72467
72485
  const encoder = {
72468
72486
  writeFrame: async (buffer) => {
72469
72487
  const stdin = ffmpeg.stdin;
72470
- if (exitStatus !== "running" || !stdin || stdin.destroyed) {
72488
+ if (exitStatus !== "running") {
72489
+ return false;
72490
+ }
72491
+ if (!stdin || stdin.destroyed) {
72492
+ await exitPromise;
72471
72493
  return false;
72472
72494
  }
72473
72495
  const copy = Buffer.from(buffer);
@@ -72507,7 +72529,13 @@ FFmpeg stopped after ${streamingTimeout} ms without consuming a frame.` : "";
72507
72529
  success: false,
72508
72530
  durationMs,
72509
72531
  fileSize: 0,
72510
- error: `${formatFfmpegError(exitCode, stderr)}${inactivitySuffix}`
72532
+ error: `${formatFfmpegError(exitCode, stderr)}${inactivitySuffix}`,
72533
+ failureReason: isExternalFfmpegInterruption({
72534
+ exitCode,
72535
+ signal: exitSignal,
72536
+ stderr,
72537
+ terminationReason
72538
+ }) ? "external_interruption" : void 0
72511
72539
  };
72512
72540
  }
72513
72541
  const fileSize = existsSync8(outputPath) ? statSync3(outputPath).size : 0;
@@ -72517,6 +72545,15 @@ FFmpeg stopped after ${streamingTimeout} ms without consuming a frame.` : "";
72517
72545
  getExitError: () => {
72518
72546
  if (exitStatus !== "error") return void 0;
72519
72547
  return formatFfmpegError(exitCode, stderr);
72548
+ },
72549
+ getExitFailureReason: () => {
72550
+ if (exitStatus !== "error") return void 0;
72551
+ return isExternalFfmpegInterruption({
72552
+ exitCode,
72553
+ signal: exitSignal,
72554
+ stderr,
72555
+ terminationReason
72556
+ }) ? "external_interruption" : void 0;
72520
72557
  }
72521
72558
  };
72522
72559
  return encoder;
@@ -81981,7 +82018,7 @@ function shouldBlockRender(strictErrors, strictAll, totalErrors, totalWarnings)
81981
82018
  }
81982
82019
  function execFileAsync(file, args) {
81983
82020
  return new Promise((resolvePromise, reject2) => {
81984
- execFile2(file, args, { timeout: PROBE_TIMEOUT_MS }, (error, stdout2) => {
82021
+ execFile2(file, args, { timeout: PROBE_TIMEOUT_MS, windowsHide: true }, (error, stdout2) => {
81985
82022
  if (error) reject2(error);
81986
82023
  else resolvePromise(stdout2.toString());
81987
82024
  });
@@ -87504,6 +87541,14 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
87504
87541
  if (format === "png") args.push("-compression_level", "1");
87505
87542
  args.push("-y", outputPattern);
87506
87543
  const processResult = await runFfmpeg(args, { signal, timeout: ffmpegProcessTimeout });
87544
+ if (processResult.failureReason === "external_interruption") {
87545
+ throw new VideoSourceExtractionError(
87546
+ "external_interruption",
87547
+ true,
87548
+ "Video frame extraction interrupted by host lifecycle",
87549
+ `FFmpeg exited with code ${processResult.exitCode}: ${processResult.stderr.slice(-500)}`
87550
+ );
87551
+ }
87507
87552
  if (processResult.terminationReason === "abort") {
87508
87553
  throw new VideoSourceExtractionError("cancelled", false, "Video extraction cancelled");
87509
87554
  }
@@ -89716,7 +89761,10 @@ function ffmpegFailure(stage, result, elementId) {
89716
89761
  let reason = "ffmpeg_failed";
89717
89762
  let owner = "system";
89718
89763
  let retryable = false;
89719
- if (result.terminationReason === "abort") {
89764
+ if (result.failureReason === "external_interruption") {
89765
+ reason = "external_interruption";
89766
+ retryable = true;
89767
+ } else if (result.terminationReason === "abort") {
89720
89768
  reason = "cancelled";
89721
89769
  owner = "user";
89722
89770
  } else if (result.terminationReason === "deadline" || result.terminationReason === "inactivity") {
@@ -90041,7 +90089,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
90041
90089
  let result = await runMix(false);
90042
90090
  let degradedAutomation = false;
90043
90091
  const hasAutomation = tracks.some((track) => (track.volumeKeyframes?.length ?? 0) > 0);
90044
- if (!result.success && !signal?.aborted && hasAutomation) {
90092
+ if (!result.success && result.failureReason !== "external_interruption" && !signal?.aborted && hasAutomation) {
90045
90093
  const retry = await runMix(true);
90046
90094
  if (retry.success) {
90047
90095
  result = retry;
@@ -92991,6 +93039,7 @@ __export(src_exports, {
92991
93039
  initializeSession: () => initializeSession,
92992
93040
  injectVideoFramesBatch: () => injectVideoFramesBatch,
92993
93041
  isDrawElementVerificationError: () => isDrawElementVerificationError,
93042
+ isExternalFfmpegInterruption: () => isExternalFfmpegInterruption,
92994
93043
  isFatalCaptureFailure: () => isFatalCaptureFailure,
92995
93044
  isHdrColorSpace: () => isHdrColorSpace,
92996
93045
  isHttpUrl: () => isHttpUrl,
@@ -97382,7 +97431,8 @@ function detectH264EncoderMode(ffmpegPath, gpuRequested) {
97382
97431
  const encoders = execFileSync3(ffmpegPath, ["-hide_banner", "-encoders"], {
97383
97432
  encoding: "utf-8",
97384
97433
  stdio: ["ignore", "pipe", "pipe"],
97385
- timeout: 5e3
97434
+ timeout: 5e3,
97435
+ windowsHide: true
97386
97436
  });
97387
97437
  return resolveH264EncoderMode(encoders, gpuRequested);
97388
97438
  }
@@ -100651,7 +100701,8 @@ function killProcessTree(pid, signal = "SIGTERM") {
100651
100701
  try {
100652
100702
  execFileSync7("taskkill", windowsProcessTreeKillArgs(pid), {
100653
100703
  stdio: "ignore",
100654
- timeout: 5e3
100704
+ timeout: 5e3,
100705
+ windowsHide: true
100655
100706
  });
100656
100707
  } catch {
100657
100708
  }
@@ -100689,9 +100740,14 @@ function processIdentity(pid) {
100689
100740
  "-NoProfile",
100690
100741
  "-NonInteractive",
100691
100742
  "-Command",
100692
- `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').CreationDate.ToFileTimeUtc()`
100743
+ `$p = Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}' -ErrorAction SilentlyContinue; if ($p) { $p.CreationDate.ToFileTimeUtc() }`
100693
100744
  ],
100694
- { encoding: "utf8", timeout: 2e3 }
100745
+ {
100746
+ encoding: "utf8",
100747
+ timeout: 2e3,
100748
+ stdio: ["pipe", "pipe", "ignore"],
100749
+ windowsHide: true
100750
+ }
100695
100751
  ).trim();
100696
100752
  return created ? `windows:${created}` : null;
100697
100753
  }
@@ -100718,9 +100774,14 @@ function processParentPid(pid) {
100718
100774
  "-NoProfile",
100719
100775
  "-NonInteractive",
100720
100776
  "-Command",
100721
- `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').ParentProcessId`
100777
+ `$p = Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}' -ErrorAction SilentlyContinue; if ($p) { $p.ParentProcessId }`
100722
100778
  ],
100723
- { encoding: "utf8", timeout: 2e3 }
100779
+ {
100780
+ encoding: "utf8",
100781
+ timeout: 2e3,
100782
+ stdio: ["pipe", "pipe", "ignore"],
100783
+ windowsHide: true
100784
+ }
100724
100785
  ) : execFileSync7("ps", ["-o", "ppid=", "-p", String(pid)], {
100725
100786
  encoding: "utf8",
100726
100787
  timeout: 2e3
@@ -102310,7 +102371,7 @@ var init_chunk_W2SBTCO2 = __esm({
102310
102371
  }
102311
102372
  });
102312
102373
 
102313
- // ../studio-server/dist/chunk-6H3V3WGJ.js
102374
+ // ../studio-server/dist/chunk-NJISQQTN.js
102314
102375
  import { existsSync as existsSync34, statSync as statSync10 } from "fs";
102315
102376
  import { relative as relative8, resolve as resolve18, sep as sep5 } from "path";
102316
102377
  import { execFile as execFile6 } from "child_process";
@@ -102514,8 +102575,8 @@ async function scanProjectMediaCodecMap(projectDir, htmlSources, options = {}) {
102514
102575
  return map;
102515
102576
  }
102516
102577
  var execFileRunner, VIDEO_EXT, IMAGE_EXT, AUDIO_EXT, ALPHA_PIX_FMT_RE, BROWSER_HOSTILE_CODECS, PROXY_VARIANT_CONFIG, defaultProbeCache, MAX_PROBE_CACHE_ENTRIES, VIDEO_SRC_RE, PROBE_CONCURRENCY2;
102517
- var init_chunk_6H3V3WGJ = __esm({
102518
- "../studio-server/dist/chunk-6H3V3WGJ.js"() {
102578
+ var init_chunk_NJISQQTN = __esm({
102579
+ "../studio-server/dist/chunk-NJISQQTN.js"() {
102519
102580
  "use strict";
102520
102581
  init_assets();
102521
102582
  init_assetResolution();
@@ -102524,7 +102585,7 @@ var init_chunk_6H3V3WGJ = __esm({
102524
102585
  execFile6(
102525
102586
  command2,
102526
102587
  args,
102527
- { timeout: options?.timeout, maxBuffer: options?.maxBuffer },
102588
+ { timeout: options?.timeout, maxBuffer: options?.maxBuffer, windowsHide: true },
102528
102589
  (error, stdout2, stderr) => {
102529
102590
  if (error && error.code === "ENOENT") {
102530
102591
  resolvePromise({ status: null, stdout: "", stderr: "", error });
@@ -102574,7 +102635,7 @@ var init_chunk_6H3V3WGJ = __esm({
102574
102635
  }
102575
102636
  });
102576
102637
 
102577
- // ../studio-server/dist/chunk-ZPI6QXJH.js
102638
+ // ../studio-server/dist/chunk-5MUVDQOD.js
102578
102639
  import { spawn as spawn8 } from "child_process";
102579
102640
  import { createHash as createHash8, randomUUID as randomUUID8 } from "crypto";
102580
102641
  import {
@@ -102769,7 +102830,8 @@ function ensureHdrFilters(ffmpegPath) {
102769
102830
  if (hdrFilterCheck?.ffmpegPath === ffmpegPath) return hdrFilterCheck.promise;
102770
102831
  const promise = new Promise((resolveCheck, rejectCheck) => {
102771
102832
  const proc = spawn8(ffmpegPath, ["-hide_banner", "-filters"], {
102772
- stdio: ["ignore", "pipe", "pipe"]
102833
+ stdio: ["ignore", "pipe", "pipe"],
102834
+ windowsHide: true
102773
102835
  });
102774
102836
  let stdout2 = "";
102775
102837
  proc.stdout?.on("data", (chunk) => {
@@ -102868,7 +102930,8 @@ async function runFfmpeg2(sourcePath, outputPath, variant) {
102868
102930
  const proc = spawn8(ffmpegPath, args, {
102869
102931
  stdio: ["ignore", "ignore", "pipe"],
102870
102932
  timeout: TRANSCODE_TIMEOUT_MS,
102871
- killSignal: "SIGKILL"
102933
+ killSignal: "SIGKILL",
102934
+ windowsHide: true
102872
102935
  });
102873
102936
  let stderrTail = "";
102874
102937
  proc.stderr?.on("data", (chunk) => {
@@ -102940,10 +103003,10 @@ async function resolveProxy(projectDir, absoluteSourcePath, variant = "h264") {
102940
103003
  return promise;
102941
103004
  }
102942
103005
  var DEFAULT_MAX_BYTES, DEFAULT_STALE_TEMP_MS, DEFAULT_MIN_SWEEP_INTERVAL_MS, PROXY_EXTENSIONS, lastSweepAt, PROXY_PARAMS_VERSION, CACHE_DIR_NAME, MAX_CONCURRENT_TRANSCODES, MAX_QUEUED_TRANSCODES, STDERR_TAIL_MAX_CHARS, TRANSCODE_TIMEOUT_MS, FAILURE_CACHE_TTL_MS, MAX_FAILURE_CACHE_ENTRIES, DEFAULT_PROXY_WAIT_TIMEOUT_MS, ProxyTranscodeError, FfmpegUnavailableError, FfmpegMissingFilterError, ProxyCapacityError, ProxySourceOutsideProjectError, ProxyWaitTimeoutError, activeTranscodes, waitQueue, inFlight, failedTranscodes, hdrFilterCheck;
102943
- var init_chunk_ZPI6QXJH = __esm({
102944
- "../studio-server/dist/chunk-ZPI6QXJH.js"() {
103006
+ var init_chunk_5MUVDQOD = __esm({
103007
+ "../studio-server/dist/chunk-5MUVDQOD.js"() {
102945
103008
  "use strict";
102946
- init_chunk_6H3V3WGJ();
103009
+ init_chunk_NJISQQTN();
102947
103010
  init_ffBinaries();
102948
103011
  DEFAULT_MAX_BYTES = 10 * 1024 * 1024 * 1024;
102949
103012
  DEFAULT_STALE_TEMP_MS = 60 * 60 * 1e3;
@@ -103011,7 +103074,7 @@ var init_chunk_ZPI6QXJH = __esm({
103011
103074
  }
103012
103075
  });
103013
103076
 
103014
- // ../studio-server/dist/chunk-LHYV3WLZ.js
103077
+ // ../studio-server/dist/chunk-KW5URJHI.js
103015
103078
  import { resolve as resolve20 } from "path";
103016
103079
  function isAutoProxyEnabled(adapter2) {
103017
103080
  return adapter2.autoProxy !== false;
@@ -103058,11 +103121,11 @@ async function injectMediaCodecMap(html, adapter2, projectDir, compSrcPath, prob
103058
103121
  if (!isAutoProxyEnabled(adapter2)) return html;
103059
103122
  return injectMediaCodecMapIntoHtml(html, projectDir, [{ html, compSrcPath }], probeCache);
103060
103123
  }
103061
- var init_chunk_LHYV3WLZ = __esm({
103062
- "../studio-server/dist/chunk-LHYV3WLZ.js"() {
103124
+ var init_chunk_KW5URJHI = __esm({
103125
+ "../studio-server/dist/chunk-KW5URJHI.js"() {
103063
103126
  "use strict";
103064
- init_chunk_ZPI6QXJH();
103065
- init_chunk_6H3V3WGJ();
103127
+ init_chunk_5MUVDQOD();
103128
+ init_chunk_NJISQQTN();
103066
103129
  }
103067
103130
  });
103068
103131
 
@@ -110146,7 +110209,7 @@ function decodeAudioPeaks(audioPath) {
110146
110209
  "-vn",
110147
110210
  "pipe:1"
110148
110211
  ],
110149
- { stdio: ["ignore", "pipe", "ignore"] }
110212
+ { stdio: ["ignore", "pipe", "ignore"], windowsHide: true }
110150
110213
  );
110151
110214
  const chunks = [];
110152
110215
  proc.stdout?.on("data", (chunk) => chunks.push(chunk));
@@ -110184,16 +110247,11 @@ function validateUploadedMedia(filePath, runner = spawnSync) {
110184
110247
  if (!isVideo2 && !isAudio) {
110185
110248
  return { ok: true };
110186
110249
  }
110187
- const result = runner("ffprobe", [
110188
- "-v",
110189
- "error",
110190
- "-show_entries",
110191
- "stream=codec_type",
110192
- "-of",
110193
- "json",
110194
- "--",
110195
- filePath
110196
- ]);
110250
+ const result = runner(
110251
+ "ffprobe",
110252
+ ["-v", "error", "-show_entries", "stream=codec_type", "-of", "json", "--", filePath],
110253
+ { windowsHide: true }
110254
+ );
110197
110255
  if (result.error?.code === "ENOENT") {
110198
110256
  return { ok: true };
110199
110257
  }
@@ -114170,9 +114228,9 @@ var init_dist9 = __esm({
114170
114228
  init_chunk_X62ASOGO();
114171
114229
  init_chunk_XVPRRS7M();
114172
114230
  init_chunk_W2SBTCO2();
114173
- init_chunk_LHYV3WLZ();
114174
- init_chunk_ZPI6QXJH();
114175
- init_chunk_6H3V3WGJ();
114231
+ init_chunk_KW5URJHI();
114232
+ init_chunk_5MUVDQOD();
114233
+ init_chunk_NJISQQTN();
114176
114234
  init_chunk_6XMC64FJ();
114177
114235
  init_chunk_4ETS2LXI();
114178
114236
  init_dist3();
@@ -115385,7 +115443,8 @@ function whichBinary2(name) {
115385
115443
  const output = execSync4(cmd, {
115386
115444
  encoding: "utf-8",
115387
115445
  stdio: ["pipe", "pipe", "pipe"],
115388
- timeout: 5e3
115446
+ timeout: 5e3,
115447
+ windowsHide: true
115389
115448
  });
115390
115449
  const first = output.split(/\r?\n/).map((s2) => s2.trim()).find(Boolean);
115391
115450
  return first || void 0;
@@ -115981,7 +116040,7 @@ async function captureRegionCrop(page, region, scale) {
115981
116040
  }
115982
116041
  async function runFfmpegOnce(ffmpegPath, args, timeoutMs) {
115983
116042
  return await new Promise((resolvePromise) => {
115984
- const ff = spawn10(ffmpegPath, args);
116043
+ const ff = spawn10(ffmpegPath, args, { windowsHide: true });
115985
116044
  let stderr = "";
115986
116045
  let timedOut = false;
115987
116046
  const timer = setTimeout(() => {
@@ -117134,6 +117193,31 @@ var init_renderEventPublisher = __esm({
117134
117193
  }
117135
117194
  });
117136
117195
 
117196
+ // ../producer/src/services/render/encoderInterruption.ts
117197
+ function encoderFailureError(prefix, result) {
117198
+ const message = `${prefix}: ${result.error ?? "unknown encoder failure"}`;
117199
+ return result.failureReason === "external_interruption" ? new EncoderInterruptedError(prefix, message) : new Error(message);
117200
+ }
117201
+ var ENCODER_INTERRUPTED, EncoderInterruptedError;
117202
+ var init_encoderInterruption = __esm({
117203
+ "../producer/src/services/render/encoderInterruption.ts"() {
117204
+ "use strict";
117205
+ ENCODER_INTERRUPTED = "ENCODER_INTERRUPTED";
117206
+ EncoderInterruptedError = class extends Error {
117207
+ code = ENCODER_INTERRUPTED;
117208
+ owner = "system";
117209
+ retryable = true;
117210
+ /** Retained inside the producer for diagnostics; never copied to the wire envelope. */
117211
+ diagnosticMessage;
117212
+ constructor(prefix, diagnosticMessage) {
117213
+ super(`${prefix}: encoder process was interrupted by the host lifecycle`);
117214
+ this.name = "EncoderInterruptedError";
117215
+ this.diagnosticMessage = diagnosticMessage;
117216
+ }
117217
+ };
117218
+ }
117219
+ });
117220
+
117137
117221
  // ../producer/src/services/render/renderExecutionContext.ts
117138
117222
  function scopedLogger(logger, fields) {
117139
117223
  const merge = (meta) => ({ ...fields, ...meta });
@@ -117864,7 +117948,7 @@ var init_perfSummary = __esm({
117864
117948
 
117865
117949
  // ../producer/src/services/render/captureStageError.ts
117866
117950
  function wrapCaptureStageError(error, browserConsole) {
117867
- if (error instanceof CaptureStageError) return error;
117951
+ if (error instanceof CaptureStageError || error instanceof EncoderInterruptedError) return error;
117868
117952
  return new CaptureStageError({ cause: error, browserConsole });
117869
117953
  }
117870
117954
  function getCaptureStageBrowserConsole(error) {
@@ -117877,6 +117961,7 @@ var init_captureStageError = __esm({
117877
117961
  "use strict";
117878
117962
  init_errorMessage2();
117879
117963
  init_src();
117964
+ init_encoderInterruption();
117880
117965
  CaptureStageError = class extends CaptureFailure {
117881
117966
  browserConsole;
117882
117967
  constructor(input2) {
@@ -122994,6 +123079,12 @@ async function runAnimatedGifTranscode(request) {
122994
123079
  const timeout = request.timeoutMs ?? 3e5;
122995
123080
  const result = await runFfmpeg(request.args, { timeout });
122996
123081
  if (result.success) return;
123082
+ if (result.failureReason === "external_interruption") {
123083
+ throw encoderFailureError("Animated GIF transcode failed", {
123084
+ error: `exit ${result.exitCode}: ${result.stderr.slice(-500)}`,
123085
+ failureReason: result.failureReason
123086
+ });
123087
+ }
122997
123088
  if (result.terminationReason === "deadline") {
122998
123089
  throw new Error(`Animated GIF transcode timed out after ${timeout}ms`);
122999
123090
  }
@@ -123149,6 +123240,7 @@ var init_animatedGifPrep = __esm({
123149
123240
  init_dist3();
123150
123241
  init_src();
123151
123242
  init_urlDownloader2();
123243
+ init_encoderInterruption();
123152
123244
  PREPARED_GIF_SUBDIR = "_animated_gif";
123153
123245
  CACHE_SCHEMA = "hfgif-v1";
123154
123246
  MAX_LOOP_ITERATIONS = 1e3;
@@ -125620,9 +125712,18 @@ function resolveVideoExtractionPolicy(env = process.env) {
125620
125712
  return { failureMode, maxTransientRetries };
125621
125713
  }
125622
125714
  function assertVideoExtractionSucceeded(result) {
125715
+ throwIfEncoderInterrupted(result);
125623
125716
  const error = buildVideoExtractionStageError(result);
125624
125717
  if (error) throw error;
125625
125718
  }
125719
+ function throwIfEncoderInterrupted(result) {
125720
+ const interrupted = result.errors.find((failure) => failure.kind === "external_interruption");
125721
+ if (!interrupted) return;
125722
+ throw encoderFailureError("Video frame extraction failed", {
125723
+ error: String(interrupted.error),
125724
+ failureReason: "external_interruption"
125725
+ });
125726
+ }
125626
125727
  function buildVideoExtractionStageError(result) {
125627
125728
  if (result.success && result.errors.length === 0) return null;
125628
125729
  const counts = /* @__PURE__ */ new Map();
@@ -125660,6 +125761,15 @@ function isHdrProbeFailure(failure) {
125660
125761
  }
125661
125762
  function throwHdrProbeFailures(failures, mode) {
125662
125763
  if (failures.length === 0) return;
125764
+ const interrupted = failures.find(
125765
+ (failure) => failure.classified.kind === "external_interruption"
125766
+ );
125767
+ if (interrupted) {
125768
+ throw encoderFailureError("Video HDR probe failed", {
125769
+ error: interrupted.error instanceof Error ? interrupted.error.message : String(interrupted.error),
125770
+ failureReason: "external_interruption"
125771
+ });
125772
+ }
125663
125773
  if (mode === "enforce") {
125664
125774
  throw buildHdrProbeStageError(failures.map((failure) => failure.classified));
125665
125775
  }
@@ -125792,6 +125902,7 @@ async function runExtractVideosStage(input2) {
125792
125902
  );
125793
125903
  extractionResult.phaseBreakdown.transientRetries = (extractionResult.phaseBreakdown.transientRetries ?? 0) + hdrProbeTransientRetries;
125794
125904
  assertNotAborted();
125905
+ throwIfEncoderInterrupted(extractionResult);
125795
125906
  failureToEnforce = applyVideoExtractionFailurePolicy(extractionResult, extractionPolicy, log2);
125796
125907
  materializeExtractedFramesForCompiledDir(extractionResult.extracted, compiledDir, {
125797
125908
  materializeSymlinks
@@ -125848,6 +125959,7 @@ var init_extractVideosStage = __esm({
125848
125959
  init_src();
125849
125960
  init_renderOrchestrator();
125850
125961
  init_shared();
125962
+ init_encoderInterruption();
125851
125963
  VideoExtractionStageError = class extends Error {
125852
125964
  constructor(code, retryable, failures) {
125853
125965
  const total = failures.reduce((sum, failure) => sum + failure.count, 0);
@@ -125925,6 +126037,15 @@ async function runAudioStage(input2) {
125925
126037
  };
125926
126038
  }
125927
126039
  assertNotAborted();
126040
+ const interrupted = audioResult.failures?.find(
126041
+ (failure) => failure.reason === "external_interruption"
126042
+ );
126043
+ if (interrupted) {
126044
+ throw encoderFailureError("Audio processing failed", {
126045
+ error: interrupted.detail,
126046
+ failureReason: "external_interruption"
126047
+ });
126048
+ }
125928
126049
  hasAudio = audioResult.success;
125929
126050
  audioFailures = audioResult.failures;
125930
126051
  if (!hasAudio) {
@@ -125954,6 +126075,7 @@ var init_audioStage = __esm({
125954
126075
  "../producer/src/services/render/stages/audioStage.ts"() {
125955
126076
  "use strict";
125956
126077
  init_src();
126078
+ init_encoderInterruption();
125957
126079
  }
125958
126080
  });
125959
126081
 
@@ -126874,9 +126996,10 @@ async function extractHdrVideoFrames(args) {
126874
126996
  srcPath,
126875
126997
  stderr: result.stderr.slice(-400)
126876
126998
  });
126877
- throw new Error(
126878
- `HDR frame extraction failed for video "${videoId}". Aborting render to avoid shipping black HDR layers.`
126879
- );
126999
+ throw encoderFailureError(`HDR frame extraction failed for video "${videoId}"`, {
127000
+ error: `Aborting render to avoid shipping black HDR layers: ${result.stderr.slice(-400)}`,
127001
+ failureReason: result.failureReason
127002
+ });
126880
127003
  }
126881
127004
  const frameSize = dims.width * dims.height * 6;
126882
127005
  const fd = openSync6(rawPath, constants3.O_RDONLY | NO_FOLLOW_FLAG);
@@ -126966,6 +127089,7 @@ var init_captureHdrResources = __esm({
126966
127089
  init_src();
126967
127090
  init_dist3();
126968
127091
  init_hdrCompositor();
127092
+ init_encoderInterruption();
126969
127093
  NO_FOLLOW_FLAG = constants3.O_NOFOLLOW ?? 0;
126970
127094
  HDR_EXTRACTION_HEADROOM_FRACTION = 0.9;
126971
127095
  HDR_EXTRACTION_CGROUP_BUDGET_FRACTION = 0.5;
@@ -127181,7 +127305,10 @@ function ensureFrameWritten(frameWritten, frameIndex, encoder) {
127181
127305
  if (frameWritten) return;
127182
127306
  const reason = encoder?.getExitError();
127183
127307
  const base2 = `Streaming encoder exited before frame ${frameIndex} was written`;
127184
- throw new Error(reason ? `${base2}: ${reason}` : base2);
127308
+ throw encoderFailureError(base2, {
127309
+ error: reason,
127310
+ failureReason: encoder?.getExitFailureReason?.()
127311
+ });
127185
127312
  }
127186
127313
  function cleanupEndedHdrVideos(args) {
127187
127314
  if (process.env.KEEP_TEMP === "1") return;
@@ -127215,6 +127342,7 @@ var init_captureHdrFrameShared = __esm({
127215
127342
  init_hdrCompositor();
127216
127343
  init_captureHdrResources();
127217
127344
  init_hdrPerf();
127345
+ init_encoderInterruption();
127218
127346
  }
127219
127347
  });
127220
127348
 
@@ -127696,7 +127824,7 @@ async function runCaptureStreamingStage(input2) {
127696
127824
  streamingEncoderClosed = true;
127697
127825
  assertNotAborted();
127698
127826
  if (!encodeResult.success) {
127699
- throw new Error(`Streaming encode failed: ${encodeResult.error}`);
127827
+ throw encoderFailureError("Streaming encode failed", encodeResult);
127700
127828
  }
127701
127829
  return {
127702
127830
  success: true,
@@ -127728,6 +127856,7 @@ var init_captureStreamingStage = __esm({
127728
127856
  init_perfSummary();
127729
127857
  init_captureHdrFrameShared();
127730
127858
  init_shared();
127859
+ init_encoderInterruption();
127731
127860
  DEFAULT_DE_STALL_MS = 6e4;
127732
127861
  DE_STALL_POLL_MS = 5e3;
127733
127862
  }
@@ -128669,7 +128798,7 @@ async function runCaptureHdrStage(input2) {
128669
128798
  hdrEncoderClosed = true;
128670
128799
  assertNotAborted();
128671
128800
  if (!hdrEncodeResult.success) {
128672
- throw new Error(`HDR encode failed: ${hdrEncodeResult.error}`);
128801
+ throw encoderFailureError("HDR encode failed", hdrEncodeResult);
128673
128802
  }
128674
128803
  captureDurationMs = Date.now() - stageStart;
128675
128804
  encodeMs = hdrEncodeResult.durationMs;
@@ -128721,6 +128850,7 @@ var init_captureHdrStage = __esm({
128721
128850
  init_captureHdrSequentialLoop();
128722
128851
  init_captureHdrHybridLoop();
128723
128852
  init_captureStageError();
128853
+ init_encoderInterruption();
128724
128854
  }
128725
128855
  });
128726
128856
 
@@ -128812,7 +128942,8 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input2) {
128812
128942
  durationMs: Date.now() - startTime,
128813
128943
  framesEncoded: 0,
128814
128944
  fileSize: 0,
128815
- error: formatFfmpegError(paletteResult.exitCode, paletteResult.stderr)
128945
+ error: formatFfmpegError(paletteResult.exitCode, paletteResult.stderr),
128946
+ failureReason: paletteResult.failureReason
128816
128947
  };
128817
128948
  }
128818
128949
  const gifResult = await runFfmpeg(buildGifPaletteuseArgs(argsInput), {
@@ -128826,7 +128957,8 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input2) {
128826
128957
  durationMs: Date.now() - startTime,
128827
128958
  framesEncoded: 0,
128828
128959
  fileSize: 0,
128829
- error: formatFfmpegError(gifResult.exitCode, gifResult.stderr)
128960
+ error: formatFfmpegError(gifResult.exitCode, gifResult.stderr),
128961
+ failureReason: gifResult.failureReason
128830
128962
  };
128831
128963
  }
128832
128964
  const fileSize = existsSync55(outputPath) ? statSync16(outputPath).size : 0;
@@ -128905,7 +129037,7 @@ async function runEncodeStage(input2) {
128905
129037
  });
128906
129038
  assertNotAborted();
128907
129039
  if (!encodeResult2.success) {
128908
- throw new Error(`Encoding failed: ${encodeResult2.error}`);
129040
+ throw encoderFailureError("Encoding failed", encodeResult2);
128909
129041
  }
128910
129042
  return { encodeMs: Date.now() - stage5Start };
128911
129043
  }
@@ -128950,7 +129082,7 @@ async function runEncodeStage(input2) {
128950
129082
  );
128951
129083
  assertNotAborted();
128952
129084
  if (!encodeResult.success) {
128953
- throw new Error(`Encoding failed: ${encodeResult.error}`);
129085
+ throw encoderFailureError("Encoding failed", encodeResult);
128954
129086
  }
128955
129087
  return { encodeMs: Date.now() - stage5Start };
128956
129088
  }
@@ -128961,6 +129093,7 @@ var init_encodeStage = __esm({
128961
129093
  init_paths();
128962
129094
  init_gifEncodeArgs();
128963
129095
  init_shared();
129096
+ init_encoderInterruption();
128964
129097
  }
128965
129098
  });
128966
129099
 
@@ -129095,7 +129228,8 @@ async function padOrTrimAudioToVideoFrameCount(input2) {
129095
129228
  targetDurationSeconds,
129096
129229
  sourceDurationSeconds: audioInfo.durationSeconds,
129097
129230
  operation: plan2.operation,
129098
- error: ffmpegResult.error
129231
+ error: ffmpegResult.error,
129232
+ failureReason: ffmpegResult.failureReason
129099
129233
  };
129100
129234
  }
129101
129235
  }
@@ -129197,7 +129331,8 @@ async function defaultRunFfmpeg(args, signal) {
129197
129331
  if (result.success) return { success: true };
129198
129332
  return {
129199
129333
  success: false,
129200
- error: `[audioPadTrim] ${formatFfmpegError(result.exitCode, result.stderr)}`
129334
+ error: `[audioPadTrim] ${formatFfmpegError(result.exitCode, result.stderr)}`,
129335
+ failureReason: result.failureReason
129201
129336
  };
129202
129337
  }
129203
129338
  async function runFfprobeJson(args, signal) {
@@ -129264,11 +129399,12 @@ async function runAssembleStage(input2) {
129264
129399
  const normalizeResult = await padOrTrimAudioToVideoFrameCount({
129265
129400
  videoPath: videoOnlyPath,
129266
129401
  audioPath: audioOutputPath,
129267
- outputPath: normalizedAudioPath
129402
+ outputPath: normalizedAudioPath,
129403
+ signal: abortSignal
129268
129404
  });
129269
129405
  assertNotAborted();
129270
129406
  if (!normalizeResult.success) {
129271
- throw new Error(`Audio duration normalization failed: ${normalizeResult.error}`);
129407
+ throw encoderFailureError("Audio duration normalization failed", normalizeResult);
129272
129408
  }
129273
129409
  const muxResult = await muxVideoWithAudio(
129274
129410
  videoOnlyPath,
@@ -129282,7 +129418,7 @@ async function runAssembleStage(input2) {
129282
129418
  );
129283
129419
  assertNotAborted();
129284
129420
  if (!muxResult.success) {
129285
- throw new Error(`Audio muxing failed: ${muxResult.error}`);
129421
+ throw encoderFailureError("Audio muxing failed", muxResult);
129286
129422
  }
129287
129423
  } else {
129288
129424
  const faststartResult = await applyFaststart(
@@ -129294,7 +129430,7 @@ async function runAssembleStage(input2) {
129294
129430
  );
129295
129431
  assertNotAborted();
129296
129432
  if (!faststartResult.success) {
129297
- throw new Error(`Faststart failed: ${faststartResult.error}`);
129433
+ throw encoderFailureError("Faststart failed", faststartResult);
129298
129434
  }
129299
129435
  }
129300
129436
  return { assembleMs: Date.now() - stage6Start };
@@ -129304,6 +129440,7 @@ var init_assembleStage = __esm({
129304
129440
  "use strict";
129305
129441
  init_src();
129306
129442
  init_audioPadTrim();
129443
+ init_encoderInterruption();
129307
129444
  init_shared();
129308
129445
  }
129309
129446
  });
@@ -129855,7 +129992,7 @@ function resolveParallelRouterRetryPlan(args) {
129855
129992
  };
129856
129993
  }
129857
129994
  function shouldRetryViaPinnedFallback(args) {
129858
- if (args.isCancellation) return false;
129995
+ if (args.isCancellation || args.isEncoderInterrupted) return false;
129859
129996
  if (args.isVerifyError) return true;
129860
129997
  return args.deWorkerInversion === "inverted" || args.deParallelRouter === "routed";
129861
129998
  }
@@ -130936,6 +131073,7 @@ async function executeRenderPipeline(input2) {
130936
131073
  if (!shouldRetryViaPinnedFallback({
130937
131074
  isVerifyError,
130938
131075
  isCancellation,
131076
+ isEncoderInterrupted: err instanceof EncoderInterruptedError,
130939
131077
  deWorkerInversion,
130940
131078
  deParallelRouter
130941
131079
  }))
@@ -131287,6 +131425,12 @@ async function executeRenderPipeline(input2) {
131287
131425
  await eventPublisher.flush();
131288
131426
  throw error instanceof RenderCancelledError ? error : new RenderCancelledError("render_cancelled");
131289
131427
  }
131428
+ if (error instanceof EncoderInterruptedError) {
131429
+ log2.warn("[Render] encoder process interrupted by host lifecycle", {
131430
+ code: error.code,
131431
+ diagnostic: error.diagnosticMessage.slice(-2e3)
131432
+ });
131433
+ }
131290
131434
  const memoryGuidance = describeMemoryExhaustion(error, {
131291
131435
  width: captureCompositionWidth,
131292
131436
  height: captureCompositionHeight,
@@ -131377,6 +131521,7 @@ var init_renderOrchestrator = __esm({
131377
131521
  init_shared();
131378
131522
  init_cleanup();
131379
131523
  init_renderEventPublisher();
131524
+ init_encoderInterruption();
131380
131525
  init_renderExecutionContext();
131381
131526
  init_artifactTransaction();
131382
131527
  init_capturePlan();
@@ -132760,7 +132905,8 @@ var init_server = __esm({
132760
132905
  "NOT_MEDIA_PAYLOAD",
132761
132906
  "INVALID_VIDEO_METADATA",
132762
132907
  "VIDEO_SOURCE_UNRENDERABLE",
132763
- "VIDEO_EXTRACTION_FAILED"
132908
+ "VIDEO_EXTRACTION_FAILED",
132909
+ "ENCODER_INTERRUPTED"
132764
132910
  ]);
132765
132911
  entryScript = process.argv[1] ? resolve35(process.argv[1]) : "";
132766
132912
  isPublicServerEntry = entryScript.endsWith("/public-server.js") || entryScript.endsWith("/src/server.ts");
@@ -134958,9 +135104,10 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
134958
135104
  remuxArgs.push("-y", concatOutputPath);
134959
135105
  const remuxResult = await runFfmpeg(remuxArgs, { signal: abortSignal });
134960
135106
  if (!remuxResult.success) {
134961
- throw new Error(
134962
- `[assemble] ffmpeg single-chunk remux failed (exit ${remuxResult.exitCode}): ${remuxResult.stderr.slice(-400)}`
134963
- );
135107
+ throw encoderFailureError("[assemble] ffmpeg single-chunk remux failed", {
135108
+ error: `exit ${remuxResult.exitCode}: ${remuxResult.stderr.slice(-400)}`,
135109
+ failureReason: remuxResult.failureReason
135110
+ });
134964
135111
  }
134965
135112
  } else {
134966
135113
  const concatListPath = join75(workDir, "concat-list.txt");
@@ -134983,9 +135130,10 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
134983
135130
  concatArgs.push("-y", concatOutputPath);
134984
135131
  const concatResult = await runFfmpeg(concatArgs, { signal: abortSignal });
134985
135132
  if (!concatResult.success) {
134986
- throw new Error(
134987
- `[assemble] ffmpeg concat-copy failed (exit ${concatResult.exitCode}): ${concatResult.stderr.slice(-400)}`
134988
- );
135133
+ throw encoderFailureError("[assemble] ffmpeg concat-copy failed", {
135134
+ error: `exit ${concatResult.exitCode}: ${concatResult.stderr.slice(-400)}`,
135135
+ failureReason: concatResult.failureReason
135136
+ });
134989
135137
  }
134990
135138
  }
134991
135139
  let postConcatPath = concatOutputPath;
@@ -135026,9 +135174,10 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
135026
135174
  cfrArgs.push("-y", cfrOutputPath);
135027
135175
  const cfrResult = await runFfmpeg(cfrArgs, { signal: abortSignal });
135028
135176
  if (!cfrResult.success) {
135029
- throw new Error(
135030
- `[assemble] ffmpeg cfr re-encode failed (exit ${cfrResult.exitCode}): ${cfrResult.stderr.slice(-400)}`
135031
- );
135177
+ throw encoderFailureError("[assemble] ffmpeg cfr re-encode failed", {
135178
+ error: `exit ${cfrResult.exitCode}: ${cfrResult.stderr.slice(-400)}`,
135179
+ failureReason: cfrResult.failureReason
135180
+ });
135032
135181
  }
135033
135182
  postConcatPath = cfrOutputPath;
135034
135183
  log2.info("[assemble] cfr re-encode applied", {
@@ -135047,7 +135196,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
135047
135196
  signal: abortSignal
135048
135197
  });
135049
135198
  if (!padTrimResult.success) {
135050
- throw new Error(`[assemble] audio pad/trim failed: ${padTrimResult.error}`);
135199
+ throw encoderFailureError("[assemble] audio pad/trim failed", padTrimResult);
135051
135200
  }
135052
135201
  normalizedAudioPath = paddedAudioPath;
135053
135202
  log2.info("[assemble] audio normalized for mux", {
@@ -135069,7 +135218,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
135069
135218
  { num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen }
135070
135219
  );
135071
135220
  if (!muxResult.success) {
135072
- throw new Error(`[assemble] audio mux failed: ${muxResult.error}`);
135221
+ throw encoderFailureError("[assemble] audio mux failed", muxResult);
135073
135222
  }
135074
135223
  }
135075
135224
  const faststartResult = await applyFaststart(
@@ -135083,7 +135232,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
135083
135232
  }
135084
135233
  );
135085
135234
  if (!faststartResult.success) {
135086
- throw new Error(`[assemble] faststart failed: ${faststartResult.error}`);
135235
+ throw encoderFailureError("[assemble] faststart failed", faststartResult);
135087
135236
  }
135088
135237
  } finally {
135089
135238
  try {
@@ -135154,6 +135303,7 @@ var init_assemble = __esm({
135154
135303
  init_logger();
135155
135304
  init_paths();
135156
135305
  init_audioPadTrim();
135306
+ init_encoderInterruption();
135157
135307
  init_planProtocol();
135158
135308
  init_planV2();
135159
135309
  }
@@ -136367,7 +136517,7 @@ async function render2(options) {
136367
136517
  }
136368
136518
  }
136369
136519
  function spawnFfmpeg(ffmpegPath, args, label2, stdio) {
136370
- const proc = spawn12(ffmpegPath, args, { stdio });
136520
+ const proc = spawn12(ffmpegPath, args, { stdio, windowsHide: true });
136371
136521
  let stderrBuf = "";
136372
136522
  proc.stderr?.on("data", (d2) => {
136373
136523
  stderrBuf += d2.toString();
@@ -136513,7 +136663,11 @@ function configuredMissingDetail(envName) {
136513
136663
  }
136514
136664
  function readToolVersion(binaryPath) {
136515
136665
  try {
136516
- const raw = execFileSync9(binaryPath, ["-version"], { encoding: "utf-8", timeout: 5e3 }).split("\n")[0] ?? "";
136666
+ const raw = execFileSync9(binaryPath, ["-version"], {
136667
+ encoding: "utf-8",
136668
+ timeout: 5e3,
136669
+ windowsHide: true
136670
+ }).split("\n")[0] ?? "";
136517
136671
  const version2 = parseToolVersion(raw);
136518
136672
  return { ok: true, detail: version2 ? `${version2} at ${binaryPath}` : binaryPath };
136519
136673
  } catch (error) {
@@ -140985,9 +141139,9 @@ var init_catalog = __esm({
140985
141139
  var init_mediaProxyPreview = __esm({
140986
141140
  "../studio-server/dist/helpers/mediaProxyPreview.js"() {
140987
141141
  "use strict";
140988
- init_chunk_LHYV3WLZ();
140989
- init_chunk_ZPI6QXJH();
140990
- init_chunk_6H3V3WGJ();
141142
+ init_chunk_KW5URJHI();
141143
+ init_chunk_5MUVDQOD();
141144
+ init_chunk_NJISQQTN();
140991
141145
  }
140992
141146
  });
140993
141147
 
@@ -141105,8 +141259,8 @@ var init_compositionServer = __esm({
141105
141259
  var init_proxyTranscoder = __esm({
141106
141260
  "../studio-server/dist/helpers/proxyTranscoder.js"() {
141107
141261
  "use strict";
141108
- init_chunk_ZPI6QXJH();
141109
- init_chunk_6H3V3WGJ();
141262
+ init_chunk_5MUVDQOD();
141263
+ init_chunk_NJISQQTN();
141110
141264
  }
141111
141265
  });
141112
141266
 
@@ -141114,7 +141268,7 @@ var init_proxyTranscoder = __esm({
141114
141268
  var init_mediaCodecMap = __esm({
141115
141269
  "../studio-server/dist/helpers/mediaCodecMap.js"() {
141116
141270
  "use strict";
141117
- init_chunk_6H3V3WGJ();
141271
+ init_chunk_NJISQQTN();
141118
141272
  }
141119
141273
  });
141120
141274
 
@@ -145050,7 +145204,7 @@ function probeWebmAlpha(filePath) {
145050
145204
  "--",
145051
145205
  filePath
145052
145206
  ],
145053
- { encoding: "utf-8", timeout: 15e3 }
145207
+ { encoding: "utf-8", timeout: 15e3, windowsHide: true }
145054
145208
  );
145055
145209
  const parsed = JSON.parse(raw);
145056
145210
  const stream = parsed.streams?.[0];
@@ -145094,7 +145248,12 @@ function sampledAlphaIsFullyOpaque(filePath) {
145094
145248
  "rawvideo",
145095
145249
  "-"
145096
145250
  ],
145097
- { timeout: 3e4, maxBuffer: 4096, stdio: ["ignore", "pipe", "pipe"] }
145251
+ {
145252
+ timeout: 3e4,
145253
+ maxBuffer: 4096,
145254
+ stdio: ["ignore", "pipe", "pipe"],
145255
+ windowsHide: true
145256
+ }
145098
145257
  );
145099
145258
  if (buf.length === 0 || buf.length > MAX_SAMPLE_BYTES || buf.length % BYTES_PER_SAMPLE_FRAME !== 0) {
145100
145259
  return void 0;