@camstack/addon-pipeline 1.1.34 → 1.1.36
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/assets/reference-audio/dog-bark.wav +0 -0
- package/assets/reference-audio/meow.wav +0 -0
- package/assets/reference-audio/silence.wav +0 -0
- package/assets/reference-audio/siren.wav +0 -0
- package/assets/reference-audio/speech.wav +0 -0
- package/assets/reference-audio/synthetic-alarm.wav +0 -0
- package/assets/reference-audio/synthetic-bark.wav +0 -0
- package/assets/reference-audio/synthetic-cry.wav +0 -0
- package/assets/reference-audio/synthetic-speech.wav +0 -0
- package/assets/reference-images/1-bird.jpg +0 -0
- package/assets/reference-images/1-car-plate.jpg +0 -0
- package/assets/reference-images/2-birds.jpg +0 -0
- package/assets/reference-images/2-cars-plates.jpg +0 -0
- package/assets/reference-images/3-persons.jpg +0 -0
- package/assets/reference-images/README.md +16 -0
- package/assets/reference-images/animals-group.jpg +0 -0
- package/assets/reference-images/ground-truth/1-bird.json +22 -0
- package/assets/reference-images/ground-truth/1-car-plate.json +85 -0
- package/assets/reference-images/ground-truth/2-birds.json +35 -0
- package/assets/reference-images/ground-truth/2-cars-plates.json +137 -0
- package/assets/reference-images/ground-truth/3-persons.json +186 -0
- package/assets/reference-images/ground-truth/animals-group.json +87 -0
- package/assets/reference-images/ground-truth/persons-cars-animal.json +136 -0
- package/assets/reference-images/ground-truth/sinner.json +73 -0
- package/assets/reference-images/persons-cars-animal.jpg +0 -0
- package/assets/reference-images/sinner.jpg +0 -0
- package/dist/audio-analyzer/index.js +1 -1
- package/dist/audio-analyzer/index.mjs +1 -1
- package/dist/audio-codec-ffmpeg/index.js +1 -1
- package/dist/audio-codec-ffmpeg/index.mjs +1 -1
- package/dist/detection-pipeline/index.js +3 -1
- package/dist/detection-pipeline/index.mjs +3 -1
- package/dist/{dist-CfSORkv2.mjs → dist-BESCfHIV.mjs} +35 -128
- package/dist/{dist-BrIE85BG.js → dist-BZBQc2QZ.js} +34 -145
- package/dist/{frame-handle-plane-C05rq9Zs.mjs → frame-handle-plane-CYtnVPIg.mjs} +1 -1
- package/dist/{frame-handle-plane-zMju9vmk.js → frame-handle-plane-ChjxN8oI.js} +1 -1
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +2 -2
- package/dist/pipeline-runner/index.mjs +2 -2
- package/dist/recorder/index.js +1 -1
- package/dist/recorder/index.mjs +1 -1
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DPFAbcUo.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BDLr3512.mjs} +2 -2
- package/dist/stream-broker/{hostInit-C8slrxw1.mjs → hostInit-C0Y3vfFE.mjs} +2 -2
- package/dist/stream-broker/index.js +133 -18
- package/dist/stream-broker/index.mjs +119 -4
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-WUVfFzT-.js → MaskShapeCanvas-DI4BY7W2-BL-S3O0Z.js} +1 -1
- package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-CF7FXXLs.js → MotionZonesSettings-NcxxQN8r-DcnKZAt6.js} +1 -1
- package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-qQCpVob3.js → PrivacyMaskSettings-APgPLF7p-DQ0MK5T9.js} +1 -1
- package/embed-dist/assets/{index-BNhisVUZ.js → index-BCGUC-8v.js} +7 -7
- package/embed-dist/index.html +1 -1
- package/package.json +3 -57
- package/dist/decoder-ffmpeg/index.js +0 -1114
- package/dist/decoder-ffmpeg/index.mjs +0 -1097
- package/dist/decoder-nodeav/index.js +0 -1422
- package/dist/decoder-nodeav/index.mjs +0 -1414
- package/dist/ffmpeg-args-CpeRWwL4.mjs +0 -326
- package/dist/ffmpeg-args-Dl9mLcOC.js +0 -421
- package/dist/frame-dropper-AjheBGMG.mjs +0 -22
- package/dist/frame-dropper-DKLM6pMz.js +0 -27
- package/dist/frame-ring-sink-1aLGcNNf.mjs +0 -557
- package/dist/frame-ring-sink-CvlcAUOu.js +0 -604
|
@@ -14272,66 +14272,6 @@ var CustomModelDescriptorSchema = object({
|
|
|
14272
14272
|
});
|
|
14273
14273
|
method(_void(), array(CustomModelDescriptorSchema).readonly());
|
|
14274
14274
|
/**
|
|
14275
|
-
* Stable UI option list for the `hwaccel` setting. Decoder addons
|
|
14276
|
-
* reuse this for `globalSettingsSchema()` so the dropdown is
|
|
14277
|
-
* identical everywhere. Order: auto → off → common backends by
|
|
14278
|
-
* platform affinity (macOS, NVIDIA, Intel/AMD, Windows, Linux).
|
|
14279
|
-
*/
|
|
14280
|
-
var HWACCEL_OPTIONS = [
|
|
14281
|
-
{
|
|
14282
|
-
value: "auto",
|
|
14283
|
-
label: "Auto (defer to probed best)"
|
|
14284
|
-
},
|
|
14285
|
-
{
|
|
14286
|
-
value: "none",
|
|
14287
|
-
label: "Off (software)"
|
|
14288
|
-
},
|
|
14289
|
-
{
|
|
14290
|
-
value: "videotoolbox",
|
|
14291
|
-
label: "VideoToolbox (macOS)"
|
|
14292
|
-
},
|
|
14293
|
-
{
|
|
14294
|
-
value: "cuda",
|
|
14295
|
-
label: "CUDA (NVIDIA)"
|
|
14296
|
-
},
|
|
14297
|
-
{
|
|
14298
|
-
value: "nvdec",
|
|
14299
|
-
label: "NVDEC (NVIDIA legacy)"
|
|
14300
|
-
},
|
|
14301
|
-
{
|
|
14302
|
-
value: "vaapi",
|
|
14303
|
-
label: "VAAPI (Linux Intel/AMD)"
|
|
14304
|
-
},
|
|
14305
|
-
{
|
|
14306
|
-
value: "qsv",
|
|
14307
|
-
label: "QuickSync (Intel)"
|
|
14308
|
-
},
|
|
14309
|
-
{
|
|
14310
|
-
value: "d3d11va",
|
|
14311
|
-
label: "D3D11VA (Windows)"
|
|
14312
|
-
},
|
|
14313
|
-
{
|
|
14314
|
-
value: "dxva2",
|
|
14315
|
-
label: "DXVA2 (Windows legacy)"
|
|
14316
|
-
},
|
|
14317
|
-
{
|
|
14318
|
-
value: "amf",
|
|
14319
|
-
label: "AMF (AMD)"
|
|
14320
|
-
},
|
|
14321
|
-
{
|
|
14322
|
-
value: "vdpau",
|
|
14323
|
-
label: "VDPAU (Linux NVIDIA legacy)"
|
|
14324
|
-
},
|
|
14325
|
-
{
|
|
14326
|
-
value: "drm",
|
|
14327
|
-
label: "DRM (Linux generic)"
|
|
14328
|
-
}
|
|
14329
|
-
];
|
|
14330
|
-
var DEFAULT_DECODER_HWACCEL_CONFIG = {
|
|
14331
|
-
hwaccel: "auto",
|
|
14332
|
-
probedBestHwaccel: ""
|
|
14333
|
-
};
|
|
14334
|
-
/**
|
|
14335
14275
|
* shm ring usage stats for a `frameSink: 'shm'` decoder session —
|
|
14336
14276
|
* exposed via `decoder.getShmStats` so downstream consumers can
|
|
14337
14277
|
* observe ring pressure (slot count, byte budget, hit/miss ratio).
|
|
@@ -14346,73 +14286,40 @@ var ShmRingStatsSchema = object({
|
|
|
14346
14286
|
getFrameHits: number().int(),
|
|
14347
14287
|
getFrameMisses: number().int()
|
|
14348
14288
|
});
|
|
14349
|
-
|
|
14350
|
-
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
waitMs: number().optional()
|
|
14384
|
-
}), array(FrameHandleSchema)),
|
|
14385
|
-
getFrame: method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()),
|
|
14386
|
-
getShmStats: method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()),
|
|
14387
|
-
updateConfig: method(object({
|
|
14388
|
-
sessionId: string(),
|
|
14389
|
-
config: DecoderSessionConfigSchema.partial()
|
|
14390
|
-
}), _void()),
|
|
14391
|
-
getStats: method(object({ sessionId: string() }), DecoderStatsSchema),
|
|
14392
|
-
listActiveSessions: method(_void(), array(object({
|
|
14393
|
-
sessionId: string(),
|
|
14394
|
-
codec: string(),
|
|
14395
|
-
outputFormat: string(),
|
|
14396
|
-
createdAtMs: number()
|
|
14397
|
-
})).readonly()),
|
|
14398
|
-
/**
|
|
14399
|
-
* Re-run the host platform-probe for the decoder's hwaccel backend
|
|
14400
|
-
* and write the detected value into the addon's own global
|
|
14401
|
-
* settings (`probedBestHwaccel`). Replaces the legacy per-agent
|
|
14402
|
-
* `pipeline-orchestrator.reprobeAgentHwAccel` — each decoder addon
|
|
14403
|
-
* now owns its own probe.
|
|
14404
|
-
*
|
|
14405
|
-
* Returns the backend the probe picked (`'none'` = software-only
|
|
14406
|
-
* host, otherwise one of `HwAccelBackend`). The operator's
|
|
14407
|
-
* `hwaccel` setting (auto / none / backend) is not touched; only
|
|
14408
|
-
* the `probedBestHwaccel` hint.
|
|
14409
|
-
*/
|
|
14410
|
-
reprobeHwaccel: method(_void(), object({ backend: string() }), {
|
|
14411
|
-
kind: "mutation",
|
|
14412
|
-
auth: "admin"
|
|
14413
|
-
})
|
|
14414
|
-
}
|
|
14415
|
-
};
|
|
14289
|
+
method(object({ codec: string() }), boolean()), method(_void(), object({
|
|
14290
|
+
id: string(),
|
|
14291
|
+
name: string(),
|
|
14292
|
+
isPullMode: boolean().optional(),
|
|
14293
|
+
priority: number().optional()
|
|
14294
|
+
})), method(DecoderSessionConfigSchema, object({
|
|
14295
|
+
sessionId: string(),
|
|
14296
|
+
nodeId: string()
|
|
14297
|
+
})), method(object({ sessionId: string() }), _void()), method(object({
|
|
14298
|
+
sessionId: string(),
|
|
14299
|
+
packet: EncodedPacketSchema
|
|
14300
|
+
}), _void()), method(object({
|
|
14301
|
+
sessionId: string(),
|
|
14302
|
+
url: string()
|
|
14303
|
+
}), _void()), method(object({
|
|
14304
|
+
sessionId: string(),
|
|
14305
|
+
maxCount: number().default(1),
|
|
14306
|
+
waitMs: number().optional()
|
|
14307
|
+
}), array(DecodedFrameSchema)), method(object({
|
|
14308
|
+
sessionId: string(),
|
|
14309
|
+
maxCount: number().default(1),
|
|
14310
|
+
waitMs: number().optional()
|
|
14311
|
+
}), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
|
|
14312
|
+
sessionId: string(),
|
|
14313
|
+
config: DecoderSessionConfigSchema.partial()
|
|
14314
|
+
}), _void()), method(object({ sessionId: string() }), DecoderStatsSchema), method(_void(), array(object({
|
|
14315
|
+
sessionId: string(),
|
|
14316
|
+
codec: string(),
|
|
14317
|
+
outputFormat: string(),
|
|
14318
|
+
createdAtMs: number()
|
|
14319
|
+
})).readonly()), method(_void(), object({ backend: string() }), {
|
|
14320
|
+
kind: "mutation",
|
|
14321
|
+
auth: "admin"
|
|
14322
|
+
});
|
|
14416
14323
|
/**
|
|
14417
14324
|
* detection-pipeline — device-scoped facade over the system
|
|
14418
14325
|
* `pipeline-executor`.
|
|
@@ -24380,12 +24287,6 @@ Object.defineProperty(exports, "DEFAULT_AUDIO_ANALYZER_CONFIG", {
|
|
|
24380
24287
|
return DEFAULT_AUDIO_ANALYZER_CONFIG;
|
|
24381
24288
|
}
|
|
24382
24289
|
});
|
|
24383
|
-
Object.defineProperty(exports, "DEFAULT_DECODER_HWACCEL_CONFIG", {
|
|
24384
|
-
enumerable: true,
|
|
24385
|
-
get: function() {
|
|
24386
|
-
return DEFAULT_DECODER_HWACCEL_CONFIG;
|
|
24387
|
-
}
|
|
24388
|
-
});
|
|
24389
24290
|
Object.defineProperty(exports, "DeviceFeature", {
|
|
24390
24291
|
enumerable: true,
|
|
24391
24292
|
get: function() {
|
|
@@ -24422,12 +24323,6 @@ Object.defineProperty(exports, "HF_BASE_URL", {
|
|
|
24422
24323
|
return HF_BASE_URL;
|
|
24423
24324
|
}
|
|
24424
24325
|
});
|
|
24425
|
-
Object.defineProperty(exports, "HWACCEL_OPTIONS", {
|
|
24426
|
-
enumerable: true,
|
|
24427
|
-
get: function() {
|
|
24428
|
-
return HWACCEL_OPTIONS;
|
|
24429
|
-
}
|
|
24430
|
-
});
|
|
24431
24326
|
Object.defineProperty(exports, "RecordingConfigSchema", {
|
|
24432
24327
|
enumerable: true,
|
|
24433
24328
|
get: function() {
|
|
@@ -24506,12 +24401,6 @@ Object.defineProperty(exports, "customAction", {
|
|
|
24506
24401
|
return customAction;
|
|
24507
24402
|
}
|
|
24508
24403
|
});
|
|
24509
|
-
Object.defineProperty(exports, "decoderCapability", {
|
|
24510
|
-
enumerable: true,
|
|
24511
|
-
get: function() {
|
|
24512
|
-
return decoderCapability;
|
|
24513
|
-
}
|
|
24514
|
-
});
|
|
24515
24404
|
Object.defineProperty(exports, "defaultDeviceFor", {
|
|
24516
24405
|
enumerable: true,
|
|
24517
24406
|
get: function() {
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
5
|
+
const require_dist = require("../dist-BZBQc2QZ.js");
|
|
6
6
|
let _camstack_shm_ring = require("@camstack/shm-ring");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as motionDetectionCapability, R as BaseAddon, S as evaluateZoneRules, V as DeviceType, W as hydrateSchema } from "../dist-BESCfHIV.mjs";
|
|
2
2
|
import { FrameRingReaderCache } from "@camstack/shm-ring";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
6
|
-
const require_frame_handle_plane = require("../frame-handle-plane-
|
|
5
|
+
const require_dist = require("../dist-BZBQc2QZ.js");
|
|
6
|
+
const require_frame_handle_plane = require("../frame-handle-plane-ChjxN8oI.js");
|
|
7
7
|
const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
|
|
8
8
|
let _camstack_shm_ring = require("@camstack/shm-ring");
|
|
9
9
|
//#region src/pipeline-runner/bench-actions.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as FrameHandlePlane } from "../frame-handle-plane-
|
|
1
|
+
import { $ as boolean, A as pipelineRunnerCapability, H as EventCategory, K as makeSourceBrokerId, L as errMsg, O as nodePin, Q as array, R as BaseAddon, U as createEvent, Z as _enum, b as defineCustomActions, it as object, ot as string, rt as number, tt as lazy, v as customAction } from "../dist-BESCfHIV.mjs";
|
|
2
|
+
import { t as FrameHandlePlane } from "../frame-handle-plane-CYtnVPIg.mjs";
|
|
3
3
|
import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
|
|
4
4
|
import { FrameRingReaderCache } from "@camstack/shm-ring";
|
|
5
5
|
//#region src/pipeline-runner/bench-actions.ts
|
package/dist/recorder/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_model_download_service_C_IHWnXx = require("../model-download-service-C-IHWnXx-DxM2DSns.js");
|
|
2
|
-
const require_dist = require("../dist-
|
|
2
|
+
const require_dist = require("../dist-BZBQc2QZ.js");
|
|
3
3
|
const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_path = require("node:path");
|
package/dist/recorder/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as migrateConfigToBands, H as EventCategory, L as errMsg, N as storageEvictableCapability, R as BaseAddon, V as DeviceType, W as hydrateSchema, Y as selectAssignedProfileSlots, at as record, j as recordingCapability, ot as string, s as EVENT_PAD_MS, u as RecordingConfigSchema } from "../dist-BESCfHIV.mjs";
|
|
2
2
|
import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
|
|
3
3
|
import { t as createFileDataPlaneHandler } from "../model-download-service-C-IHWnXx-BPy6aoAx.mjs";
|
|
4
4
|
import { promises } from "node:fs";
|
|
@@ -18,7 +18,7 @@ var e = {
|
|
|
18
18
|
},
|
|
19
19
|
"@camstack/types": {
|
|
20
20
|
name: "@camstack/types",
|
|
21
|
-
version: "1.1.
|
|
21
|
+
version: "1.1.27",
|
|
22
22
|
scope: ["default"],
|
|
23
23
|
loaded: !1,
|
|
24
24
|
from: "addon_stream_broker_widgets",
|
|
@@ -33,7 +33,7 @@ var e = {
|
|
|
33
33
|
},
|
|
34
34
|
"@camstack/ui-library": {
|
|
35
35
|
name: "@camstack/ui-library",
|
|
36
|
-
version: "1.1.
|
|
36
|
+
version: "1.1.23",
|
|
37
37
|
scope: ["default"],
|
|
38
38
|
loaded: !1,
|
|
39
39
|
from: "addon_stream_broker_widgets",
|
|
@@ -36,7 +36,7 @@ async function r() {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"@camstack/types": {
|
|
39
|
-
version: "1.1.
|
|
39
|
+
version: "1.1.27",
|
|
40
40
|
scope: "default",
|
|
41
41
|
shareConfig: {
|
|
42
42
|
singleton: !0,
|
|
@@ -81,7 +81,7 @@ async function r() {
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"@camstack/ui-library": {
|
|
84
|
-
version: "1.1.
|
|
84
|
+
version: "1.1.23",
|
|
85
85
|
scope: "default",
|
|
86
86
|
shareConfig: {
|
|
87
87
|
singleton: !0,
|
|
@@ -3,10 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_model_download_service_C_IHWnXx = require("../model-download-service-C-IHWnXx-DxM2DSns.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
7
|
-
const require_frame_handle_plane = require("../frame-handle-plane-
|
|
8
|
-
const require_ffmpeg_args = require("../ffmpeg-args-Dl9mLcOC.js");
|
|
9
|
-
const require_frame_dropper = require("../frame-dropper-DKLM6pMz.js");
|
|
6
|
+
const require_dist = require("../dist-BZBQc2QZ.js");
|
|
7
|
+
const require_frame_handle_plane = require("../frame-handle-plane-ChjxN8oI.js");
|
|
10
8
|
let node_crypto = require("node:crypto");
|
|
11
9
|
node_crypto = require_model_download_service_C_IHWnXx.__toESM(node_crypto);
|
|
12
10
|
let node_fs = require("node:fs");
|
|
@@ -2264,6 +2262,35 @@ var WEBRTC_FALLBACK_PROFILE = {
|
|
|
2264
2262
|
audio: "passthrough"
|
|
2265
2263
|
};
|
|
2266
2264
|
//#endregion
|
|
2265
|
+
//#region src/stream-broker/stream-broker/ffmpeg-args-common.ts
|
|
2266
|
+
var AUDIO_ENCODER_BY_CODEC = {
|
|
2267
|
+
opus: "libopus",
|
|
2268
|
+
aac: "aac",
|
|
2269
|
+
pcmu: "pcm_mulaw",
|
|
2270
|
+
pcma: "pcm_alaw",
|
|
2271
|
+
copy: "copy"
|
|
2272
|
+
};
|
|
2273
|
+
/**
|
|
2274
|
+
* Build the audio-encode args `-c:a <enc> [-b:a Nk] [-ar N] [-ac N]`. Each knob
|
|
2275
|
+
* is emitted only when provided, in this fixed order — matching what every
|
|
2276
|
+
* broker site already emitted by hand.
|
|
2277
|
+
*/
|
|
2278
|
+
function audioEncoderArgs(codec, opts = {}) {
|
|
2279
|
+
const args = ["-c:a", AUDIO_ENCODER_BY_CODEC[codec]];
|
|
2280
|
+
if (opts.bitrateKbps !== void 0) args.push("-b:a", `${opts.bitrateKbps}k`);
|
|
2281
|
+
if (opts.sampleRateHz !== void 0) args.push("-ar", String(opts.sampleRateHz));
|
|
2282
|
+
if (opts.channels !== void 0) args.push("-ac", String(opts.channels));
|
|
2283
|
+
return args;
|
|
2284
|
+
}
|
|
2285
|
+
/** The `-hide_banner -loglevel <level>` preamble every broker ffmpeg site opens with. */
|
|
2286
|
+
function logBannerArgs(level) {
|
|
2287
|
+
return [
|
|
2288
|
+
"-hide_banner",
|
|
2289
|
+
"-loglevel",
|
|
2290
|
+
level
|
|
2291
|
+
];
|
|
2292
|
+
}
|
|
2293
|
+
//#endregion
|
|
2267
2294
|
//#region src/stream-broker/webrtc/session.ts
|
|
2268
2295
|
var _werift;
|
|
2269
2296
|
async function loadWerift() {
|
|
@@ -2528,7 +2555,7 @@ function planAudioSilencePadPackets(input) {
|
|
|
2528
2555
|
* audio plane honours the profile literally.
|
|
2529
2556
|
*/
|
|
2530
2557
|
function buildTranscodeFfmpegArgs(inputFormat, profile, decodeHwAccel, sourceUrl) {
|
|
2531
|
-
const args = [...
|
|
2558
|
+
const args = [...logBannerArgs("error")];
|
|
2532
2559
|
if (profile.inputArgs?.length) args.push(...profile.inputArgs);
|
|
2533
2560
|
if (decodeHwAccel && decodeHwAccel !== "none") args.push("-hwaccel", decodeHwAccel);
|
|
2534
2561
|
args.push("-fflags", "+discardcorrupt", "-rtsp_transport", "tcp", "-i", sourceUrl);
|
|
@@ -2550,7 +2577,7 @@ function buildTranscodeFfmpegArgs(inputFormat, profile, decodeHwAccel, sourceUrl
|
|
|
2550
2577
|
if (profile.audio === "passthrough") args.push("-an");
|
|
2551
2578
|
else {
|
|
2552
2579
|
const a = profile.audio;
|
|
2553
|
-
args.push(...
|
|
2580
|
+
args.push(...audioEncoderArgs(a.codec, {
|
|
2554
2581
|
bitrateKbps: a.bitrateKbps,
|
|
2555
2582
|
sampleRateHz: a.sampleRateHz,
|
|
2556
2583
|
channels: a.channels
|
|
@@ -5968,23 +5995,23 @@ function localHardwareEncoders(backend) {
|
|
|
5968
5995
|
/** Audio encoder args for a transcode target (preset values over the shared low-level builder). */
|
|
5969
5996
|
function pickAudioEncoderArgs(audio) {
|
|
5970
5997
|
switch (audio) {
|
|
5971
|
-
case "aac": return
|
|
5998
|
+
case "aac": return audioEncoderArgs("aac", {
|
|
5972
5999
|
bitrateKbps: 128,
|
|
5973
6000
|
sampleRateHz: 48e3,
|
|
5974
6001
|
channels: 2
|
|
5975
6002
|
});
|
|
5976
|
-
case "opus": return
|
|
6003
|
+
case "opus": return audioEncoderArgs("opus", {
|
|
5977
6004
|
bitrateKbps: 64,
|
|
5978
6005
|
sampleRateHz: 48e3,
|
|
5979
6006
|
channels: 2
|
|
5980
6007
|
});
|
|
5981
|
-
case "pcmu": return
|
|
6008
|
+
case "pcmu": return audioEncoderArgs("pcmu", {
|
|
5982
6009
|
sampleRateHz: 8e3,
|
|
5983
6010
|
channels: 1
|
|
5984
6011
|
});
|
|
5985
|
-
case "copy": return
|
|
6012
|
+
case "copy": return audioEncoderArgs("copy");
|
|
5986
6013
|
case "none": return ["-an"];
|
|
5987
|
-
default: return
|
|
6014
|
+
default: return audioEncoderArgs("aac", { bitrateKbps: 128 });
|
|
5988
6015
|
}
|
|
5989
6016
|
}
|
|
5990
6017
|
/**
|
|
@@ -6049,7 +6076,7 @@ function buildFfmpegArgs$1(inv) {
|
|
|
6049
6076
|
const threadArgs = inv.threadCount > 0 ? ["-threads", String(inv.threadCount)] : [];
|
|
6050
6077
|
const audioArgs = inv.sink.kind === "stdout" && (inv.sink.container === "h264" || inv.sink.container === "hevc") ? ["-an"] : pickAudioEncoderArgs(inv.audio);
|
|
6051
6078
|
return [
|
|
6052
|
-
...
|
|
6079
|
+
...logBannerArgs("warning"),
|
|
6053
6080
|
...decodeArgs,
|
|
6054
6081
|
"-rtsp_transport",
|
|
6055
6082
|
"tcp",
|
|
@@ -6066,6 +6093,73 @@ function buildFfmpegArgs$1(inv) {
|
|
|
6066
6093
|
];
|
|
6067
6094
|
}
|
|
6068
6095
|
//#endregion
|
|
6096
|
+
//#region src/shared/ffmpeg-decode-args.ts
|
|
6097
|
+
/**
|
|
6098
|
+
* Canonical decode-hwaccel preference order for the ffmpeg-subprocess decoder.
|
|
6099
|
+
*
|
|
6100
|
+
* `vaapi` is ranked ABOVE `qsv` deliberately: on the Intel hub the `qsv` decode
|
|
6101
|
+
* child exits early (`code=171`, no frames) while the `vaapi` path decodes 8MP
|
|
6102
|
+
* h264 cleanly at ~50fps. The kernel probe (`resolveHwAccel`) tends to surface
|
|
6103
|
+
* `qsv` first on Intel, so we re-rank its result through this table before
|
|
6104
|
+
* building the attempt chain. `videotoolbox` leads for macOS; `cuda` / `nvdec`
|
|
6105
|
+
* trail for NVIDIA. A method not listed here keeps its incoming relative order,
|
|
6106
|
+
* placed AFTER every ranked one.
|
|
6107
|
+
*/
|
|
6108
|
+
var DECODE_HWACCEL_RANK = [
|
|
6109
|
+
"videotoolbox",
|
|
6110
|
+
"vaapi",
|
|
6111
|
+
"qsv",
|
|
6112
|
+
"cuda",
|
|
6113
|
+
"nvdec",
|
|
6114
|
+
"d3d11va",
|
|
6115
|
+
"dxva2",
|
|
6116
|
+
"amf",
|
|
6117
|
+
"vdpau",
|
|
6118
|
+
"drm"
|
|
6119
|
+
];
|
|
6120
|
+
/** Rank index for {@link DECODE_HWACCEL_RANK} — unranked methods sort last. */
|
|
6121
|
+
function decodeHwAccelRankIndex(method) {
|
|
6122
|
+
const idx = DECODE_HWACCEL_RANK.indexOf(method.toLowerCase());
|
|
6123
|
+
return idx < 0 ? DECODE_HWACCEL_RANK.length : idx;
|
|
6124
|
+
}
|
|
6125
|
+
/**
|
|
6126
|
+
* Build the ORDERED list of hardware `-hwaccel` methods to attempt for an
|
|
6127
|
+
* `'auto'` decode session, best-first. The session walks this chain on an
|
|
6128
|
+
* early-exit-with-no-frames and only falls to software once it is exhausted.
|
|
6129
|
+
*
|
|
6130
|
+
* Strategy:
|
|
6131
|
+
* - Seed candidates from the kernel-preferred order UNION the canonical rank
|
|
6132
|
+
* UNION the build's supported list, so a method the kernel omitted but the
|
|
6133
|
+
* build supports (the Intel `vaapi` case — kernel surfaces only `qsv`) is
|
|
6134
|
+
* still attempted.
|
|
6135
|
+
* - When the build's supported-method list is known (non-empty), keep only
|
|
6136
|
+
* methods it actually offers; on a probe miss (empty) keep just the kernel
|
|
6137
|
+
* preferences (avoid blindly spawning every backend).
|
|
6138
|
+
* - Re-rank the survivors by {@link DECODE_HWACCEL_RANK} so `vaapi` precedes
|
|
6139
|
+
* `qsv`. A supported method not in the rank table keeps its position AFTER
|
|
6140
|
+
* every ranked one (stable sort). Returns lowercased method names; empty ⇒
|
|
6141
|
+
* pure software.
|
|
6142
|
+
*/
|
|
6143
|
+
function rankDecodeHwAccels(preferred, supportedMethods) {
|
|
6144
|
+
const supported = new Set(supportedMethods.map((m) => m.toLowerCase()));
|
|
6145
|
+
const hasSupportList = supported.size > 0;
|
|
6146
|
+
const pool = hasSupportList ? [
|
|
6147
|
+
...preferred,
|
|
6148
|
+
...DECODE_HWACCEL_RANK,
|
|
6149
|
+
...supportedMethods
|
|
6150
|
+
] : [...preferred];
|
|
6151
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6152
|
+
const candidates = [];
|
|
6153
|
+
for (const raw of pool) {
|
|
6154
|
+
const method = raw.toLowerCase();
|
|
6155
|
+
if (seen.has(method)) continue;
|
|
6156
|
+
seen.add(method);
|
|
6157
|
+
if (hasSupportList && !supported.has(method)) continue;
|
|
6158
|
+
candidates.push(method);
|
|
6159
|
+
}
|
|
6160
|
+
return candidates.sort((a, b) => decodeHwAccelRankIndex(a) - decodeHwAccelRankIndex(b));
|
|
6161
|
+
}
|
|
6162
|
+
//#endregion
|
|
6069
6163
|
//#region src/stream-broker/stream-broker/profile-restreamers.ts
|
|
6070
6164
|
/**
|
|
6071
6165
|
* Diff the desired profile→source aliasing against the current
|
|
@@ -11760,7 +11854,7 @@ var TranscodePipelineManager = class {
|
|
|
11760
11854
|
async resolveHardwareEncoders() {
|
|
11761
11855
|
if (!this.hwaccel) return null;
|
|
11762
11856
|
try {
|
|
11763
|
-
return localHardwareEncoders(
|
|
11857
|
+
return localHardwareEncoders(rankDecodeHwAccels((await this.hwaccel.resolve(null)).preferred, [])[0] ?? null);
|
|
11764
11858
|
} catch (err) {
|
|
11765
11859
|
this.logger.warn("local hardware-encoder resolve failed — software encode fallback", { meta: { error: require_dist.errMsg(err) } });
|
|
11766
11860
|
return null;
|
|
@@ -11800,7 +11894,7 @@ var TranscodePipelineManager = class {
|
|
|
11800
11894
|
async resolveSpecificDecodeHwAccel(prefer) {
|
|
11801
11895
|
if (!this.hwaccel) return null;
|
|
11802
11896
|
try {
|
|
11803
|
-
return
|
|
11897
|
+
return rankDecodeHwAccels((await this.hwaccel.resolve(prefer)).preferred, [])[0] ?? null;
|
|
11804
11898
|
} catch (err) {
|
|
11805
11899
|
this.logger.warn("local decode hw-accel resolve failed — software decode fallback", { meta: { error: require_dist.errMsg(err) } });
|
|
11806
11900
|
return null;
|
|
@@ -12401,7 +12495,7 @@ var StreamBrokerManager = class {
|
|
|
12401
12495
|
];
|
|
12402
12496
|
if (!this.hwaccel) return always;
|
|
12403
12497
|
try {
|
|
12404
|
-
const probed =
|
|
12498
|
+
const probed = rankDecodeHwAccels((await this.hwaccel.resolve(null)).preferred, []).filter((m) => FFMPEG_HW_ACCEL_SETTINGS.includes(m));
|
|
12405
12499
|
return [...always, ...probed];
|
|
12406
12500
|
} catch (err) {
|
|
12407
12501
|
this.logger.warn("getHwAccelOptions: local hwaccel resolve failed — static options only", { meta: { error: require_dist.errMsg(err) } });
|
|
@@ -17413,7 +17507,7 @@ var StreamBrokerAddon = class extends require_dist.BaseAddon {
|
|
|
17413
17507
|
if (strategy.kind === "software") return null;
|
|
17414
17508
|
const resolver = this.ctx.kernel.hwaccel;
|
|
17415
17509
|
if (!resolver) return null;
|
|
17416
|
-
return
|
|
17510
|
+
return rankDecodeHwAccels((await resolver.resolve(strategy.prefer)).preferred, [])[0] ?? null;
|
|
17417
17511
|
} catch (err) {
|
|
17418
17512
|
this.ctx.logger.warn("resolveTranscodeDecodeHwAccel failed — software decode", { meta: { error: require_dist.errMsg(err) } });
|
|
17419
17513
|
return null;
|
|
@@ -17947,6 +18041,27 @@ var StreamBrokerAddon = class extends require_dist.BaseAddon {
|
|
|
17947
18041
|
}
|
|
17948
18042
|
};
|
|
17949
18043
|
//#endregion
|
|
18044
|
+
//#region src/stream-broker/stream-broker/frame-dropper.ts
|
|
18045
|
+
var FrameDropper = class {
|
|
18046
|
+
intervalMs;
|
|
18047
|
+
lastPassedAt = -Infinity;
|
|
18048
|
+
constructor(maxFps) {
|
|
18049
|
+
this.intervalMs = maxFps > 0 ? 1e3 / maxFps : 0;
|
|
18050
|
+
}
|
|
18051
|
+
shouldKeep() {
|
|
18052
|
+
if (this.intervalMs === 0) return true;
|
|
18053
|
+
const now = Date.now();
|
|
18054
|
+
if (now - this.lastPassedAt >= this.intervalMs) {
|
|
18055
|
+
this.lastPassedAt = now;
|
|
18056
|
+
return true;
|
|
18057
|
+
}
|
|
18058
|
+
return false;
|
|
18059
|
+
}
|
|
18060
|
+
setMaxFps(maxFps) {
|
|
18061
|
+
this.intervalMs = maxFps > 0 ? 1e3 / maxFps : 0;
|
|
18062
|
+
}
|
|
18063
|
+
};
|
|
18064
|
+
//#endregion
|
|
17950
18065
|
//#region src/stream-broker/stream-broker/ffmpeg-decoder-session.ts
|
|
17951
18066
|
/** Minimal no-op logger for default parameter */
|
|
17952
18067
|
var noopLogger = {
|
|
@@ -17974,7 +18089,7 @@ function codecToInputFormat(codec) {
|
|
|
17974
18089
|
function buildFfmpegArgs(config) {
|
|
17975
18090
|
const inputFormat = codecToInputFormat(config.codec);
|
|
17976
18091
|
const args = [
|
|
17977
|
-
...
|
|
18092
|
+
...logBannerArgs("error"),
|
|
17978
18093
|
"-fflags",
|
|
17979
18094
|
"+nobuffer+flush_packets",
|
|
17980
18095
|
"-flags",
|
|
@@ -18011,7 +18126,7 @@ var FfmpegDecoderSession = class {
|
|
|
18011
18126
|
constructor(config, logger = noopLogger) {
|
|
18012
18127
|
this.config = { ...config };
|
|
18013
18128
|
this.logger = logger;
|
|
18014
|
-
this.frameDropper = new
|
|
18129
|
+
this.frameDropper = new FrameDropper(config.maxFps);
|
|
18015
18130
|
this.spawnFfmpeg();
|
|
18016
18131
|
}
|
|
18017
18132
|
spawnFfmpeg() {
|