homebridge-plugin-utils 1.35.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 +94 -45
- package/dist/backpressure.js +229 -93
- package/dist/backpressure.js.map +1 -1
- 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 -262
- 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 +49 -2
- package/dist/ffmpeg/fmp4.js +47 -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 +142 -96
- package/dist/ffmpeg/process.js +406 -278
- package/dist/ffmpeg/process.js.map +1 -1
- package/dist/ffmpeg/record.d.ts +302 -188
- package/dist/ffmpeg/record.js +408 -567
- 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 -251
- package/dist/ffmpeg/rtp.js.map +1 -1
- package/dist/ffmpeg/settings.d.ts +5 -2
- package/dist/ffmpeg/settings.js +20 -5
- package/dist/ffmpeg/settings.js.map +1 -1
- package/dist/ffmpeg/stream.d.ts +57 -107
- package/dist/ffmpeg/stream.js +121 -150
- 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 -6
- package/dist/index.js +7 -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 +602 -45
- package/dist/util.js +783 -78
- 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
package/dist/ffmpeg/options.d.ts
CHANGED
|
@@ -17,9 +17,22 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import type {
|
|
20
|
+
import type { H264Level as H264LevelEnum, H264Profile as H264ProfileEnum } from "homebridge";
|
|
21
|
+
import { AudioRecordingCodecType } from "./hap-enums.ts";
|
|
22
|
+
import type { FfmpegCodecs } from "./codecs.ts";
|
|
23
|
+
import type { Logger } from "../util.ts";
|
|
24
|
+
declare const H264Level: {
|
|
25
|
+
readonly LEVEL3_1: H264LevelEnum.LEVEL3_1;
|
|
26
|
+
readonly LEVEL3_2: H264LevelEnum.LEVEL3_2;
|
|
27
|
+
readonly LEVEL4_0: H264LevelEnum.LEVEL4_0;
|
|
28
|
+
};
|
|
29
|
+
declare const H264Profile: {
|
|
30
|
+
readonly BASELINE: H264ProfileEnum.BASELINE;
|
|
31
|
+
readonly HIGH: H264ProfileEnum.HIGH;
|
|
32
|
+
readonly MAIN: H264ProfileEnum.MAIN;
|
|
33
|
+
};
|
|
34
|
+
type H264Level = H264LevelEnum;
|
|
35
|
+
type H264Profile = H264ProfileEnum;
|
|
23
36
|
/**
|
|
24
37
|
* Configuration options for `FfmpegOptions`, defining transcoding, decoding, logging, and hardware acceleration settings.
|
|
25
38
|
*
|
|
@@ -66,15 +79,17 @@ export interface FfmpegOptionsConfig {
|
|
|
66
79
|
debug?: boolean;
|
|
67
80
|
hardwareDecoding: boolean;
|
|
68
81
|
hardwareTranscoding: boolean;
|
|
69
|
-
log:
|
|
82
|
+
log: Logger;
|
|
70
83
|
name: () => string;
|
|
71
84
|
}
|
|
72
85
|
/**
|
|
73
|
-
* Options used for configuring
|
|
86
|
+
* Options used for configuring audio encoding in FFmpeg operations.
|
|
74
87
|
*
|
|
75
|
-
*
|
|
88
|
+
* The single field selects the AAC profile that drives encoder-specific arg emission in {@link FfmpegOptions.audioEncoder} - AAC-ELD (the HomeKit Secure Video event-
|
|
89
|
+
* recording default, lower bitrate, low-latency) versus AAC-LC (higher-quality livestream variant). The chosen profile maps to `aac_at` mode switches on macOS and to
|
|
90
|
+
* `libfdk_aac` flags elsewhere.
|
|
76
91
|
*
|
|
77
|
-
* @property codec - Optional.
|
|
92
|
+
* @property codec - Optional. AAC profile to encode (`AudioRecordingCodecType.AAC_ELD` or `AudioRecordingCodecType.AAC_LC`). Defaults to
|
|
78
93
|
* `AudioRecordingCodecType.AAC_ELD`.
|
|
79
94
|
*
|
|
80
95
|
* @example
|
|
@@ -104,14 +119,21 @@ export interface AudioEncoderOptions {
|
|
|
104
119
|
*
|
|
105
120
|
* @property bitrate - Target video bitrate, in kilobits per second.
|
|
106
121
|
* @property fps - Target output frames per second.
|
|
107
|
-
* @property hardwareDecoding - Optional. If `true`, encoder
|
|
122
|
+
* @property hardwareDecoding - Optional. If `true`, the emitted encoder args assume the input stream has already been hardware-decoded (the GPU holds the frames).
|
|
123
|
+
* Used by the transfer-filter logic to decide between `hwupload`, `hwdownload`, or neither. Defaults to the resolved
|
|
124
|
+
* `FfmpegOptionsConfig.hardwareDecoding` value on the owning `FfmpegOptions` instance.
|
|
125
|
+
* @property hardwareTranscoding - Optional. If `true`, the emitted args select a hardware-accelerated encoder (`h264_videotoolbox` / `h264_qsv` / `h264_v4l2m2m`) and
|
|
126
|
+
* the matching filter pipeline. If `false`, the args fall back to the libx264 software encoder. Defaults to the resolved
|
|
127
|
+
* `FfmpegOptionsConfig.hardwareTranscoding` value on the owning `FfmpegOptions` instance.
|
|
108
128
|
* @property height - Output video height, in pixels.
|
|
109
129
|
* @property idrInterval - Interval (in seconds) between keyframes (IDR frames).
|
|
110
130
|
* @property inputFps - Input (source) frames per second.
|
|
111
131
|
* @property level - H.264 profile level for output.
|
|
112
132
|
* @property profile - H.264 profile for output.
|
|
113
|
-
* @property smartQuality - Optional
|
|
114
|
-
*
|
|
133
|
+
* @property smartQuality - Optional. Enables variable-bitrate quality-constrained encoding on encoders that support it - libx264 (`-crf 20`), Apple Silicon
|
|
134
|
+
* VideoToolbox (`-q:v 90`), and Intel QSV (`-global_quality 20`). Intel VideoToolbox and v4l2m2m have no quality-constraint mode and
|
|
135
|
+
* always emit a fixed `-b:v` regardless. In all cases, `smartQuality` also adds `HOMEKIT_STREAMING_HEADROOM` to `-maxrate`, giving the
|
|
136
|
+
* encoder a narrow band of variation above the target bitrate. Defaults to `true`.
|
|
115
137
|
* @property width - Output video width, in pixels.
|
|
116
138
|
*
|
|
117
139
|
* @example
|
|
@@ -155,6 +177,15 @@ export interface VideoEncoderOptions {
|
|
|
155
177
|
smartQuality?: boolean;
|
|
156
178
|
width: number;
|
|
157
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Every hardware-transcode context this module distinguishes, each with a source-pixel ceiling that can differ on a given host. Live streaming and HKSV recording
|
|
182
|
+
* both transcode, but a host may admit one context to its hardware encoder and not the other (today: Raspberry Pi runs live transcoding on h264_v4l2m2m but falls
|
|
183
|
+
* HKSV recording back to libx264). Consumed by `maxSourcePixels` and the `recordEncoder` software-fallback so both derive the same per-context hardware-capability
|
|
184
|
+
* answer from one predicate.
|
|
185
|
+
*
|
|
186
|
+
* @category FFmpeg
|
|
187
|
+
*/
|
|
188
|
+
export type EncoderContext = "record" | "stream";
|
|
158
189
|
/**
|
|
159
190
|
* Provides Homebridge FFmpeg transcoding, decoding, and encoding options, selecting codecs, pixel formats, and hardware acceleration for the host system.
|
|
160
191
|
*
|
|
@@ -194,27 +225,13 @@ export interface VideoEncoderOptions {
|
|
|
194
225
|
* @category FFmpeg
|
|
195
226
|
*/
|
|
196
227
|
export declare class FfmpegOptions {
|
|
228
|
+
#private;
|
|
197
229
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
|
|
201
|
-
readonly codecSupport: FfmpegCodecs;
|
|
202
|
-
/**
|
|
203
|
-
* The configuration options used to initialize this instance.
|
|
230
|
+
* The configuration options used to initialize this instance. This is the single stored state on `FfmpegOptions`: every other public field on this class is either
|
|
231
|
+
* a getter that forwards to `this.config`, or a fixed constant independent of it (`audioDecoder`), so external callers have exactly one canonical path to each
|
|
232
|
+
* config-backed value and internal code never has to keep a parallel field in sync with `config` at construction time.
|
|
204
233
|
*/
|
|
205
234
|
readonly config: FfmpegOptionsConfig;
|
|
206
|
-
/**
|
|
207
|
-
* Indicates if debug logging is enabled.
|
|
208
|
-
*/
|
|
209
|
-
readonly debug: boolean;
|
|
210
|
-
/**
|
|
211
|
-
* Logging interface for output and errors.
|
|
212
|
-
*/
|
|
213
|
-
readonly log: HomebridgePluginLogging | Logging;
|
|
214
|
-
/**
|
|
215
|
-
* Function returning the name for this options instance to be used for logging.
|
|
216
|
-
*/
|
|
217
|
-
readonly name: () => string;
|
|
218
235
|
/**
|
|
219
236
|
* Creates an instance of Homebridge FFmpeg encoding and decoding options.
|
|
220
237
|
*
|
|
@@ -228,50 +245,18 @@ export declare class FfmpegOptions {
|
|
|
228
245
|
*/
|
|
229
246
|
constructor(options: FfmpegOptionsConfig);
|
|
230
247
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* This internal method checks for the availability of hardware codecs and accelerators based on the host platform and updates
|
|
234
|
-
* FFmpeg options to use the best available hardware or falls back to software processing when necessary.
|
|
235
|
-
* It logs warnings or errors if required codecs or hardware acceleration are unavailable.
|
|
236
|
-
*
|
|
237
|
-
* This method is called automatically by the `FfmpegOptions` constructor and is not intended to be called directly.
|
|
238
|
-
*
|
|
239
|
-
* @returns `true` if hardware-accelerated transcoding is enabled after configuration, otherwise `false`.
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
*
|
|
243
|
-
* ```ts
|
|
244
|
-
* // This method is invoked by the FfmpegOptions constructor:
|
|
245
|
-
* const ffmpegOpts = new FfmpegOptions(optionsConfig);
|
|
246
|
-
*
|
|
247
|
-
* // Hardware acceleration configuration occurs automatically.
|
|
248
|
-
* // Developers typically do not need to call configureHwAccel() directly.
|
|
249
|
-
* ```
|
|
250
|
-
*
|
|
251
|
-
* @see FfmpegCodecs
|
|
252
|
-
* @see FfmpegOptions
|
|
248
|
+
* Indicates if debug logging is enabled. Normalizes `undefined` to `false` so callers always see a definite boolean regardless of whether the config object set
|
|
249
|
+
* the field explicitly.
|
|
253
250
|
*/
|
|
254
|
-
|
|
251
|
+
get debug(): boolean;
|
|
255
252
|
/**
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* This method manages the transition between software and hardware processing contexts. When video data needs to move between the CPU and GPU for processing, we
|
|
259
|
-
* provide the appropriate FFmpeg filters to handle that transfer efficiently.
|
|
260
|
-
*
|
|
261
|
-
* @param options - Video encoder options including hardware decoding and transcoding state.
|
|
262
|
-
* @returns Array of filter strings for hardware upload or download operations.
|
|
253
|
+
* Logging interface for output and errors.
|
|
263
254
|
*/
|
|
264
|
-
|
|
255
|
+
get log(): Logger;
|
|
265
256
|
/**
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* When we're using hardware encoding without hardware decoding, we need to initialize the hardware device context explicitly. This method provides the
|
|
269
|
-
* platform-specific initialization arguments required by FFmpeg.
|
|
270
|
-
*
|
|
271
|
-
* @param options - Video encoder options.
|
|
272
|
-
* @returns Array of FFmpeg arguments for hardware device initialization.
|
|
257
|
+
* Function returning the name for this options instance to be used for logging.
|
|
273
258
|
*/
|
|
274
|
-
|
|
259
|
+
get name(): () => string;
|
|
275
260
|
/**
|
|
276
261
|
* Returns the audio encoder arguments to use when transcoding.
|
|
277
262
|
*
|
|
@@ -294,7 +279,8 @@ export declare class FfmpegOptions {
|
|
|
294
279
|
/**
|
|
295
280
|
* Returns the video decoder arguments to use for decoding video.
|
|
296
281
|
*
|
|
297
|
-
* @param codec - Optional. Codec to decode (`"av1"`, `"h264"` (default), or `"hevc"`
|
|
282
|
+
* @param codec - Optional. Codec to decode (`"av1"`, `"h264"` (default), or `"hevc"`; `"h265"` is accepted as an
|
|
283
|
+
* alias for `"hevc"`, and codec matching is case-insensitive).
|
|
298
284
|
* @returns Array of FFmpeg command-line arguments for video decoding or an empty array if the codec isn't supported.
|
|
299
285
|
*
|
|
300
286
|
* @example
|
|
@@ -318,43 +304,6 @@ export declare class FfmpegOptions {
|
|
|
318
304
|
* @returns The crop filter string for FFmpeg.
|
|
319
305
|
*/
|
|
320
306
|
get cropFilter(): string;
|
|
321
|
-
/**
|
|
322
|
-
* Generate the appropriate scale filter for the current platform. This method returns platform-specific scale filters to leverage hardware acceleration capabilities
|
|
323
|
-
* where available.
|
|
324
|
-
*/
|
|
325
|
-
private getScaleFilter;
|
|
326
|
-
/**
|
|
327
|
-
* Generates the default set of FFmpeg video encoder arguments for software transcoding using libx264.
|
|
328
|
-
*
|
|
329
|
-
* This method builds command-line options for the FFmpeg libx264 encoder based on the provided encoder options, including bitrate, H.264 profile and level, pixel
|
|
330
|
-
* format, frame rate, buffer size, and optional smart quality settings. It is used internally when hardware-accelerated transcoding is not enabled or supported.
|
|
331
|
-
*
|
|
332
|
-
* @param options - The encoder options to use for generating FFmpeg arguments.
|
|
333
|
-
*
|
|
334
|
-
* @returns An array of FFmpeg command-line arguments for software video encoding.
|
|
335
|
-
*
|
|
336
|
-
* @example
|
|
337
|
-
*
|
|
338
|
-
* ```ts
|
|
339
|
-
* const encoderOptions: VideoEncoderOptions = {
|
|
340
|
-
*
|
|
341
|
-
* bitrate: 2000,
|
|
342
|
-
* fps: 30,
|
|
343
|
-
* height: 720,
|
|
344
|
-
* idrInterval: 2,
|
|
345
|
-
* inputFps: 30,
|
|
346
|
-
* level: H264Level.LEVEL3_1,
|
|
347
|
-
* profile: H264Profile.MAIN,
|
|
348
|
-
* smartQuality: true,
|
|
349
|
-
* width: 1280
|
|
350
|
-
* };
|
|
351
|
-
*
|
|
352
|
-
* const args = ffmpegOpts['defaultVideoEncoderOptions'](encoderOptions);
|
|
353
|
-
* ```
|
|
354
|
-
*
|
|
355
|
-
* @see VideoEncoderOptions
|
|
356
|
-
*/
|
|
357
|
-
private defaultVideoEncoderOptions;
|
|
358
307
|
/**
|
|
359
308
|
* Returns the video encoder options to use for HomeKit Secure Video (HKSV) event recording.
|
|
360
309
|
*
|
|
@@ -376,51 +325,15 @@ export declare class FfmpegOptions {
|
|
|
376
325
|
*/
|
|
377
326
|
streamEncoder(options: VideoEncoderOptions): string[];
|
|
378
327
|
/**
|
|
379
|
-
* Returns the maximum pixel count
|
|
380
|
-
*
|
|
381
|
-
* @returns Maximum supported pixel count.
|
|
382
|
-
*/
|
|
383
|
-
get hostSystemMaxPixels(): number;
|
|
384
|
-
/**
|
|
385
|
-
* Converts a HomeKit H.264 level enum value to the corresponding FFmpeg string or numeric representation.
|
|
386
|
-
*
|
|
387
|
-
* This helper is used to translate between HomeKit's `H264Level` enum and the string or numeric format expected by FFmpeg's `-level:v` argument.
|
|
388
|
-
*
|
|
389
|
-
* @param level - The H.264 level to translate.
|
|
390
|
-
* @param numeric - Optional. If `true`, returns the numeric representation (e.g., "31"). If `false` or omitted, returns the standard string format (e.g., "3.1").
|
|
391
|
-
*
|
|
392
|
-
* @returns The FFmpeg-compatible H.264 level string or numeric value.
|
|
393
|
-
*
|
|
394
|
-
* @example
|
|
395
|
-
*
|
|
396
|
-
* ```ts
|
|
397
|
-
* ffmpegOpts['getH264Level'](H264Level.LEVEL3_1); // "3.1"
|
|
398
|
-
*
|
|
399
|
-
* ffmpegOpts['getH264Level'](H264Level.LEVEL4_0, true); // "40"
|
|
400
|
-
* ```
|
|
401
|
-
*
|
|
402
|
-
* @see H264Level
|
|
403
|
-
*/
|
|
404
|
-
private getH264Level;
|
|
405
|
-
/**
|
|
406
|
-
* Converts a HomeKit H.264 profile enum value to the corresponding FFmpeg string or numeric representation.
|
|
407
|
-
*
|
|
408
|
-
* This helper is used to translate between HomeKit's `H264Profile` enum and the string or numeric format expected by FFmpeg's `-profile:v` argument.
|
|
409
|
-
*
|
|
410
|
-
* @param profile - The H.264 profile to translate.
|
|
411
|
-
* @param numeric - Optional. If `true`, returns the numeric representation (e.g., "100"). If `false` or omitted, returns the standard string format (e.g., "high").
|
|
328
|
+
* Returns the maximum source pixel count the host's hardware transcode pipeline can ingest for the given encoding context, or `Infinity` when unconstrained.
|
|
412
329
|
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* @example
|
|
416
|
-
*
|
|
417
|
-
* ```ts
|
|
418
|
-
* ffmpegOpts['getH264Profile'](H264Profile.HIGH); // "high"
|
|
419
|
-
*
|
|
420
|
-
* ffmpegOpts['getH264Profile'](H264Profile.BASELINE, true); // "66"
|
|
421
|
-
* ```
|
|
330
|
+
* Only Raspberry Pi's GPU imposes a real limit; every other host is unconstrained. A context is capped only when it actually runs on that hardware path - so today live
|
|
331
|
+
* streaming on a Pi returns the RPi ceiling while recording on a Pi returns `Infinity` (it software-encodes). Consumers apply this value blindly; the "why" lives here.
|
|
422
332
|
*
|
|
423
|
-
* @
|
|
333
|
+
* @param context - The encoding context whose ceiling is requested.
|
|
334
|
+
* @returns Maximum supported source pixel count for `context`.
|
|
424
335
|
*/
|
|
425
|
-
|
|
336
|
+
maxSourcePixels(context: EncoderContext): number;
|
|
426
337
|
}
|
|
338
|
+
export {};
|
|
339
|
+
//# sourceMappingURL=options.d.ts.map
|