@camstack/system 1.2.269 → 1.2.270
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.
|
@@ -2279,6 +2279,24 @@ function buildGridTilePlan(input) {
|
|
|
2279
2279
|
/** See D527: the probe returns from the SDP instead of reading media. */
|
|
2280
2280
|
var ANALYZE_DURATION_US$1 = 0;
|
|
2281
2281
|
var PROBE_SIZE_BYTES$1 = 32;
|
|
2282
|
+
/**
|
|
2283
|
+
* Threads per child, and why they are BOUNDED rather than automatic.
|
|
2284
|
+
*
|
|
2285
|
+
* ffmpeg's default is one thread per core, applied to decode, the filter graph
|
|
2286
|
+
* and the output — and it applies it per CHILD. A compositor has N+1 of them,
|
|
2287
|
+
* so on the hub's 20-core CPU two tiles reading 640x360 sub-streams were
|
|
2288
|
+
* measured holding 71 and 56 threads (2026-09-18). That is not a CPU problem:
|
|
2289
|
+
* the container's pid cgroup counts THREADS, its ceiling is 2048, and it was
|
|
2290
|
+
* sitting at 1858. Every new `pthread_create` then fails with EAGAIN, which
|
|
2291
|
+
* ffmpeg reports as `ff_frame_thread_encoder_init failed` — the grid stopped
|
|
2292
|
+
* working, and nothing about the message says "out of pids".
|
|
2293
|
+
*
|
|
2294
|
+
* A tile decodes one small stream and scales it once; one thread does that at a
|
|
2295
|
+
* few percent of a core (measured: 2.2-2.4%). The encoder gets a few more
|
|
2296
|
+
* because it is the only piece whose work scales with the canvas.
|
|
2297
|
+
*/
|
|
2298
|
+
var TILE_THREADS = 1;
|
|
2299
|
+
var ENCODER_THREADS = 4;
|
|
2282
2300
|
var PRESET$1 = "veryfast";
|
|
2283
2301
|
var TUNE$1 = "zerolatency";
|
|
2284
2302
|
var GOP_SECONDS$1 = 1;
|
|
@@ -2302,7 +2320,7 @@ function gridTileDecoderInvocation(input) {
|
|
|
2302
2320
|
fps: input.fps
|
|
2303
2321
|
},
|
|
2304
2322
|
audio: { kind: "none" },
|
|
2305
|
-
threadCount:
|
|
2323
|
+
threadCount: TILE_THREADS,
|
|
2306
2324
|
outputArgs: [],
|
|
2307
2325
|
sink: {
|
|
2308
2326
|
kind: "stdout",
|
|
@@ -2337,7 +2355,7 @@ function gridCanvasEncoderInvocation(input) {
|
|
|
2337
2355
|
},
|
|
2338
2356
|
video,
|
|
2339
2357
|
audio: { kind: "none" },
|
|
2340
|
-
threadCount:
|
|
2358
|
+
threadCount: ENCODER_THREADS,
|
|
2341
2359
|
outputArgs: [],
|
|
2342
2360
|
sink: {
|
|
2343
2361
|
kind: "stdout",
|
|
@@ -2274,6 +2274,24 @@ function buildGridTilePlan(input) {
|
|
|
2274
2274
|
/** See D527: the probe returns from the SDP instead of reading media. */
|
|
2275
2275
|
var ANALYZE_DURATION_US$1 = 0;
|
|
2276
2276
|
var PROBE_SIZE_BYTES$1 = 32;
|
|
2277
|
+
/**
|
|
2278
|
+
* Threads per child, and why they are BOUNDED rather than automatic.
|
|
2279
|
+
*
|
|
2280
|
+
* ffmpeg's default is one thread per core, applied to decode, the filter graph
|
|
2281
|
+
* and the output — and it applies it per CHILD. A compositor has N+1 of them,
|
|
2282
|
+
* so on the hub's 20-core CPU two tiles reading 640x360 sub-streams were
|
|
2283
|
+
* measured holding 71 and 56 threads (2026-09-18). That is not a CPU problem:
|
|
2284
|
+
* the container's pid cgroup counts THREADS, its ceiling is 2048, and it was
|
|
2285
|
+
* sitting at 1858. Every new `pthread_create` then fails with EAGAIN, which
|
|
2286
|
+
* ffmpeg reports as `ff_frame_thread_encoder_init failed` — the grid stopped
|
|
2287
|
+
* working, and nothing about the message says "out of pids".
|
|
2288
|
+
*
|
|
2289
|
+
* A tile decodes one small stream and scales it once; one thread does that at a
|
|
2290
|
+
* few percent of a core (measured: 2.2-2.4%). The encoder gets a few more
|
|
2291
|
+
* because it is the only piece whose work scales with the canvas.
|
|
2292
|
+
*/
|
|
2293
|
+
var TILE_THREADS = 1;
|
|
2294
|
+
var ENCODER_THREADS = 4;
|
|
2277
2295
|
var PRESET$1 = "veryfast";
|
|
2278
2296
|
var TUNE$1 = "zerolatency";
|
|
2279
2297
|
var GOP_SECONDS$1 = 1;
|
|
@@ -2297,7 +2315,7 @@ function gridTileDecoderInvocation(input) {
|
|
|
2297
2315
|
fps: input.fps
|
|
2298
2316
|
},
|
|
2299
2317
|
audio: { kind: "none" },
|
|
2300
|
-
threadCount:
|
|
2318
|
+
threadCount: TILE_THREADS,
|
|
2301
2319
|
outputArgs: [],
|
|
2302
2320
|
sink: {
|
|
2303
2321
|
kind: "stdout",
|
|
@@ -2332,7 +2350,7 @@ function gridCanvasEncoderInvocation(input) {
|
|
|
2332
2350
|
},
|
|
2333
2351
|
video,
|
|
2334
2352
|
audio: { kind: "none" },
|
|
2335
|
-
threadCount:
|
|
2353
|
+
threadCount: ENCODER_THREADS,
|
|
2336
2354
|
outputArgs: [],
|
|
2337
2355
|
sink: {
|
|
2338
2356
|
kind: "stdout",
|