homebridge-plugin-utils 1.34.0 → 2.0.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.
- package/README.md +130 -2
- package/build/eslint-plugin/README.md +164 -0
- package/build/eslint-plugin/config.mjs +308 -0
- package/build/eslint-plugin/index.mjs +7 -0
- package/build/eslint-plugin/plugin.mjs +46 -0
- package/build/eslint-plugin/rules/blank-line-after-open-brace.mjs +137 -0
- package/build/eslint-plugin/rules/blank-line-after-open-brace.test.mjs +112 -0
- package/build/eslint-plugin/rules/comment-style.mjs +190 -0
- package/build/eslint-plugin/rules/comment-style.test.mjs +190 -0
- package/build/eslint-plugin/rules/enforce-node-protocol.mjs +114 -0
- package/build/eslint-plugin/rules/enforce-node-protocol.test.mjs +116 -0
- package/build/eslint-plugin/rules/paren-comparisons-in-logical.mjs +94 -0
- package/build/eslint-plugin/rules/paren-comparisons-in-logical.test.mjs +107 -0
- package/build/eslint-plugin/rules/split-type-imports.mjs +354 -0
- package/build/eslint-plugin/rules/split-type-imports.test.mjs +268 -0
- package/build/eslint-plugin/test-setup.mjs +21 -0
- package/build/fs-ops.mjs +184 -0
- package/build/tsconfig.json +18 -3
- package/dist/backpressure.d.ts +128 -0
- package/dist/backpressure.js +273 -0
- package/dist/backpressure.js.map +1 -0
- package/dist/cli/index.d.ts +95 -0
- package/dist/cli/index.js +355 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/clock-double.d.ts +93 -0
- package/dist/clock-double.js +141 -0
- package/dist/clock-double.js.map +1 -0
- package/dist/clock.d.ts +39 -0
- package/dist/clock.js +34 -0
- package/dist/clock.js.map +1 -0
- package/dist/eslint-plugin/config.d.mts +193 -0
- package/dist/eslint-plugin/index.d.mts +2 -0
- package/dist/eslint-plugin/plugin.d.mts +87 -0
- package/dist/eslint-plugin/rules/blank-line-after-open-brace.d.mts +19 -0
- package/dist/eslint-plugin/rules/comment-style.d.mts +15 -0
- package/dist/eslint-plugin/rules/enforce-node-protocol.d.mts +18 -0
- package/dist/eslint-plugin/rules/paren-comparisons-in-logical.d.mts +15 -0
- package/dist/eslint-plugin/rules/split-type-imports.d.mts +16 -0
- package/dist/featureOptions-docs.d.ts +96 -0
- package/dist/featureOptions-docs.js +193 -0
- package/dist/featureOptions-docs.js.map +1 -0
- package/dist/featureOptions.d.ts +674 -0
- package/dist/featureOptions.js +870 -0
- package/dist/featureOptions.js.map +1 -0
- package/dist/ffmpeg/codecs.d.ts +256 -72
- package/dist/ffmpeg/codecs.js +477 -257
- package/dist/ffmpeg/codecs.js.map +1 -1
- package/dist/ffmpeg/dgram-util.d.ts +46 -0
- package/dist/ffmpeg/dgram-util.js +38 -0
- package/dist/ffmpeg/dgram-util.js.map +1 -0
- package/dist/ffmpeg/exec.d.ts +83 -64
- package/dist/ffmpeg/exec.js +77 -86
- package/dist/ffmpeg/exec.js.map +1 -1
- package/dist/ffmpeg/fmp4.d.ts +70 -4
- package/dist/ffmpeg/fmp4.js +100 -11
- package/dist/ffmpeg/fmp4.js.map +1 -1
- package/dist/ffmpeg/hap-enums.d.ts +214 -0
- package/dist/ffmpeg/hap-enums.js +92 -0
- package/dist/ffmpeg/hap-enums.js.map +1 -0
- package/dist/ffmpeg/index.d.ts +16 -9
- package/dist/ffmpeg/index.js +6 -0
- package/dist/ffmpeg/index.js.map +1 -1
- package/dist/ffmpeg/mp4-assembler.d.ts +120 -0
- package/dist/ffmpeg/mp4-assembler.js +387 -0
- package/dist/ffmpeg/mp4-assembler.js.map +1 -0
- package/dist/ffmpeg/mp4-parser.d.ts +94 -0
- package/dist/ffmpeg/mp4-parser.js +130 -0
- package/dist/ffmpeg/mp4-parser.js.map +1 -0
- package/dist/ffmpeg/options.d.ts +62 -149
- package/dist/ffmpeg/options.js +608 -499
- package/dist/ffmpeg/options.js.map +1 -1
- package/dist/ffmpeg/process.d.ts +143 -91
- package/dist/ffmpeg/process.js +406 -265
- package/dist/ffmpeg/process.js.map +1 -1
- package/dist/ffmpeg/record.d.ts +302 -188
- package/dist/ffmpeg/record.js +408 -560
- package/dist/ffmpeg/record.js.map +1 -1
- package/dist/ffmpeg/recording-process-double.d.ts +144 -0
- package/dist/ffmpeg/recording-process-double.js +168 -0
- package/dist/ffmpeg/recording-process-double.js.map +1 -0
- package/dist/ffmpeg/rtp-parser.d.ts +70 -0
- package/dist/ffmpeg/rtp-parser.js +77 -0
- package/dist/ffmpeg/rtp-parser.js.map +1 -0
- package/dist/ffmpeg/rtp.d.ts +198 -141
- package/dist/ffmpeg/rtp.js +473 -244
- package/dist/ffmpeg/rtp.js.map +1 -1
- package/dist/ffmpeg/settings.d.ts +5 -1
- package/dist/ffmpeg/settings.js +20 -2
- package/dist/ffmpeg/settings.js.map +1 -1
- package/dist/ffmpeg/stream.d.ts +57 -107
- package/dist/ffmpeg/stream.js +121 -148
- package/dist/ffmpeg/stream.js.map +1 -1
- package/dist/formatters.d.ts +106 -0
- package/dist/formatters.js +174 -0
- package/dist/formatters.js.map +1 -0
- package/dist/homebridge-enums.d.ts +30 -0
- package/dist/homebridge-enums.js +17 -0
- package/dist/homebridge-enums.js.map +1 -0
- package/dist/index.d.ts +12 -5
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/logclient/auth.d.ts +114 -0
- package/dist/logclient/auth.js +199 -0
- package/dist/logclient/auth.js.map +1 -0
- package/dist/logclient/cli-run.d.ts +76 -0
- package/dist/logclient/cli-run.js +639 -0
- package/dist/logclient/cli-run.js.map +1 -0
- package/dist/logclient/cli.d.ts +3 -0
- package/dist/logclient/cli.js +97 -0
- package/dist/logclient/cli.js.map +1 -0
- package/dist/logclient/client.d.ts +145 -0
- package/dist/logclient/client.js +600 -0
- package/dist/logclient/client.js.map +1 -0
- package/dist/logclient/config.d.ts +173 -0
- package/dist/logclient/config.js +199 -0
- package/dist/logclient/config.js.map +1 -0
- package/dist/logclient/endpoints.d.ts +54 -0
- package/dist/logclient/endpoints.js +73 -0
- package/dist/logclient/endpoints.js.map +1 -0
- package/dist/logclient/filter.d.ts +45 -0
- package/dist/logclient/filter.js +51 -0
- package/dist/logclient/filter.js.map +1 -0
- package/dist/logclient/frame.d.ts +93 -0
- package/dist/logclient/frame.js +203 -0
- package/dist/logclient/frame.js.map +1 -0
- package/dist/logclient/index.d.ts +31 -0
- package/dist/logclient/index.js +12 -0
- package/dist/logclient/index.js.map +1 -0
- package/dist/logclient/parser.d.ts +211 -0
- package/dist/logclient/parser.js +393 -0
- package/dist/logclient/parser.js.map +1 -0
- package/dist/logclient/rest.d.ts +41 -0
- package/dist/logclient/rest.js +111 -0
- package/dist/logclient/rest.js.map +1 -0
- package/dist/logclient/settings.d.ts +15 -0
- package/dist/logclient/settings.js +64 -0
- package/dist/logclient/settings.js.map +1 -0
- package/dist/logclient/socket-double.d.ts +201 -0
- package/dist/logclient/socket-double.js +384 -0
- package/dist/logclient/socket-double.js.map +1 -0
- package/dist/logclient/socket.d.ts +257 -0
- package/dist/logclient/socket.js +620 -0
- package/dist/logclient/socket.js.map +1 -0
- package/dist/logclient/stitch.d.ts +83 -0
- package/dist/logclient/stitch.js +146 -0
- package/dist/logclient/stitch.js.map +1 -0
- package/dist/logclient/time-expression.d.ts +42 -0
- package/dist/logclient/time-expression.js +181 -0
- package/dist/logclient/time-expression.js.map +1 -0
- package/dist/logclient/time-window.d.ts +38 -0
- package/dist/logclient/time-window.js +53 -0
- package/dist/logclient/time-window.js.map +1 -0
- package/dist/logclient/types.d.ts +107 -0
- package/dist/logclient/types.js +6 -0
- package/dist/logclient/types.js.map +1 -0
- package/dist/mqttClient.d.ts +287 -0
- package/dist/mqttClient.js +433 -0
- package/dist/mqttClient.js.map +1 -0
- package/dist/service.d.ts +64 -15
- package/dist/service.js +93 -66
- package/dist/service.js.map +1 -1
- package/dist/ui/featureOptions.js +870 -0
- package/dist/ui/featureOptions.js.map +1 -0
- package/dist/ui/formatters.js +174 -0
- package/dist/ui/formatters.js.map +1 -0
- package/dist/ui/pluginConfigSession.mjs +141 -0
- package/dist/ui/webUi-featureOptions/categoryState.mjs +135 -0
- package/dist/ui/webUi-featureOptions/effects/keyboard.mjs +61 -0
- package/dist/ui/webUi-featureOptions/effects/persist.mjs +226 -0
- package/dist/ui/webUi-featureOptions/effects/theme.mjs +398 -0
- package/dist/ui/webUi-featureOptions/effects/tokens.mjs +152 -0
- package/dist/ui/webUi-featureOptions/rendering.mjs +431 -0
- package/dist/ui/webUi-featureOptions/selectors.mjs +360 -0
- package/dist/ui/webUi-featureOptions/state.mjs +319 -0
- package/dist/ui/webUi-featureOptions/store.mjs +181 -0
- package/dist/ui/webUi-featureOptions/utils.mjs +200 -0
- package/dist/ui/webUi-featureOptions/views/connectionError.mjs +152 -0
- package/dist/ui/webUi-featureOptions/views/deviceInfo.mjs +80 -0
- package/dist/ui/webUi-featureOptions/views/header.mjs +77 -0
- package/dist/ui/webUi-featureOptions/views/nav.mjs +327 -0
- package/dist/ui/webUi-featureOptions/views/options.mjs +521 -0
- package/dist/ui/webUi-featureOptions/views/search.mjs +395 -0
- package/dist/ui/webUi-featureOptions.mjs +677 -0
- package/dist/ui/webUi.mjs +192 -87
- package/dist/util.d.ts +597 -45
- package/dist/util.js +787 -68
- package/dist/util.js.map +1 -1
- package/package.json +33 -15
- package/build/eslint-rules.mjs +0 -511
- package/dist/featureoptions.d.ts +0 -264
- package/dist/featureoptions.js +0 -480
- package/dist/featureoptions.js.map +0 -1
- package/dist/mqttclient.d.ts +0 -178
- package/dist/mqttclient.js +0 -310
- package/dist/mqttclient.js.map +0 -1
- package/dist/ui/featureoptions.js +0 -480
- package/dist/ui/featureoptions.js.map +0 -1
- package/dist/ui/webUi-featureoptions.mjs +0 -3765
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../src/ffmpeg/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,SAAS,C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AO,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QAEvF,aAAa,CAAC,MAAM,CAAC,CAAC;QAEtB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAM,KAAK,EAAE,CAAC;QAEd,MAAM,SAAS,GAAG,KAAsB,CAAC;QAEzC,IAAG,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAE/B,GAAG,CAAC,KAAK,CAAC,oCAAoC,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;YAEtE,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,IAAG,cAAc,EAAE,CAAC;YAEzB,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,CAAC;YAEN,GAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QACpF,CAAC;QAED,GAAG,CAAC,KAAK,CAAC,kJAAkJ,EAC1J,OAAO,CAAC,CAAC;QAEX,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the `"ipv4"` / `"ipv6"` -> `node:dgram` translations the FFmpeg subsystem needs.
|
|
3
|
+
*
|
|
4
|
+
* Every call site in the FFmpeg subsystem that needs the ipFamily -> node:dgram translation routes through the table lookups exported here, rather than
|
|
5
|
+
* hand-rolling `ipFamily === "ipv6" ? "udp6" : "udp4"` or `isIPv6 ? "::1" : "127.0.0.1"` inline. Keeping the mapping centralized means a future addition
|
|
6
|
+
* (dual-stack socket types, SO_REUSEADDR flags, alternative loopback addresses in constrained test environments) has exactly one file to update, and
|
|
7
|
+
* consumers - production or test - share the same vocabulary.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { Socket } from "node:dgram";
|
|
12
|
+
/**
|
|
13
|
+
* The two IP families the FFmpeg subsystem supports. Centralized here so consumers in `rtp.ts`, `stream.ts`, and the test fixtures share the same union rather than
|
|
14
|
+
* re-declaring inline unions at every init-type boundary.
|
|
15
|
+
*
|
|
16
|
+
* @category FFmpeg
|
|
17
|
+
*/
|
|
18
|
+
export type IpFamily = "ipv4" | "ipv6";
|
|
19
|
+
declare const LOOPBACK_ADDRESS: {
|
|
20
|
+
readonly ipv4: "127.0.0.1";
|
|
21
|
+
readonly ipv6: "::1";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the loopback address string for the supplied IP family. The returned literal is suitable for passing to `socket.bind(port, address)` or
|
|
25
|
+
* `socket.send(..., address, ...)`.
|
|
26
|
+
*
|
|
27
|
+
* @param ipFamily - The IP family to resolve.
|
|
28
|
+
*
|
|
29
|
+
* @returns `"127.0.0.1"` for `"ipv4"` or `"::1"` for `"ipv6"`.
|
|
30
|
+
*
|
|
31
|
+
* @category FFmpeg
|
|
32
|
+
*/
|
|
33
|
+
export declare function loopbackAddress(ipFamily: IpFamily): (typeof LOOPBACK_ADDRESS)[IpFamily];
|
|
34
|
+
/**
|
|
35
|
+
* Create a `node:dgram` socket for the supplied IP family. Equivalent to `createSocket("udp4")` / `createSocket("udp6")` but routes the family -> socket-type lookup
|
|
36
|
+
* through the single table above, so every call site shares one mapping.
|
|
37
|
+
*
|
|
38
|
+
* @param ipFamily - The IP family for the new socket.
|
|
39
|
+
*
|
|
40
|
+
* @returns A fresh unbound {@link Socket}.
|
|
41
|
+
*
|
|
42
|
+
* @category FFmpeg
|
|
43
|
+
*/
|
|
44
|
+
export declare function createDgramSocket(ipFamily: IpFamily): Socket;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=dgram-util.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* Copyright(C) 2017-2026, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* ffmpeg/dgram-util.ts: Shared UDP socket helpers and IP-family translation tables for the FFmpeg subsystem.
|
|
4
|
+
*/
|
|
5
|
+
import { createSocket } from "node:dgram";
|
|
6
|
+
// `node:dgram` socket-type strings keyed by IP family. The union is narrowed by the `as const` so downstream types (e.g., the parameter to `createSocket`) retain
|
|
7
|
+
// the literal types `"udp4"` / `"udp6"` through the lookup.
|
|
8
|
+
const DGRAM_SOCKET_TYPE = { ipv4: "udp4", ipv6: "udp6" };
|
|
9
|
+
// Loopback addresses keyed by IP family. Note that `"::1"` is the IPv6 loopback specifically, not the any-address form - sockets bound here accept only local-host
|
|
10
|
+
// traffic, which matches every current consumer's intent (health probes, port reservations, test fixtures).
|
|
11
|
+
const LOOPBACK_ADDRESS = { ipv4: "127.0.0.1", ipv6: "::1" };
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the loopback address string for the supplied IP family. The returned literal is suitable for passing to `socket.bind(port, address)` or
|
|
14
|
+
* `socket.send(..., address, ...)`.
|
|
15
|
+
*
|
|
16
|
+
* @param ipFamily - The IP family to resolve.
|
|
17
|
+
*
|
|
18
|
+
* @returns `"127.0.0.1"` for `"ipv4"` or `"::1"` for `"ipv6"`.
|
|
19
|
+
*
|
|
20
|
+
* @category FFmpeg
|
|
21
|
+
*/
|
|
22
|
+
export function loopbackAddress(ipFamily) {
|
|
23
|
+
return LOOPBACK_ADDRESS[ipFamily];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a `node:dgram` socket for the supplied IP family. Equivalent to `createSocket("udp4")` / `createSocket("udp6")` but routes the family -> socket-type lookup
|
|
27
|
+
* through the single table above, so every call site shares one mapping.
|
|
28
|
+
*
|
|
29
|
+
* @param ipFamily - The IP family for the new socket.
|
|
30
|
+
*
|
|
31
|
+
* @returns A fresh unbound {@link Socket}.
|
|
32
|
+
*
|
|
33
|
+
* @category FFmpeg
|
|
34
|
+
*/
|
|
35
|
+
export function createDgramSocket(ipFamily) {
|
|
36
|
+
return createSocket(DGRAM_SOCKET_TYPE[ipFamily]);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=dgram-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dgram-util.js","sourceRoot":"","sources":["../../src/ffmpeg/dgram-util.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAU1C,kKAAkK;AAClK,4DAA4D;AAC5D,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAW,CAAC;AAElE,mKAAmK;AACnK,4GAA4G;AAC5G,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAW,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,QAAkB;IAEhD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkB;IAElD,OAAO,YAAY,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/ffmpeg/exec.d.ts
CHANGED
|
@@ -1,108 +1,127 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* One-shot FFmpeg execution with composed signal lifetime.
|
|
3
3
|
*
|
|
4
|
-
* This module
|
|
5
|
-
*
|
|
4
|
+
* This module defines `FfmpegExec`, the specialization of {@link FfmpegProcess} for the "feed a buffer, collect output, get an exit code" shape. Construction spawns
|
|
5
|
+
* the child immediately (per the base class's spawn-on-construction contract); the composed `this.signal` governs its lifetime. The class narrows the inherited public
|
|
6
|
+
* `stdout` to `never` because stdout is drained internally into {@link FfmpegExec.stdoutBuffer} and a concurrent external reader would race.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
* transcoding, or automation tasks—while still benefiting from structured result handling and robust error logging.
|
|
8
|
+
* Two usage shapes:
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* - **Canned input.** Pass `stdin: Buffer` in the init options. The buffer is written to FFmpeg's stdin and the stream is ended on the next microtask after spawn, so
|
|
11
|
+
* one-liner callers do not have to touch the stdin stream at all.
|
|
12
|
+
* - **Streaming input.** Omit the `stdin` init option and use the inherited `stdin` writable directly. Call `exec.stdin.end()` when done.
|
|
11
13
|
*
|
|
12
|
-
*
|
|
13
|
-
* - Capture stdout, stderr, and exit codes as structured results.
|
|
14
|
-
* - Optional stdin data injection.
|
|
15
|
-
* - Configurable error logging.
|
|
14
|
+
* Both patterns converge on {@link FfmpegExec.result}, which bundles the collected stdout, exit code, exit signal, and accumulated stderr log.
|
|
16
15
|
*
|
|
17
16
|
* @module
|
|
18
17
|
*/
|
|
19
|
-
import type { FfmpegOptions } from "./options.
|
|
20
|
-
import { FfmpegProcess } from "./process.
|
|
21
|
-
import type {
|
|
18
|
+
import type { FfmpegOptions } from "./options.ts";
|
|
19
|
+
import { FfmpegProcess } from "./process.ts";
|
|
20
|
+
import type { FfmpegProcessInit } from "./process.ts";
|
|
21
|
+
import type { Nullable } from "../util.ts";
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Construction-time options for {@link FfmpegExec}.
|
|
24
24
|
*
|
|
25
|
-
* @property
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* @property stdin - Optional. When provided, the buffer is written to FFmpeg's standard input and the stream is ended on the next microtask after spawn. Covers the
|
|
26
|
+
* overwhelmingly common "feed this buffer, get stdout back" pattern without forcing callers to reach for the streaming-stdin API. Omit to drive
|
|
27
|
+
* stdin manually via the inherited `stdin` writable.
|
|
28
|
+
*
|
|
29
|
+
* @see FfmpegProcessInit
|
|
30
|
+
*
|
|
31
|
+
* @category FFmpeg
|
|
32
|
+
*/
|
|
33
|
+
export interface FfmpegExecInit extends FfmpegProcessInit {
|
|
34
|
+
stdin?: Buffer;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Structured result returned by {@link FfmpegExec.result}.
|
|
38
|
+
*
|
|
39
|
+
* @property exitCode - The process exit code, or `null` when the process was terminated by a signal.
|
|
40
|
+
* @property exitSignal - The signal name (e.g., `"SIGKILL"`) that terminated the process, or `null` when the process exited normally.
|
|
41
|
+
* @property stderrLog - A snapshot of the accumulated stderr lines at the moment `exited` resolved. Readonly because {@link FfmpegProcess.stderrLog} itself is
|
|
42
|
+
* readonly and this bundle is a pass-through view rather than an independent copy.
|
|
43
|
+
* @property stdout - The complete stdout bytes collected over the lifetime of the process.
|
|
28
44
|
*
|
|
29
45
|
* @category FFmpeg
|
|
30
46
|
*/
|
|
31
|
-
export interface
|
|
47
|
+
export interface ExecResult {
|
|
32
48
|
exitCode: Nullable<number>;
|
|
33
|
-
|
|
49
|
+
exitSignal: Nullable<NodeJS.Signals>;
|
|
50
|
+
stderrLog: readonly string[];
|
|
34
51
|
stdout: Buffer;
|
|
35
52
|
}
|
|
36
53
|
/**
|
|
37
|
-
*
|
|
54
|
+
* One-shot FFmpeg execution. Extends {@link FfmpegProcess} directly, inheriting its spawn-on-construction and signal-driven teardown semantics and adding the small
|
|
55
|
+
* surface that the "feed bytes, read bytes, get exit status" pattern needs.
|
|
56
|
+
*
|
|
57
|
+
* The public `stdout` type is narrowed to `never` via `declare`. Callers read collected output through {@link FfmpegExec.stdoutBuffer} (the raw Buffer) or
|
|
58
|
+
* {@link FfmpegExec.result} (the bundled result with exit context). The narrowing is a type-level contract; pure-JS callers that reach past the types still see the
|
|
59
|
+
* underlying Readable, but a concurrent external reader would race with our internal collector - "do not do that" is the appropriate enforcement bar for a TypeScript
|
|
60
|
+
* library.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
38
63
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
64
|
+
* ```ts
|
|
65
|
+
* // Canned input, one-shot.
|
|
66
|
+
* const exec = new FfmpegExec(options, { args, stdin: inputBuffer, signal });
|
|
67
|
+
* const { exitCode, stdout } = await exec.result();
|
|
68
|
+
* ```
|
|
42
69
|
*
|
|
43
70
|
* @example
|
|
44
71
|
*
|
|
45
72
|
* ```ts
|
|
46
|
-
*
|
|
47
|
-
* const
|
|
73
|
+
* // Streaming input - write stdin progressively before awaiting the result.
|
|
74
|
+
* const exec = new FfmpegExec(options, { args, signal });
|
|
48
75
|
*
|
|
49
|
-
*
|
|
76
|
+
* exec.stdin.write(chunk1);
|
|
77
|
+
* exec.stdin.write(chunk2);
|
|
78
|
+
* exec.stdin.end();
|
|
50
79
|
*
|
|
51
|
-
*
|
|
52
|
-
* }
|
|
80
|
+
* const { exitCode, stdout } = await exec.result();
|
|
53
81
|
* ```
|
|
54
82
|
*
|
|
55
83
|
* @see FfmpegProcess
|
|
56
|
-
* @see {@link https://ffmpeg.org/documentation.html | FFmpeg Documentation}
|
|
57
84
|
*
|
|
58
85
|
* @category FFmpeg
|
|
59
86
|
*/
|
|
60
87
|
export declare class FfmpegExec extends FfmpegProcess {
|
|
61
|
-
private
|
|
88
|
+
#private;
|
|
62
89
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @param options - The options used to configure FFmpeg execution.
|
|
66
|
-
* @param commandLineArgs - Optional. Command-line arguments to pass to the FFmpeg process.
|
|
67
|
-
* @param logErrors - Optional. If `true`, errors will be logged; otherwise, they will be suppressed. Defaults to `true`.
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* const exec = new FfmpegExec(options, ["-i", "input.mp4", "-f", "null", "-"]);
|
|
73
|
-
* ```
|
|
90
|
+
* stdout is consumed internally by the collector loop. The public type is narrowed to `never` so TypeScript callers cannot accidentally attach a second reader.
|
|
74
91
|
*/
|
|
75
|
-
|
|
92
|
+
readonly stdout: never;
|
|
76
93
|
/**
|
|
77
|
-
*
|
|
94
|
+
* Promise that resolves with every byte the child wrote to stdout before its stdout pipe closed. The pipe closes for any reason - natural EOF after a clean exit,
|
|
95
|
+
* abort-driven kill, synthetic stream destroy - and the promise settles the same way: whatever the consumer absorbed before close, byte-for-byte.
|
|
78
96
|
*
|
|
79
|
-
*
|
|
97
|
+
* Resolves with `Buffer.alloc(0)` only when the underlying readable surfaces a stream error (the catch branch in `#collectStdout`); the abort-kill
|
|
98
|
+
* path does not normally produce a stream error, so an aborted run yields whatever bytes happened to arrive before the kill landed - which may be all of them, some
|
|
99
|
+
* of them, or none of them.
|
|
80
100
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
* const exec = new FfmpegExec(options, ["-i", "input.wav", "output.mp3"]);
|
|
89
|
-
* const result = await exec.exec();
|
|
101
|
+
* This promise is the data channel only. To discriminate "the child wrote nothing" from "the run was aborted before the child could write anything," consult
|
|
102
|
+
* {@link FfmpegExec.exited} (`exitCode` / `exitSignal`) and {@link FfmpegProcess.signal} (`signal.reason`). Those are the single source of truth for process
|
|
103
|
+
* disposition; an empty buffer carries no disposition meaning on its own.
|
|
104
|
+
*/
|
|
105
|
+
readonly stdoutBuffer: Promise<Buffer>;
|
|
106
|
+
/**
|
|
107
|
+
* Construct and spawn a new FFmpeg execution.
|
|
90
108
|
*
|
|
91
|
-
*
|
|
109
|
+
* Spawning happens synchronously as part of construction. When `init.stdin` is supplied, the buffer is written to stdin and the stream is ended on the next
|
|
110
|
+
* microtask, giving synchronous post-construction caller code (e.g., attaching a drain listener) a chance to run before stdin I/O begins.
|
|
92
111
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* }
|
|
96
|
-
* ```
|
|
112
|
+
* @param options - Shared {@link FfmpegOptions} configuration (codec support, logger, debug flag, name).
|
|
113
|
+
* @param init - Optional init options. See {@link FfmpegExecInit}.
|
|
97
114
|
*/
|
|
98
|
-
|
|
115
|
+
constructor(options: FfmpegOptions, init?: FfmpegExecInit);
|
|
99
116
|
/**
|
|
100
|
-
*
|
|
117
|
+
* Await the process to completion and return the bundled result.
|
|
101
118
|
*
|
|
102
|
-
*
|
|
119
|
+
* Resolves once both the stdout collector and the base class's `exited` promise settle. Rejects with the same reason `exited` would reject with (today, only when
|
|
120
|
+
* the child never spawned - e.g., ENOENT). On any normal exit, including non-zero exit codes, this method resolves; callers discriminate outcomes by inspecting
|
|
121
|
+
* `exitCode` and `exitSignal` in the result, or the derived `hasError` getter on the instance.
|
|
103
122
|
*
|
|
104
|
-
* @
|
|
105
|
-
* @param signal - The signal used to terminate the process, if any.
|
|
123
|
+
* @returns A promise resolving to an {@link ExecResult} bundling stdout, exit code, exit signal, and the accumulated stderr log.
|
|
106
124
|
*/
|
|
107
|
-
|
|
125
|
+
result(): Promise<ExecResult>;
|
|
108
126
|
}
|
|
127
|
+
//# sourceMappingURL=exec.d.ts.map
|
package/dist/ffmpeg/exec.js
CHANGED
|
@@ -1,123 +1,114 @@
|
|
|
1
1
|
/* Copyright(C) 2017-2026, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
2
2
|
*
|
|
3
|
-
* ffmpeg/exec.ts:
|
|
3
|
+
* ffmpeg/exec.ts: One-shot FFmpeg execution - feed optional stdin, collect stdout, capture exit status.
|
|
4
4
|
*/
|
|
5
5
|
import { FfmpegProcess } from "./process.js";
|
|
6
|
+
import { buffer } from "node:stream/consumers";
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* One-shot FFmpeg execution. Extends {@link FfmpegProcess} directly, inheriting its spawn-on-construction and signal-driven teardown semantics and adding the small
|
|
9
|
+
* surface that the "feed bytes, read bytes, get exit status" pattern needs.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* The public `stdout` type is narrowed to `never` via `declare`. Callers read collected output through {@link FfmpegExec.stdoutBuffer} (the raw Buffer) or
|
|
12
|
+
* {@link FfmpegExec.result} (the bundled result with exit context). The narrowing is a type-level contract; pure-JS callers that reach past the types still see the
|
|
13
|
+
* underlying Readable, but a concurrent external reader would race with our internal collector - "do not do that" is the appropriate enforcement bar for a TypeScript
|
|
14
|
+
* library.
|
|
12
15
|
*
|
|
13
16
|
* @example
|
|
14
17
|
*
|
|
15
18
|
* ```ts
|
|
16
|
-
*
|
|
17
|
-
* const
|
|
19
|
+
* // Canned input, one-shot.
|
|
20
|
+
* const exec = new FfmpegExec(options, { args, stdin: inputBuffer, signal });
|
|
21
|
+
* const { exitCode, stdout } = await exec.result();
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Streaming input - write stdin progressively before awaiting the result.
|
|
28
|
+
* const exec = new FfmpegExec(options, { args, signal });
|
|
18
29
|
*
|
|
19
|
-
*
|
|
30
|
+
* exec.stdin.write(chunk1);
|
|
31
|
+
* exec.stdin.write(chunk2);
|
|
32
|
+
* exec.stdin.end();
|
|
20
33
|
*
|
|
21
|
-
*
|
|
22
|
-
* }
|
|
34
|
+
* const { exitCode, stdout } = await exec.result();
|
|
23
35
|
* ```
|
|
24
36
|
*
|
|
25
37
|
* @see FfmpegProcess
|
|
26
|
-
* @see {@link https://ffmpeg.org/documentation.html | FFmpeg Documentation}
|
|
27
38
|
*
|
|
28
39
|
* @category FFmpeg
|
|
29
40
|
*/
|
|
30
41
|
export class FfmpegExec extends FfmpegProcess {
|
|
31
|
-
isLoggingErrors;
|
|
32
42
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @param options - The options used to configure FFmpeg execution.
|
|
36
|
-
* @param commandLineArgs - Optional. Command-line arguments to pass to the FFmpeg process.
|
|
37
|
-
* @param logErrors - Optional. If `true`, errors will be logged; otherwise, they will be suppressed. Defaults to `true`.
|
|
43
|
+
* Promise that resolves with every byte the child wrote to stdout before its stdout pipe closed. The pipe closes for any reason - natural EOF after a clean exit,
|
|
44
|
+
* abort-driven kill, synthetic stream destroy - and the promise settles the same way: whatever the consumer absorbed before close, byte-for-byte.
|
|
38
45
|
*
|
|
39
|
-
*
|
|
46
|
+
* Resolves with `Buffer.alloc(0)` only when the underlying readable surfaces a stream error (the catch branch in `#collectStdout`); the abort-kill
|
|
47
|
+
* path does not normally produce a stream error, so an aborted run yields whatever bytes happened to arrive before the kill landed - which may be all of them, some
|
|
48
|
+
* of them, or none of them.
|
|
40
49
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
50
|
+
* This promise is the data channel only. To discriminate "the child wrote nothing" from "the run was aborted before the child could write anything," consult
|
|
51
|
+
* {@link FfmpegExec.exited} (`exitCode` / `exitSignal`) and {@link FfmpegProcess.signal} (`signal.reason`). Those are the single source of truth for process
|
|
52
|
+
* disposition; an empty buffer carries no disposition meaning on its own.
|
|
44
53
|
*/
|
|
45
|
-
|
|
46
|
-
// Initialize our parent.
|
|
47
|
-
super(options, commandLineArgs);
|
|
48
|
-
// We want to log errors when they occur.
|
|
49
|
-
this.isLoggingErrors = logErrors;
|
|
50
|
-
}
|
|
54
|
+
stdoutBuffer;
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* If `stdinData` is provided, it will be written to the process's standard input before execution. Returns `null` if the process fails to start.
|
|
56
|
+
* Construct and spawn a new FFmpeg execution.
|
|
55
57
|
*
|
|
56
|
-
*
|
|
58
|
+
* Spawning happens synchronously as part of construction. When `init.stdin` is supplied, the buffer is written to stdin and the stream is ended on the next
|
|
59
|
+
* microtask, giving synchronous post-construction caller code (e.g., attaching a drain listener) a chance to run before stdin I/O begins.
|
|
57
60
|
*
|
|
58
|
-
* @
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
*
|
|
62
|
-
* ```ts
|
|
63
|
-
* const exec = new FfmpegExec(options, ["-i", "input.wav", "output.mp3"]);
|
|
64
|
-
* const result = await exec.exec();
|
|
65
|
-
*
|
|
66
|
-
* if(result) {
|
|
67
|
-
*
|
|
68
|
-
* console.log("Exit code:", result.exitCode);
|
|
69
|
-
* console.log("FFmpeg output:", result.stdout.toString());
|
|
70
|
-
* }
|
|
71
|
-
* ```
|
|
61
|
+
* @param options - Shared {@link FfmpegOptions} configuration (codec support, logger, debug flag, name).
|
|
62
|
+
* @param init - Optional init options. See {@link FfmpegExecInit}.
|
|
72
63
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.stop();
|
|
64
|
+
constructor(options, init = {}) {
|
|
65
|
+
super(options, init);
|
|
66
|
+
// Drain stdout into an in-memory buffer via Node's `node:stream/consumers` helper. The consumer attaches the necessary listeners and respects internal buffering,
|
|
67
|
+
// so chunks that landed in the paused stream before consumption began are still delivered. The collector is a pure transducer over the readable - it does not
|
|
68
|
+
// observe the lifetime signal, and it deliberately knows nothing about why the readable might close. The disposition of the run lives in `exited` and
|
|
69
|
+
// `signal.reason`; conflating it into the byte content would create a sentinel callers cannot rely on (Node's stream layer cannot deterministically deliver
|
|
70
|
+
// "all-or-nothing" on a kill-driven close). The catch in `#collectStdout` exists only to honor the never-rejects shape on `stdoutBuffer` when the readable
|
|
71
|
+
// surfaces a genuine stream error.
|
|
72
|
+
this.stdoutBuffer = this.#collectStdout();
|
|
73
|
+
// Canned stdin: write and end on the next microtask so synchronous caller code that runs between construction and the first await (e.g., attaching `"drain"` or
|
|
74
|
+
// `"error"` listeners on the inherited `stdin` writable, inspecting `proc.signal`, wiring diagnostic hooks) executes before stdin I/O starts. We guard against a
|
|
75
|
+
// pre-aborted composed signal so we do not write to a stream that the kill path has already destroyed - the write would surface an EPIPE we would then have to
|
|
76
|
+
// swallow. The base class's own stdin error listener already swallows EPIPE generally, so this guard is belt-and-braces, not strictly required for correctness.
|
|
77
|
+
if (init.stdin !== undefined) {
|
|
78
|
+
const stdinBuffer = init.stdin;
|
|
79
|
+
queueMicrotask(() => {
|
|
80
|
+
if (this.aborted) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this._stdin.end(stdinBuffer);
|
|
94
84
|
});
|
|
95
|
-
|
|
96
|
-
this.process.once("exit", (exitCode) => {
|
|
97
|
-
// Return the output and results.
|
|
98
|
-
resolve({
|
|
99
|
-
exitCode,
|
|
100
|
-
stderr: Buffer.concat(stderr),
|
|
101
|
-
stdout: Buffer.concat(stdout)
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
85
|
+
}
|
|
105
86
|
}
|
|
106
87
|
/**
|
|
107
|
-
*
|
|
88
|
+
* Await the process to completion and return the bundled result.
|
|
108
89
|
*
|
|
109
|
-
*
|
|
90
|
+
* Resolves once both the stdout collector and the base class's `exited` promise settle. Rejects with the same reason `exited` would reject with (today, only when
|
|
91
|
+
* the child never spawned - e.g., ENOENT). On any normal exit, including non-zero exit codes, this method resolves; callers discriminate outcomes by inspecting
|
|
92
|
+
* `exitCode` and `exitSignal` in the result, or the derived `hasError` getter on the instance.
|
|
110
93
|
*
|
|
111
|
-
* @
|
|
112
|
-
* @param signal - The signal used to terminate the process, if any.
|
|
94
|
+
* @returns A promise resolving to an {@link ExecResult} bundling stdout, exit code, exit signal, and the accumulated stderr log.
|
|
113
95
|
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
96
|
+
async result() {
|
|
97
|
+
const [stdout, exit] = await Promise.all([this.stdoutBuffer, this.exited]);
|
|
98
|
+
return { exitCode: exit.exitCode, exitSignal: exit.exitSignal, stderrLog: this.stderrLog, stdout };
|
|
99
|
+
}
|
|
100
|
+
// Buffer-collector wrapper around `node:stream/consumers` `buffer()`. The happy path resolves with whatever bytes the consumer absorbed before the readable closed,
|
|
101
|
+
// for any close cause - clean EOF, kill-driven pipe close after abort, anything else. The catch is reserved for the rare path where the readable surfaces a stream
|
|
102
|
+
// error (e.g., a synthetic `readable.destroy(err)` injected by a test, a hardware-level pipe fault); we resolve with `Buffer.alloc(0)` there only to preserve the
|
|
103
|
+
// never-rejects shape on `stdoutBuffer`. Private method rather than an inline `await buffer(...)` because keeping the try/catch in one place preserves that
|
|
104
|
+
// shape across every caller path.
|
|
105
|
+
async #collectStdout() {
|
|
106
|
+
try {
|
|
107
|
+
return await buffer(this._stdout);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return Buffer.alloc(0);
|
|
118
111
|
}
|
|
119
|
-
// Otherwise, revert to our default logging in our parent.
|
|
120
|
-
super.logFfmpegError(exitCode, signal);
|
|
121
112
|
}
|
|
122
113
|
}
|
|
123
114
|
//# sourceMappingURL=exec.js.map
|
package/dist/ffmpeg/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/ffmpeg/exec.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/ffmpeg/exec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAqC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,UAAW,SAAQ,aAAa;IAO3C;;;;;;;;;;;OAWG;IACa,YAAY,CAAkB;IAE9C;;;;;;;;OAQG;IACH,YAAmB,OAAsB,EAAE,OAAuB,EAAE;QAElE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAErB,kKAAkK;QAClK,8JAA8J;QAC9J,sJAAsJ;QACtJ,4JAA4J;QAC5J,2JAA2J;QAC3J,mCAAmC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAA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