@torrent-tv/proxy 2.9.140 → 2.9.141

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.9.141
2
+
3
+ - **New**: A held segment says whether the encoder is actually moving. The line already reported that the run was alive and at the right index and stopped there, which left the two possible causes indistinguishable: an encoder waiting on torrent pieces looks exactly like one that is encoding and has not finished. It now reports how much media the run has produced since it started and at what speed, and says outright when the position has not moved at all — which means the input is what is being waited for. Measured 2026-08-11: segment #675 was held with the run started at #675 and the encoder alive, nothing in the log could say why, and the browser then abandoned the session and built another — which is where the "second session after a seek" came from.
4
+
1
5
  ## 2.9.140
2
6
 
3
7
  - **New**: What this host takes to produce a first segment is now derived from the startup benchmark, so a machine answers correctly on its very first run. Encoder detection already encodes `testsrc2` through the real HLS pipeline and records each preset's throughput in pixels per second; one segment is a known quantity of pixels, so the time follows by division. No coefficient is involved — it is a measurement of this machine taken minutes earlier, applied to a known amount of work. Until now there was no answer at all before the first session finished, and the browser filled the gap with an assumed rate of exactly one, which was wrong by a factor of four in both directions.
package/host-timings.json CHANGED
@@ -1 +1 @@
1
- {"firstSegment":[3,1,4,11],"sessionCreate":[]}
1
+ {"firstSegment":[3,1,4,11,3,1,3,17],"sessionCreate":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.9.140",
3
+ "version": "2.9.141",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "publishConfig": {
@@ -3890,10 +3890,21 @@ export class HlsSessionManager {
3890
3890
  }
3891
3891
  session.holdExplainedAt.set(fileName, now);
3892
3892
  const index = session.segmentFormat.segmentIndexFromName(fileName);
3893
+ // What the encoder has actually DONE since it restarted. "Alive at the right
3894
+ // index" was as far as the old line went, and it left the two possible
3895
+ // causes indistinguishable: an encoder waiting for torrent pieces looks
3896
+ // exactly like one that is encoding and simply has not finished. The
3897
+ // difference is whether its position has moved at all.
3898
+ const runStartSeconds = this.#segmentStartTime(session, session.encodeStartIndex ?? 0);
3899
+ const position = Number(session.progress?.processedSeconds);
3900
+ const produced = Number.isFinite(position) ? position - runStartSeconds : null;
3901
+ const speed = session.progress?.speed ?? "n/a";
3893
3902
  logger.warn(
3894
3903
  `transcode ${session.id} holding ${fileName}: ${reason} ` +
3895
3904
  `(run from #${session.encodeStartIndex ?? "?"}, viewer at #${session.lastRequestedSegment ?? "?"}, ` +
3896
- `encoder ${session.ffmpeg ? "alive" : "stopped"}, index #${index})`
3905
+ `encoder ${session.ffmpeg ? "alive" : "stopped"}, index #${index}, ` +
3906
+ `produced ${produced === null ? "nothing yet — no position reported" : `${produced.toFixed(1)}s`} ` +
3907
+ `at ${speed}${produced !== null && produced <= 0 ? " — the encoder has not moved, so it is waiting on its input" : ""})`
3897
3908
  );
3898
3909
  }
3899
3910