homebridge-plugin-utils 1.19.0 → 1.21.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/dist/ffmpeg/options.d.ts +28 -16
- package/dist/ffmpeg/options.js +117 -83
- package/dist/ffmpeg/options.js.map +1 -1
- package/dist/ffmpeg/record.d.ts +63 -33
- package/dist/ffmpeg/record.js +74 -62
- package/dist/ffmpeg/record.js.map +1 -1
- package/dist/util.d.ts +30 -0
- package/dist/util.js.map +1 -1
- package/package.json +4 -4
package/dist/ffmpeg/options.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
import { H264Level, H264Profile, type Logging } from "homebridge";
|
|
20
|
+
import { AudioRecordingCodecType, H264Level, H264Profile, type Logging } from "homebridge";
|
|
21
21
|
import type { FfmpegCodecs } from "./codecs.js";
|
|
22
22
|
import type { HomebridgePluginLogging } from "../util.js";
|
|
23
23
|
/**
|
|
@@ -71,13 +71,14 @@ export interface FfmpegOptionsConfig {
|
|
|
71
71
|
*
|
|
72
72
|
* @property bitrate - Target video bitrate, in kilobits per second.
|
|
73
73
|
* @property fps - Target output frames per second.
|
|
74
|
+
* @property hardwareDecoding - Optional. If `true`, encoder options will account for hardware decoding (primarily for Intel QSV scenarios). Defaults to `true`.
|
|
74
75
|
* @property height - Output video height, in pixels.
|
|
75
76
|
* @property idrInterval - Interval (in seconds) between keyframes (IDR frames).
|
|
76
77
|
* @property inputFps - Input (source) frames per second.
|
|
77
78
|
* @property level - H.264 profile level for output.
|
|
78
79
|
* @property profile - H.264 profile for output.
|
|
79
|
-
* @property
|
|
80
|
-
*
|
|
80
|
+
* @property smartQuality - Optional and applicable only when not using hardware acceleration. If `true`, enables smart quality and variable bitrate optimizations.
|
|
81
|
+
* Defaults to `true`.
|
|
81
82
|
* @property width - Output video width, in pixels.
|
|
82
83
|
*
|
|
83
84
|
* @example
|
|
@@ -87,13 +88,14 @@ export interface FfmpegOptionsConfig {
|
|
|
87
88
|
*
|
|
88
89
|
* bitrate: 3000,
|
|
89
90
|
* fps: 30,
|
|
91
|
+
* hardwareDecoding: true,
|
|
92
|
+
* hardwareTranscoding: true,
|
|
90
93
|
* height: 1080,
|
|
91
94
|
* idrInterval: 2,
|
|
92
95
|
* inputFps: 30,
|
|
93
96
|
* level: H264Level.LEVEL4_0,
|
|
94
97
|
* profile: H264Profile.HIGH,
|
|
95
|
-
*
|
|
96
|
-
* useSmartQuality: true,
|
|
98
|
+
* smartQuality: true,
|
|
97
99
|
* width: 1920
|
|
98
100
|
* };
|
|
99
101
|
*
|
|
@@ -110,13 +112,14 @@ export interface FfmpegOptionsConfig {
|
|
|
110
112
|
export interface EncoderOptions {
|
|
111
113
|
bitrate: number;
|
|
112
114
|
fps: number;
|
|
115
|
+
hardwareDecoding?: boolean;
|
|
116
|
+
hardwareTranscoding?: boolean;
|
|
113
117
|
height: number;
|
|
114
118
|
idrInterval: number;
|
|
115
119
|
inputFps: number;
|
|
116
120
|
level: H264Level;
|
|
117
121
|
profile: H264Profile;
|
|
118
|
-
|
|
119
|
-
useHardwareDecoder?: boolean;
|
|
122
|
+
smartQuality?: boolean;
|
|
120
123
|
width: number;
|
|
121
124
|
}
|
|
122
125
|
/**
|
|
@@ -134,12 +137,14 @@ export interface EncoderOptions {
|
|
|
134
137
|
*
|
|
135
138
|
* bitrate: 3000,
|
|
136
139
|
* fps: 30,
|
|
140
|
+
* hardwareDecoding: true,
|
|
141
|
+
* hardwareTranscoding: true,
|
|
137
142
|
* height: 1080,
|
|
138
143
|
* idrInterval: 2,
|
|
139
144
|
* inputFps: 30,
|
|
140
145
|
* level: H264Level.LEVEL4_0,
|
|
141
146
|
* profile: H264Profile.HIGH,
|
|
142
|
-
*
|
|
147
|
+
* smartQuality: true,
|
|
143
148
|
* width: 1920
|
|
144
149
|
* };
|
|
145
150
|
* const args = ffmpegOpts.streamEncoder(encoderOptions);
|
|
@@ -160,6 +165,10 @@ export declare class FfmpegOptions {
|
|
|
160
165
|
*
|
|
161
166
|
*/
|
|
162
167
|
codecSupport: FfmpegCodecs;
|
|
168
|
+
/**
|
|
169
|
+
* The configuration options used to initialize this instance.
|
|
170
|
+
*/
|
|
171
|
+
readonly config: FfmpegOptionsConfig;
|
|
163
172
|
/**
|
|
164
173
|
* Indicates if debug logging is enabled.
|
|
165
174
|
*/
|
|
@@ -172,10 +181,6 @@ export declare class FfmpegOptions {
|
|
|
172
181
|
* Function returning the name for this options instance to be used for logging.
|
|
173
182
|
*/
|
|
174
183
|
readonly name: () => string;
|
|
175
|
-
/**
|
|
176
|
-
* The original options used to initialize this instance.
|
|
177
|
-
*/
|
|
178
|
-
readonly options: FfmpegOptionsConfig;
|
|
179
184
|
private readonly hwPixelFormat;
|
|
180
185
|
/**
|
|
181
186
|
* Creates an instance of Homebridge FFmpeg encoding and decoding options.
|
|
@@ -217,9 +222,16 @@ export declare class FfmpegOptions {
|
|
|
217
222
|
/**
|
|
218
223
|
* Returns the audio encoder arguments to use when transcoding.
|
|
219
224
|
*
|
|
225
|
+
* @param codec - Optional. Codec to encode (`AudioRecordingCodecType.AAC_ELD` (default) or `AudioRecordingCodecType.AAC_LC`).
|
|
220
226
|
* @returns Array of FFmpeg command-line arguments for audio encoding.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
*
|
|
230
|
+
* ```ts
|
|
231
|
+
* const args = ffmpegOpts.audioEncoder();
|
|
232
|
+
* ```
|
|
221
233
|
*/
|
|
222
|
-
|
|
234
|
+
audioEncoder(codec?: AudioRecordingCodecType): string[];
|
|
223
235
|
/**
|
|
224
236
|
* Returns the audio decoder to use when decoding.
|
|
225
237
|
*
|
|
@@ -229,8 +241,8 @@ export declare class FfmpegOptions {
|
|
|
229
241
|
/**
|
|
230
242
|
* Returns the video decoder arguments to use for decoding video.
|
|
231
243
|
*
|
|
232
|
-
* @param codec - Optional. Codec to decode ("h264" or "hevc").
|
|
233
|
-
* @returns Array of FFmpeg command-line arguments for video decoding.
|
|
244
|
+
* @param codec - Optional. Codec to decode (`"h264"` (default) or `"hevc"`).
|
|
245
|
+
* @returns Array of FFmpeg command-line arguments for video decoding or an empty array if the codec isn't supported.
|
|
234
246
|
*
|
|
235
247
|
* @example
|
|
236
248
|
*
|
|
@@ -267,7 +279,7 @@ export declare class FfmpegOptions {
|
|
|
267
279
|
* inputFps: 30,
|
|
268
280
|
* level: H264Level.LEVEL3_1,
|
|
269
281
|
* profile: H264Profile.MAIN,
|
|
270
|
-
*
|
|
282
|
+
* smartQuality: true,
|
|
271
283
|
* width: 1280
|
|
272
284
|
* };
|
|
273
285
|
*
|