homebridge-unifi-protect 7.15.0 → 7.16.1
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/devices/protect-camera-package.d.ts +2 -2
- package/dist/devices/protect-camera-package.js +1 -1
- package/dist/devices/protect-camera-package.js.map +1 -1
- package/dist/devices/protect-camera.d.ts +5 -5
- package/dist/devices/protect-camera.js +36 -15
- package/dist/devices/protect-camera.js.map +1 -1
- package/dist/devices/protect-chime.d.ts +3 -3
- package/dist/devices/protect-device.d.ts +7 -7
- package/dist/devices/protect-device.js.map +1 -1
- package/dist/devices/protect-doorbell.d.ts +3 -3
- package/dist/devices/protect-doorbell.js +2 -2
- package/dist/devices/protect-doorbell.js.map +1 -1
- package/dist/devices/protect-light.d.ts +3 -3
- package/dist/devices/protect-light.js +2 -2
- package/dist/devices/protect-light.js.map +1 -1
- package/dist/devices/protect-liveviews.d.ts +1 -1
- package/dist/devices/protect-liveviews.js.map +1 -1
- package/dist/devices/protect-nvr-systeminfo.d.ts +1 -1
- package/dist/devices/protect-nvr-systeminfo.js.map +1 -1
- package/dist/devices/protect-securitysystem.d.ts +2 -2
- package/dist/devices/protect-sensor.d.ts +3 -3
- package/dist/devices/protect-viewer.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/protect-events.d.ts +4 -4
- package/dist/protect-events.js.map +1 -1
- package/dist/protect-livestream.d.ts +5 -4
- package/dist/protect-livestream.js +22 -8
- package/dist/protect-livestream.js.map +1 -1
- package/dist/protect-nvr.d.ts +7 -6
- package/dist/protect-nvr.js +1 -1
- package/dist/protect-nvr.js.map +1 -1
- package/dist/protect-options.d.ts +1 -1
- package/dist/protect-platform.d.ts +3 -7
- package/dist/protect-platform.js +2 -44
- package/dist/protect-platform.js.map +1 -1
- package/dist/protect-record.d.ts +5 -3
- package/dist/protect-record.js +11 -8
- package/dist/protect-record.js.map +1 -1
- package/dist/protect-snapshot.d.ts +4 -4
- package/dist/protect-snapshot.js +8 -9
- package/dist/protect-snapshot.js.map +1 -1
- package/dist/protect-stream.d.ts +6 -6
- package/dist/protect-stream.js +78 -38
- package/dist/protect-stream.js.map +1 -1
- package/dist/protect-timeshift.d.ts +3 -3
- package/dist/protect-timeshift.js +1 -1
- package/dist/protect-timeshift.js.map +1 -1
- package/dist/protect-types.d.ts +2 -2
- package/dist/settings.d.ts +0 -2
- package/dist/settings.js +0 -4
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/lib/featureoptions.js +65 -6
- package/homebridge-ui/public/lib/featureoptions.js.map +1 -1
- package/homebridge-ui/public/lib/webUi-featureoptions.mjs +4 -4
- package/package.json +20 -16
- package/dist/ffmpeg/index.d.ts +0 -6
- package/dist/ffmpeg/index.js +0 -11
- package/dist/ffmpeg/index.js.map +0 -1
- package/dist/ffmpeg/protect-ffmpeg-codecs.d.ts +0 -22
- package/dist/ffmpeg/protect-ffmpeg-codecs.js +0 -189
- package/dist/ffmpeg/protect-ffmpeg-codecs.js.map +0 -1
- package/dist/ffmpeg/protect-ffmpeg-exec.d.ts +0 -15
- package/dist/ffmpeg/protect-ffmpeg-exec.js +0 -58
- package/dist/ffmpeg/protect-ffmpeg-exec.js.map +0 -1
- package/dist/ffmpeg/protect-ffmpeg-options.d.ts +0 -33
- package/dist/ffmpeg/protect-ffmpeg-options.js +0 -555
- package/dist/ffmpeg/protect-ffmpeg-options.js.map +0 -1
- package/dist/ffmpeg/protect-ffmpeg-record.d.ts +0 -15
- package/dist/ffmpeg/protect-ffmpeg-record.js +0 -246
- package/dist/ffmpeg/protect-ffmpeg-record.js.map +0 -1
- package/dist/ffmpeg/protect-ffmpeg-stream.d.ts +0 -17
- package/dist/ffmpeg/protect-ffmpeg-stream.js +0 -102
- package/dist/ffmpeg/protect-ffmpeg-stream.js.map +0 -1
- package/dist/ffmpeg/protect-ffmpeg.d.ts +0 -35
- package/dist/ffmpeg/protect-ffmpeg.js +0 -238
- package/dist/ffmpeg/protect-ffmpeg.js.map +0 -1
|
@@ -1,555 +0,0 @@
|
|
|
1
|
-
import { PROTECT_HOMEKIT_STREAMING_HEADROOM, PROTECT_RPI_GPU_MINIMUM } from "../settings.js";
|
|
2
|
-
export class FfmpegOptions {
|
|
3
|
-
hwPixelFormat;
|
|
4
|
-
log;
|
|
5
|
-
platform;
|
|
6
|
-
protectCamera;
|
|
7
|
-
// Create an instance of a HomeKit streaming delegate.
|
|
8
|
-
constructor(protectCamera) {
|
|
9
|
-
this.hwPixelFormat = [];
|
|
10
|
-
this.log = protectCamera.log;
|
|
11
|
-
this.platform = protectCamera.platform;
|
|
12
|
-
this.protectCamera = protectCamera;
|
|
13
|
-
// Configure our hardware acceleration support.
|
|
14
|
-
this.configureHwAccel();
|
|
15
|
-
}
|
|
16
|
-
// Determine the video encoder to use when transcoding.
|
|
17
|
-
configureHwAccel() {
|
|
18
|
-
let logMessage = "";
|
|
19
|
-
// Utility to return which hardware acceleration features are currently available to us.
|
|
20
|
-
const accelCategories = () => {
|
|
21
|
-
const categories = [];
|
|
22
|
-
if (this.protectCamera.hints.hardwareDecoding) {
|
|
23
|
-
categories.push("decoding");
|
|
24
|
-
}
|
|
25
|
-
if (this.protectCamera.hints.hardwareTranscoding) {
|
|
26
|
-
categories.push("transcoding");
|
|
27
|
-
}
|
|
28
|
-
return categories.join(" and ");
|
|
29
|
-
};
|
|
30
|
-
// Hardware-accelerated decoding is enabled by default, where supported. Let's select the decoder options accordingly where supported.
|
|
31
|
-
if (this.protectCamera.hints.hardwareDecoding) {
|
|
32
|
-
// Utility function to check that we have a specific decoder codec available to us.
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34
|
-
const validateDecoder = (codec, pixelFormat) => {
|
|
35
|
-
if (!this.platform.codecSupport.hasDecoder("h264", codec)) {
|
|
36
|
-
this.log.error("Unable to enable hardware-accelerated decoding. Your video processor does not have support for the " + codec + " decoder. " +
|
|
37
|
-
"Using software decoding instead.");
|
|
38
|
-
this.protectCamera.hints.hardwareDecoding = false;
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
this.hwPixelFormat.push(...pixelFormat);
|
|
42
|
-
return true;
|
|
43
|
-
};
|
|
44
|
-
// Utility function to check that we have a specific decoder codec available to us.
|
|
45
|
-
const validateHwAccel = (accel, pixelFormat) => {
|
|
46
|
-
if (!this.platform.codecSupport.hasHwAccel(accel)) {
|
|
47
|
-
this.log.error("Unable to enable hardware-accelerated decoding. Your video processor does not have support for the " + accel + " hardware accelerator. " +
|
|
48
|
-
"Using software decoding instead.");
|
|
49
|
-
this.protectCamera.hints.hardwareDecoding = false;
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
this.hwPixelFormat.push(...pixelFormat);
|
|
53
|
-
return true;
|
|
54
|
-
};
|
|
55
|
-
switch (this.platform.hostSystem) {
|
|
56
|
-
case "macOS.Apple":
|
|
57
|
-
case "macOS.Intel":
|
|
58
|
-
// Verify that we have hardware-accelerated decoding available to us.
|
|
59
|
-
validateHwAccel("videotoolbox", ["videotoolbox_vld", "nv12", "yuv420p"]);
|
|
60
|
-
break;
|
|
61
|
-
case "raspbian":
|
|
62
|
-
// If it's less than the minimum hardware GPU memory we need on an Raspberry Pi, we revert back to our default decoder.
|
|
63
|
-
if (this.platform.codecSupport.gpuMem < PROTECT_RPI_GPU_MINIMUM) {
|
|
64
|
-
this.log.info("Disabling hardware-accelerated %s. Adjust the GPU memory configuration on your Raspberry Pi to at least %s MB to enable it.", accelCategories(), PROTECT_RPI_GPU_MINIMUM);
|
|
65
|
-
this.protectCamera.hints.hardwareDecoding = false;
|
|
66
|
-
this.protectCamera.hints.hardwareTranscoding = false;
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
// Verify that we have the hardware decoder available to us. Unfortunately, at the moment, it seems that hardware decoding is flaky, at best, on Raspberry Pi.
|
|
70
|
-
// validateDecoder("h264_mmal", [ "mmal", "yuv420p" ]);
|
|
71
|
-
// validateDecoder("h264_v4l2m2ml", [ "yuv420p" ]);
|
|
72
|
-
this.protectCamera.hints.hardwareDecoding = false;
|
|
73
|
-
break;
|
|
74
|
-
default:
|
|
75
|
-
// Back to software decoding unless we're on a known system that always supports hardware decoding.
|
|
76
|
-
this.protectCamera.hints.hardwareDecoding = false;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// If we've enabled hardware-accelerated transcoding, let's select the encoder options accordingly where supported.
|
|
81
|
-
if (this.protectCamera.hints.hardwareTranscoding) {
|
|
82
|
-
// Utility function to check that we have a specific encoder codec available to us.
|
|
83
|
-
const validateEncoder = (codec) => {
|
|
84
|
-
if (!this.platform.codecSupport.hasEncoder("h264", codec)) {
|
|
85
|
-
this.log.error("Unable to enable hardware-accelerated transcoding. Your video processor does not have support for the " + codec + " encoder. " +
|
|
86
|
-
"Using software transcoding instead.");
|
|
87
|
-
this.protectCamera.hints.hardwareTranscoding = false;
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
return true;
|
|
91
|
-
};
|
|
92
|
-
switch (this.platform.hostSystem) {
|
|
93
|
-
case "macOS.Apple":
|
|
94
|
-
case "macOS.Intel":
|
|
95
|
-
// Verify that we have the hardware encoder available to us.
|
|
96
|
-
validateEncoder("h264_videotoolbox");
|
|
97
|
-
// Validate that we have access to the AudioToolbox AAC encoder.
|
|
98
|
-
if (!this.platform.codecSupport.hasEncoder("aac", "aac_at")) {
|
|
99
|
-
this.log.error("Your video processor does not have support for the native macOS AAC encoder, aac_at. Will attempt to use libfdk_aac instead.");
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case "raspbian":
|
|
103
|
-
// Verify that we have the hardware encoder available to us.
|
|
104
|
-
validateEncoder("h264_v4l2m2m");
|
|
105
|
-
logMessage = "Raspberry Pi hardware acceleration will be used for livestreaming. " +
|
|
106
|
-
"HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead";
|
|
107
|
-
// Ensure we have the pixel format the Raspberry Pi GPU is expecting available to us, if it isn't already.
|
|
108
|
-
if (!this.hwPixelFormat.includes("yuv420p")) {
|
|
109
|
-
this.hwPixelFormat.push("yuv420p");
|
|
110
|
-
}
|
|
111
|
-
break;
|
|
112
|
-
default:
|
|
113
|
-
// Let's see if we have Intel QuickSync hardware decoding available to us.
|
|
114
|
-
if (this.platform.codecSupport.hasHwAccel("qsv") &&
|
|
115
|
-
this.platform.codecSupport.hasDecoder("h264", "h264_qsv") && this.platform.codecSupport.hasEncoder("h264", "h264_qsv") &&
|
|
116
|
-
this.platform.codecSupport.hasDecoder("hevc", "hevc_qsv") && this.platform.codecSupport.hasEncoder("hevc", "hevc_qsv")) {
|
|
117
|
-
this.protectCamera.hints.hardwareDecoding = true;
|
|
118
|
-
this.hwPixelFormat.push("qsv", "yuv420p");
|
|
119
|
-
logMessage = "Intel Quick Sync Video";
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
// Back to software encoding.
|
|
123
|
-
this.protectCamera.hints.hardwareDecoding = false;
|
|
124
|
-
this.protectCamera.hints.hardwareTranscoding = false;
|
|
125
|
-
}
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// Inform the user.
|
|
130
|
-
if (this.protectCamera.hints.hardwareDecoding || this.protectCamera.hints.hardwareTranscoding) {
|
|
131
|
-
this.protectCamera.logFeature("Video.Transcode.Hardware", "Hardware-accelerated " + accelCategories() + " enabled" + (logMessage.length ? ": " + logMessage : "") + ".");
|
|
132
|
-
}
|
|
133
|
-
// Encourage users to enable hardware-accelerated transcoding on macOS.
|
|
134
|
-
if (!this.protectCamera.hints.hardwareTranscoding && !this.protectCamera.accessory.context.packageCamera && this.platform.hostSystem.startsWith("macOS.")) {
|
|
135
|
-
this.log.warn("macOS detected: consider enabling hardware acceleration (located under the video feature options section in the HBUP webUI) for even better " +
|
|
136
|
-
"performance and an improved user experience.");
|
|
137
|
-
}
|
|
138
|
-
return this.protectCamera.hints.hardwareTranscoding;
|
|
139
|
-
}
|
|
140
|
-
// Return the audio encoder options to use when transcoding.
|
|
141
|
-
get audioEncoder() {
|
|
142
|
-
// If we don't have libfdk_aac available to us, we're essentially dead in the water.
|
|
143
|
-
let encoderOptions = [];
|
|
144
|
-
// Utility function to return a default audio encoder codec.
|
|
145
|
-
const defaultAudioEncoderOptions = () => {
|
|
146
|
-
const audioOptions = [];
|
|
147
|
-
if (this.platform.codecSupport.hasEncoder("aac", "libfdk_aac")) {
|
|
148
|
-
// Default to libfdk_aac since FFmpeg doesn't natively support AAC-ELD. We use the following options by default:
|
|
149
|
-
//
|
|
150
|
-
// -acodec libfdk_aac Use the libfdk_aac encoder.
|
|
151
|
-
// -afterburner 1 Increases audio quality at the expense of needing a little bit more computational power in libfdk_aac.
|
|
152
|
-
// -eld_v2 1 Use the enhanced low delay v2 standard for better audio characteristics.
|
|
153
|
-
audioOptions.push("-acodec", "libfdk_aac", "-afterburner", "1", "-eld_v2", "1");
|
|
154
|
-
// If we're using Jellyfin's FFmpeg, it's libfdk_aac is broken and crashes when using spectral band replication.
|
|
155
|
-
if (!/-Jellyfin$/i.test(this.platform.codecSupport.ffmpegVersion)) {
|
|
156
|
-
// -eld_sbr 1 Use spectral band replication to further enhance audio.
|
|
157
|
-
audioOptions.push("-eld_sbr", "1");
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return audioOptions;
|
|
161
|
-
};
|
|
162
|
-
switch (this.platform.hostSystem) {
|
|
163
|
-
case "macOS.Apple":
|
|
164
|
-
case "macOS.Intel":
|
|
165
|
-
// If we don't have audiotoolbox available, let's default back to libfdk_aac.
|
|
166
|
-
if (!this.platform.codecSupport.hasEncoder("aac", "aac_at")) {
|
|
167
|
-
encoderOptions = defaultAudioEncoderOptions();
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
// aac_at is the macOS audio encoder API. We use the following options:
|
|
171
|
-
//
|
|
172
|
-
// -acodec aac_at Use the aac_at encoder on macOS.
|
|
173
|
-
// -aac_at_mode cvbr Use the constrained variable bitrate setting to allow the encoder to optimize audio within the requested bitrates.
|
|
174
|
-
encoderOptions = [
|
|
175
|
-
"-acodec", "aac_at",
|
|
176
|
-
"-aac_at_mode", "cvbr"
|
|
177
|
-
];
|
|
178
|
-
break;
|
|
179
|
-
default:
|
|
180
|
-
encoderOptions = defaultAudioEncoderOptions();
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
return encoderOptions;
|
|
184
|
-
}
|
|
185
|
-
// Return the audio encoder to use when decoding.
|
|
186
|
-
get audioDecoder() {
|
|
187
|
-
return "libfdk_aac";
|
|
188
|
-
}
|
|
189
|
-
// Return the video decoder options to use when decoding video.
|
|
190
|
-
get videoDecoder() {
|
|
191
|
-
// Default to no special decoder options for inbound streams.
|
|
192
|
-
let decoderOptions = [];
|
|
193
|
-
// If we've enabled hardware-accelerated transcoding, let's select decoder options accordingly where supported.
|
|
194
|
-
if (this.protectCamera.hints.hardwareDecoding) {
|
|
195
|
-
switch (this.platform.hostSystem) {
|
|
196
|
-
case "macOS.Apple":
|
|
197
|
-
case "macOS.Intel":
|
|
198
|
-
// h264_videotoolbox is the macOS hardware decoder and encoder API. We use the following options for decoding video:
|
|
199
|
-
//
|
|
200
|
-
// -hwaccel videotoolbox Select Video Toolbox for hardware-accelerated H.264 decoding.
|
|
201
|
-
decoderOptions = [
|
|
202
|
-
"-hwaccel", "videotoolbox"
|
|
203
|
-
];
|
|
204
|
-
break;
|
|
205
|
-
case "raspbian":
|
|
206
|
-
// h264_mmal is the preferred Raspberry Pi hardware decoder codec. We use the following options for decoding video:
|
|
207
|
-
//
|
|
208
|
-
// -c:v h264_mmal Select the Multimedia Abstraction Layer codec for hardware-accelerated H.264 processing.
|
|
209
|
-
decoderOptions = [
|
|
210
|
-
// "-c:v", "h264_mmal"
|
|
211
|
-
];
|
|
212
|
-
break;
|
|
213
|
-
default:
|
|
214
|
-
// h264_qsv is the Intel Quick Sync Video hardware encoder and decoder.
|
|
215
|
-
//
|
|
216
|
-
// -hwaccel qsv Select Quick Sync Video to enable hardware-accelerated H.264 decoding.
|
|
217
|
-
// -c:v h264_qsv or hevc_qsv Select the Quick Sync Video codec for hardware-accelerated H.264 or HEVC processing.
|
|
218
|
-
decoderOptions = [
|
|
219
|
-
"-hwaccel", "qsv",
|
|
220
|
-
"-hwaccel_output_format", "qsv",
|
|
221
|
-
"-c:v", (this.protectCamera.ufp.videoCodec === "h265") ? "hevc_qsv" : "h264_qsv"
|
|
222
|
-
];
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return decoderOptions;
|
|
227
|
-
}
|
|
228
|
-
// Return the FFmpeg crop filter options, if configured to do so.
|
|
229
|
-
get cropFilter() {
|
|
230
|
-
// If we haven't enabled cropping, tell the crop filter to do nothing.
|
|
231
|
-
if (!this.protectCamera.hints.crop) {
|
|
232
|
-
return "crop=w=iw*100:h=ih*100:x=iw*0:y=ih*0";
|
|
233
|
-
}
|
|
234
|
-
// Generate our crop filter based on what the user has configured.
|
|
235
|
-
return "crop=" + [
|
|
236
|
-
"w=iw*" + this.protectCamera.hints.cropOptions.width.toString(),
|
|
237
|
-
"h=ih*" + this.protectCamera.hints.cropOptions.height.toString(),
|
|
238
|
-
"x=iw*" + this.protectCamera.hints.cropOptions.x.toString(),
|
|
239
|
-
"y=ih*" + this.protectCamera.hints.cropOptions.y.toString()
|
|
240
|
-
].join(":");
|
|
241
|
-
}
|
|
242
|
-
// Utility function to provide our default encoder options.
|
|
243
|
-
defaultVideoEncoderOptions(options) {
|
|
244
|
-
const videoFilters = [];
|
|
245
|
-
// Default smart quality to true unless specified.
|
|
246
|
-
options = Object.assign({}, { useSmartQuality: true }, options);
|
|
247
|
-
// Set our FFmpeg video filter options:
|
|
248
|
-
//
|
|
249
|
-
// format= Set the pixel formats we want to target for output.
|
|
250
|
-
videoFilters.push("format=" + [...new Set([...this.hwPixelFormat, "yuvj420p"])].join("|"));
|
|
251
|
-
// scale=-2:min(ih\,height) Scale the video to the size that's being requested while respecting aspect ratios and ensuring our final dimensions are
|
|
252
|
-
// a power of two.
|
|
253
|
-
videoFilters.push("scale=-2:min(ih\\," + options.height.toString() + ")");
|
|
254
|
-
// fps=fps= Use the fps filter to provide the frame rate requested by HomeKit. This has better performance characteristics for Protect
|
|
255
|
-
// rather than using "-r". We only need to apply this filter if our input and output frame rates aren't already identical.
|
|
256
|
-
if (options.fps !== options.inputFps) {
|
|
257
|
-
videoFilters.push("fps=fps=" + options.fps.toString());
|
|
258
|
-
}
|
|
259
|
-
// Default to the tried-and-true libx264. We use the following options by default:
|
|
260
|
-
//
|
|
261
|
-
// -c:v libx264 Use the excellent libx264 H.264 encoder by default, unless the user explicitly overrides it.
|
|
262
|
-
// -preset veryfast Use the veryfast encoding preset in libx264, which provides a good balance of encoding speed and quality.
|
|
263
|
-
// -profile:v Use the H.264 profile that HomeKit is requesting when encoding.
|
|
264
|
-
// -level:v Use the H.264 profile level that HomeKit is requesting when encoding.
|
|
265
|
-
// -noautoscale Don't attempt to scale the video stream automatically.
|
|
266
|
-
// -bf 0 Disable B-frames when encoding to increase compatibility against occasionally finicky HomeKit clients.
|
|
267
|
-
// -filter:v Set the pixel format and scale the video to the size we want while respecting aspect ratios and ensuring our final
|
|
268
|
-
// dimensions are a power of two.
|
|
269
|
-
// -g:v Set the group of pictures to the number of frames per second * the interval in between keyframes to ensure a solid
|
|
270
|
-
// livestreamng exerience.
|
|
271
|
-
// -bufsize size This is the decoder buffer size, which drives the variability / quality of the output bitrate.
|
|
272
|
-
// -maxrate bitrate The maximum bitrate tolerance, used with -bufsize. This provides an upper bound on bitrate, with a little bit extra to
|
|
273
|
-
// allow encoders some variation in order to maximize quality while honoring bandwidth constraints.
|
|
274
|
-
const encoderOptions = [
|
|
275
|
-
// If the user has specified a video encoder, let's use it instead.
|
|
276
|
-
"-c:v", this.platform.config.videoEncoder,
|
|
277
|
-
"-preset", "veryfast",
|
|
278
|
-
"-profile:v", this.getH264Profile(options.profile),
|
|
279
|
-
"-level:v", this.getH264Level(options.level),
|
|
280
|
-
"-noautoscale",
|
|
281
|
-
"-bf", "0",
|
|
282
|
-
"-filter:v", videoFilters.join(", "),
|
|
283
|
-
"-g:v", (options.fps * options.idrInterval).toString(),
|
|
284
|
-
"-bufsize", (2 * options.bitrate).toString() + "k",
|
|
285
|
-
"-maxrate", (options.bitrate + (options.useSmartQuality ? PROTECT_HOMEKIT_STREAMING_HEADROOM : 0)).toString() + "k"
|
|
286
|
-
];
|
|
287
|
-
// Using libx264's constant rate factor mode produces generally better results across the board. We use a capped CRF approach, allowing libx264 to
|
|
288
|
-
// make intelligent choices about how to adjust bitrate to achieve a certain quality level depending on the complexity of the scene being encoded, but
|
|
289
|
-
// constraining it to a maximum bitrate to stay within the bandwidth constraints HomeKit is requesting.
|
|
290
|
-
if (options.useSmartQuality) {
|
|
291
|
-
// -crf 20 Use a constant rate factor of 20, to allow libx264 the ability to vary bitrates to achieve the visual quality we
|
|
292
|
-
// want, constrained by our maximum bitrate.
|
|
293
|
-
encoderOptions.push("-crf", "20");
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
// For recording HKSV, we really want to maintain a tight rein on bitrate and don't want to freelance with perceived quality for two reasons - HKSV
|
|
297
|
-
// is very latency sensitive and it's also very particular about bitrates and the specific format of the stream it receives. The second reason is that
|
|
298
|
-
// HKSV typically requests bitrates of around 2000kbps, which results in a reasonably high quality recording, as opposed to the typical 2-300kbps
|
|
299
|
-
// that livestreaming from the Home app itself generates. Those lower bitrates in livestreaming really benefit from the magic that using a good CRF value
|
|
300
|
-
// can produce in libx264.
|
|
301
|
-
encoderOptions.push("-b:v", options.bitrate.toString() + "k");
|
|
302
|
-
}
|
|
303
|
-
return encoderOptions;
|
|
304
|
-
}
|
|
305
|
-
// Return the video encoder options to use for HKSV.
|
|
306
|
-
recordEncoder(options) {
|
|
307
|
-
// We always disable smart quality when recording due to HomeKit's strict requirements here.
|
|
308
|
-
options.useSmartQuality = false;
|
|
309
|
-
// Generaly, we default to using the same encoding options we use to transcode livestreams, unless we have platform-specific quirks we need to address,
|
|
310
|
-
// such as where we can have hardware-accelerated transcoded livestreaming, but not hardware-accelerated HKSV event recording. The other noteworthy
|
|
311
|
-
// aspect here is that HKSV is quite specific in what it wants, and isn't vary tolerant of creative license in how you may choose to alter bitrate to
|
|
312
|
-
// address quality. When we call our encoders, we also let them know we don't want any additional quality optimizations when transcoding HKSV events.
|
|
313
|
-
switch (this.platform.hostSystem) {
|
|
314
|
-
case "raspbian":
|
|
315
|
-
// Raspberry Pi struggles with hardware-accelerated HKSV event recording due to issues in the FFmpeg codec driver, currently. We hope this improves
|
|
316
|
-
// over time and can offer it to Pi users, or develop a workaround. For now, we default to libx264.
|
|
317
|
-
return this.defaultVideoEncoderOptions(options);
|
|
318
|
-
default:
|
|
319
|
-
// By default, we use the same options for HKSV and streaming.
|
|
320
|
-
return this.streamEncoder(options);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
// Return the video encoder options to use when transcoding.
|
|
324
|
-
streamEncoder(options) {
|
|
325
|
-
// Default smart quality to true.
|
|
326
|
-
if (options.useSmartQuality === undefined) {
|
|
327
|
-
options.useSmartQuality = true;
|
|
328
|
-
}
|
|
329
|
-
// In case we don't have a defined pixel format.
|
|
330
|
-
if (!this.hwPixelFormat.length) {
|
|
331
|
-
this.hwPixelFormat.push("yuvj420p");
|
|
332
|
-
}
|
|
333
|
-
// If we aren't hardware-accelerated, we default to libx264.
|
|
334
|
-
if (!this.protectCamera.hints.hardwareTranscoding) {
|
|
335
|
-
return this.defaultVideoEncoderOptions(options);
|
|
336
|
-
}
|
|
337
|
-
// If we've enabled hardware-accelerated transcoding, let's select encoder options accordingly.
|
|
338
|
-
//
|
|
339
|
-
// We begin by adjusting the maximum bitrate tolerance used with -bufsize. This provides an upper bound on bitrate, with a little bit extra to allow encoders some
|
|
340
|
-
// variation in order to maximize quality while honoring bandwidth constraints.
|
|
341
|
-
const adjustedMaxBitrate = options.bitrate + (options.useSmartQuality ? PROTECT_HOMEKIT_STREAMING_HEADROOM : 0);
|
|
342
|
-
// Check the input and output frame rates to see if we need to change it.
|
|
343
|
-
const useFpsFilter = options.fps !== options.inputFps;
|
|
344
|
-
// Initialize our options.
|
|
345
|
-
const encoderOptions = [];
|
|
346
|
-
let videoFilters = [];
|
|
347
|
-
// Set our FFmpeg video filter options:
|
|
348
|
-
//
|
|
349
|
-
// format= Set the pixel formats we want to target for output.
|
|
350
|
-
videoFilters.push("format=" + this.hwPixelFormat.join("|"));
|
|
351
|
-
// scale=-2:min(ih\,height) Scale the video to the size that's being requested while respecting aspect ratios and ensuring our final dimensions are
|
|
352
|
-
// a power of two.
|
|
353
|
-
videoFilters.push("scale=-2:min(ih\\," + options.height.toString() + ")");
|
|
354
|
-
// Crop the stream, if the user has requested it.
|
|
355
|
-
if (this.protectCamera.hints.crop) {
|
|
356
|
-
videoFilters.push(this.cropFilter);
|
|
357
|
-
}
|
|
358
|
-
// fps=fps= Use the fps filter to provide the frame rate requested by HomeKit. This has better performance characteristics for Protect
|
|
359
|
-
// rather than using "-r". We only need to apply this filter if our input and output frame rates aren't already identical.
|
|
360
|
-
if (useFpsFilter) {
|
|
361
|
-
videoFilters.push("fps=fps=" + options.fps.toString());
|
|
362
|
-
}
|
|
363
|
-
switch (this.platform.hostSystem) {
|
|
364
|
-
case "macOS.Apple":
|
|
365
|
-
// h264_videotoolbox is the macOS hardware encoder API. We use the following options on Apple Silicon:
|
|
366
|
-
//
|
|
367
|
-
// -c:v Specify the macOS hardware encoder, h264_videotoolbox.
|
|
368
|
-
// -allow_sw 1 Allow the use of the software encoder if the hardware encoder is occupied or unavailable.
|
|
369
|
-
// This allows us to scale when we get multiple streaming requests simultaneously and consume all the available encode engines.
|
|
370
|
-
// -realtime 1 We prefer speed over quality - if the encoder has to make a choice, sacrifice one for the other.
|
|
371
|
-
// -coder cabac Use the cabac encoder for better video quality with the encoding profiles we use in HBUP.
|
|
372
|
-
// -profile:v Use the H.264 profile that HomeKit is requesting when encoding.
|
|
373
|
-
// -level:v 0 We override what HomeKit requests for the H.264 profile level on macOS when we're using hardware-accelerated transcoding because
|
|
374
|
-
// the hardware encoder is particular about how to use levels. Setting it to 0 allows the encoder to decide for itself.
|
|
375
|
-
// -bf 0 Disable B-frames when encoding to increase compatibility against occasionally finicky HomeKit clients.
|
|
376
|
-
// -noautoscale Don't attempt to scale the video stream automatically.
|
|
377
|
-
// -filter:v Set the pixel format, adjust the frame rate if needed, and scale the video to the size we want while respecting aspect ratios and
|
|
378
|
-
// ensuring our final dimensions are a power of two.
|
|
379
|
-
// -g:v Set the group of pictures to the number of frames per second * the interval in between keyframes to ensure a solid
|
|
380
|
-
// livestreamng exerience.
|
|
381
|
-
// -bufsize size This is the decoder buffer size, which drives the variability / quality of the output bitrate.
|
|
382
|
-
// -maxrate bitrate The maximum bitrate tolerance used in concert with -bufsize to constrain the maximum bitrate permitted.
|
|
383
|
-
encoderOptions.push("-c:v", "h264_videotoolbox", "-allow_sw", "1", "-realtime", "1", "-coder", "cabac", "-profile:v", this.getH264Profile(options.profile), "-level:v", "0", "-bf", "0", "-noautoscale", "-filter:v", videoFilters.join(", "), "-g:v", (options.fps * options.idrInterval).toString(), "-bufsize", (2 * options.bitrate).toString() + "k", "-maxrate", adjustedMaxBitrate.toString() + "k");
|
|
384
|
-
if (options.useSmartQuality) {
|
|
385
|
-
// -q:v 90 Use a fixed quality scale of 90, to allow videotoolbox the ability to vary bitrates to achieve the visual quality we want,
|
|
386
|
-
// constrained by our maximum bitrate. This is an Apple Silicon-specific feature.
|
|
387
|
-
encoderOptions.push("-q:v", "90");
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
// -b:v Average bitrate that's being requested by HomeKit.
|
|
391
|
-
encoderOptions.push("-b:v", options.bitrate.toString() + "k");
|
|
392
|
-
}
|
|
393
|
-
return encoderOptions;
|
|
394
|
-
case "macOS.Intel":
|
|
395
|
-
// h264_videotoolbox is the macOS hardware encoder API. We use the following options on Intel-based Macs:
|
|
396
|
-
//
|
|
397
|
-
// -c:v Specify the macOS hardware encoder, h264_videotoolbox.
|
|
398
|
-
// -allow_sw 1 Allow the use of the software encoder if the hardware encoder is occupied or unavailable.
|
|
399
|
-
// This allows us to scale when we get multiple streaming requests simultaneously that can consume all the available encode engines.
|
|
400
|
-
// -realtime 1 We prefer speed over quality - if the encoder has to make a choice, sacrifice one for the other.
|
|
401
|
-
// -coder cabac Use the cabac encoder for better video quality with the encoding profiles we use in HBUP.
|
|
402
|
-
// -profile:v Use the H.264 profile that HomeKit is requesting when encoding.
|
|
403
|
-
// -level:v 0 We override what HomeKit requests for the H.264 profile level on macOS when we're using hardware-accelerated transcoding because
|
|
404
|
-
// the hardware encoder is particular about how to use levels. Setting it to 0 allows the encoder to decide for itself.
|
|
405
|
-
// -bf 0 Disable B-frames when encoding to increase compatibility against occasionally finicky HomeKit clients.
|
|
406
|
-
// -noautoscale Don't attempt to scale the video stream automatically.
|
|
407
|
-
// -filter:v Set the pixel format, adjust the frame rate if needed, and scale the video to the size we want while respecting aspect ratios and
|
|
408
|
-
// ensuring our final dimensions are a power of two.
|
|
409
|
-
// -b:v Average bitrate that's being requested by HomeKit. We can't use a quality constraint and allow for more optimization of the
|
|
410
|
-
// bitrate on Intel-based Macs due to hardware / API limitations.
|
|
411
|
-
// -g:v Set the group of pictures to the number of frames per second * the interval in between keyframes to ensure a solid
|
|
412
|
-
// livestreaming exerience.
|
|
413
|
-
// -bufsize size This is the decoder buffer size, which drives the variability / quality of the output bitrate.
|
|
414
|
-
// -maxrate bitrate The maximum bitrate tolerance used in concert with -bufsize to constrain the maximum bitrate permitted.
|
|
415
|
-
return [
|
|
416
|
-
"-c:v", "h264_videotoolbox",
|
|
417
|
-
"-allow_sw", "1",
|
|
418
|
-
"-realtime", "1",
|
|
419
|
-
"-coder", "cabac",
|
|
420
|
-
"-profile:v", this.getH264Profile(options.profile),
|
|
421
|
-
"-level:v", "0",
|
|
422
|
-
"-bf", "0",
|
|
423
|
-
"-noautoscale",
|
|
424
|
-
"-filter:v", videoFilters.join(", "),
|
|
425
|
-
"-b:v", options.bitrate.toString() + "k",
|
|
426
|
-
"-g:v", (options.fps * options.idrInterval).toString(),
|
|
427
|
-
"-bufsize", (2 * options.bitrate).toString() + "k",
|
|
428
|
-
"-maxrate", adjustedMaxBitrate.toString() + "k"
|
|
429
|
-
];
|
|
430
|
-
case "raspbian":
|
|
431
|
-
// h264_v4l2m2m is the preferred interface to the Raspberry Pi hardware encoder API. We use the following options:
|
|
432
|
-
//
|
|
433
|
-
// -c:v Specify the Raspberry Pi hardware encoder, h264_v4l2m2m.
|
|
434
|
-
// -noautoscale Don't attempt to scale the video stream automatically.
|
|
435
|
-
// -filter:v Set the pixel format, adjust the frame rate if needed, and scale the video to the size we want while respecting aspect ratios and
|
|
436
|
-
// ensuring our final dimensions are a power of two.
|
|
437
|
-
// -b:v Average bitrate that's being requested by HomeKit. We can't use a quality constraint and allow for more optimization of the
|
|
438
|
-
// bitrate due to v4l2m2m limitations.
|
|
439
|
-
// -g:v Set the group of pictures to the number of frames per second * the interval in between keyframes to ensure a solid
|
|
440
|
-
// livestreamng exerience.
|
|
441
|
-
// -bufsize size This is the decoder buffer size, which drives the variability / quality of the output bitrate.
|
|
442
|
-
// -maxrate bitrate The maximum bitrate tolerance used in concert with -bufsize to constrain the maximum bitrate permitted.
|
|
443
|
-
return [
|
|
444
|
-
"-c:v", "h264_v4l2m2m",
|
|
445
|
-
"-profile:v", this.getH264Profile(options.profile, true),
|
|
446
|
-
"-bf", "0",
|
|
447
|
-
"-noautoscale",
|
|
448
|
-
"-reset_timestamps", "1",
|
|
449
|
-
"-filter:v", videoFilters.join(", "),
|
|
450
|
-
"-b:v", options.bitrate.toString() + "k",
|
|
451
|
-
"-g:v", (options.fps * options.idrInterval).toString(),
|
|
452
|
-
"-bufsize", (2 * options.bitrate).toString() + "k",
|
|
453
|
-
"-maxrate", adjustedMaxBitrate.toString() + "k"
|
|
454
|
-
];
|
|
455
|
-
default:
|
|
456
|
-
// Clear out any prior video filters.
|
|
457
|
-
videoFilters = [];
|
|
458
|
-
// We execute the following GPU-accelerated operations using the Quick Sync Video post-processing filter:
|
|
459
|
-
//
|
|
460
|
-
// format=same Set the output pixel format to the same as the input, since it's already in the GPU.
|
|
461
|
-
// w=...:h... Scale the video to the size that's being requested while respecting aspect ratios.
|
|
462
|
-
videoFilters.push("vpp_qsv=" + [
|
|
463
|
-
"format=same",
|
|
464
|
-
"w=min(iw\\, (iw / ih) * " + options.height.toString() + ")",
|
|
465
|
-
"h=min(ih\\, " + options.height.toString() + ")"
|
|
466
|
-
].join(":"));
|
|
467
|
-
// fps=fps= Use the fps filter to provide the frame rate requested by HomeKit. This has better performance characteristics for Protect
|
|
468
|
-
// rather than using "-r". We only need to apply this filter if our input and output frame rates aren't already identical.
|
|
469
|
-
if (useFpsFilter) {
|
|
470
|
-
videoFilters.push("fps=fps=" + options.fps.toString());
|
|
471
|
-
}
|
|
472
|
-
// h264_qsv is the Intel Quick Sync Video hardware encoder API. We use the following options:
|
|
473
|
-
//
|
|
474
|
-
// -c:v Specify the Intel Quick Sync Video hardware encoder, h264_qsv.
|
|
475
|
-
// -profile:v Use the H.264 profile that HomeKit is requesting when encoding.
|
|
476
|
-
// -level:v 0 We override what HomeKit requests for the H.264 profile level when we're using hardware-accelerated transcoding because
|
|
477
|
-
// the hardware encoder will determine which levels to use. Setting it to 0 allows the encoder to decide for itself.
|
|
478
|
-
// -bf 0 Disable B-frames when encoding to increase compatibility against occasionally finicky HomeKit clients.
|
|
479
|
-
// -noautoscale Don't attempt to scale the video stream automatically.
|
|
480
|
-
// -init_hw_device Initialize our hardware accelerator and assign it a name to be used in the FFmpeg command line.
|
|
481
|
-
// -filter_hw_device Specify the hardware accelerator to be used with our video filter pipeline.
|
|
482
|
-
// -filter:v Set the pixel format, adjust the frame rate if needed, and scale the video to the size we want while respecting aspect ratios and
|
|
483
|
-
// ensuring our final dimensions are a power of two.
|
|
484
|
-
// -g:v Set the group of pictures to the number of frames per second * the interval in between keyframes to ensure a solid
|
|
485
|
-
// livestreamng exerience.
|
|
486
|
-
// -bufsize size This is the decoder buffer size, which drives the variability / quality of the output bitrate.
|
|
487
|
-
// -maxrate bitrate The maximum bitrate tolerance used in concert with -bufsize to constrain the maximum bitrate permitted.
|
|
488
|
-
encoderOptions.push("-c:v", "h264_qsv", "-profile:v", this.getH264Profile(options.profile), "-level:v", "0", "-bf", "0", "-noautoscale", "-init_hw_device", "qsv=hw", "-filter_hw_device", "hw", "-filter:v", videoFilters.join(", "), "-g:v", (options.fps * options.idrInterval).toString(), "-bufsize", (2 * options.bitrate).toString() + "k", "-maxrate", adjustedMaxBitrate.toString() + "k");
|
|
489
|
-
if (options.useSmartQuality) {
|
|
490
|
-
// -global_quality 20 Use a global quality setting of 20, to allow QSV the ability to vary bitrates to achieve the visual quality we want,
|
|
491
|
-
// constrained by our maximum bitrate. This leverages a QSV-specific feature known as intelligent constant quality.
|
|
492
|
-
encoderOptions.push("-global_quality", "20");
|
|
493
|
-
}
|
|
494
|
-
else {
|
|
495
|
-
// -b:v Average bitrate that's being requested by HomeKit.
|
|
496
|
-
encoderOptions.push("-b:v", options.bitrate.toString() + "k");
|
|
497
|
-
}
|
|
498
|
-
return encoderOptions;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
// Use the host system information to determine which recording channel to use by default for HKSV.
|
|
502
|
-
get recordingDefaultChannel() {
|
|
503
|
-
switch (this.platform.hostSystem) {
|
|
504
|
-
case "raspbian":
|
|
505
|
-
// For constrained CPU environments like Raspberry Pi, we default to recording from the highest quality channel we can, that's at or below 1080p. That provides
|
|
506
|
-
// a reasonable default, while still allowing users who really want to, to be able to specify something else.
|
|
507
|
-
return this.protectCamera.findRtsp(1920, 1080, { maxPixels: this.hostSystemMaxPixels })?.channel.name ?? undefined;
|
|
508
|
-
default:
|
|
509
|
-
// We default to no preference for the default Protect camera channel.
|
|
510
|
-
return this.protectCamera.hints.hardwareTranscoding ? "High" : undefined;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
// Return the maximum pixel count supported by a specific hardware encoder on the host system.
|
|
514
|
-
get hostSystemMaxPixels() {
|
|
515
|
-
if (this.protectCamera.hints.hardwareTranscoding) {
|
|
516
|
-
switch (this.platform.hostSystem) {
|
|
517
|
-
case "raspbian":
|
|
518
|
-
// For constrained environments like Raspberry Pi, when hardware transcoding has been selected for a camera, we limit the available source streams to no more
|
|
519
|
-
// than 1080p. In practice, that means that devices like the G4 Pro can't use their highest quality stream for transcoding due to the limitations of the
|
|
520
|
-
// Raspberry Pi GPU that cannot support higher pixel counts.
|
|
521
|
-
return 1920 * 1080;
|
|
522
|
-
default:
|
|
523
|
-
break;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return Infinity;
|
|
527
|
-
}
|
|
528
|
-
// Translate HomeKit H.264 level information for FFmpeg.
|
|
529
|
-
getH264Level(level, numeric = false) {
|
|
530
|
-
switch (level) {
|
|
531
|
-
case 0 /* H264Level.LEVEL3_1 */:
|
|
532
|
-
return numeric ? "31" : "3.1";
|
|
533
|
-
case 1 /* H264Level.LEVEL3_2 */:
|
|
534
|
-
return numeric ? "32" : "3.2";
|
|
535
|
-
case 2 /* H264Level.LEVEL4_0 */:
|
|
536
|
-
return numeric ? "40" : "4.0";
|
|
537
|
-
default:
|
|
538
|
-
return numeric ? "31" : "3.1";
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
// Translate HomeKit H.264 profile information for FFmpeg.
|
|
542
|
-
getH264Profile(profile, numeric = false) {
|
|
543
|
-
switch (profile) {
|
|
544
|
-
case 0 /* H264Profile.BASELINE */:
|
|
545
|
-
return numeric ? "66" : "baseline";
|
|
546
|
-
case 2 /* H264Profile.HIGH */:
|
|
547
|
-
return numeric ? "100" : "high";
|
|
548
|
-
case 1 /* H264Profile.MAIN */:
|
|
549
|
-
return numeric ? "77" : "main";
|
|
550
|
-
default:
|
|
551
|
-
return numeric ? "77" : "main";
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
//# sourceMappingURL=protect-ffmpeg-options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protect-ffmpeg-options.js","sourceRoot":"","sources":["../../src/ffmpeg/protect-ffmpeg-options.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kCAAkC,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAkB7F,MAAM,OAAO,aAAa;IAEP,aAAa,CAAW;IACxB,GAAG,CAA0B;IAC7B,QAAQ,CAAkB;IAC1B,aAAa,CAAgB;IAE9C,sDAAsD;IACtD,YAAY,aAA4B;QAEtC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,+CAA+C;QAC/C,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,uDAAuD;IAC/C,gBAAgB;QAEtB,IAAI,UAAU,GAAG,EAAE,CAAC;QAEpB,wFAAwF;QACxF,MAAM,eAAe,GAAG,GAAW,EAAE;YAEnC,MAAM,UAAU,GAAG,EAAE,CAAC;YAEtB,IAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBAE7C,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9B,CAAC;YAED,IAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC;gBAEhD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,CAAC;YAED,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC;QAEF,sIAAsI;QACtI,IAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,gBAAgB,EAAE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AO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;YAEhC;gBAEE,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAClC,CAAC;IACH,CAAC;IAED,0DAA0D;IAClD,cAAc,CAAC,OAAoB,EAAE,OAAO,GAAG,KAAK;QAE1D,QAAO,OAAO,EAAE,CAAC;YAEf;gBAEE,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;YAErC;gBAEE,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;YAElC;gBAEE,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;YAEjC;gBAEE,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;QACnC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ProtectCamera, RtspEntry } from "../devices/index.js";
|
|
2
|
-
import { CameraRecordingConfiguration } from "homebridge";
|
|
3
|
-
import { FfmpegProcess } from "./protect-ffmpeg.js";
|
|
4
|
-
export declare class FfmpegRecordingProcess extends FfmpegProcess {
|
|
5
|
-
private isLoggingErrors;
|
|
6
|
-
isTimedOut: boolean;
|
|
7
|
-
private recordingBuffer;
|
|
8
|
-
private recordingConfig;
|
|
9
|
-
constructor(protectCamera: ProtectCamera, recordingConfig: CameraRecordingConfiguration, rtspEntry: RtspEntry, isAudioActive: boolean);
|
|
10
|
-
protected configureProcess(): void;
|
|
11
|
-
protected stopProcess(): void;
|
|
12
|
-
stop(logErrors?: boolean): void;
|
|
13
|
-
protected logFfmpegError(exitCode: number, signal: NodeJS.Signals): void;
|
|
14
|
-
segmentGenerator(): AsyncGenerator<Buffer>;
|
|
15
|
-
}
|