@apocaliss92/nodelink-js 0.5.1 → 0.6.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/index.d.cts CHANGED
@@ -86,6 +86,8 @@ declare const BC_CMD_ID_FLOODLIGHT_STATUS_LIST = 291;
86
86
  declare const BC_CMD_ID_ABILITY_INFO = 151;
87
87
  declare const BC_CMD_ID_SUPPORT = 199;
88
88
  declare const BC_CMD_ID_PING = 93;
89
+ declare const BC_CMD_ID_DEVICE_DETECT_CANDIDATES: readonly [31, 132, 150];
90
+ declare const BC_CMD_ID_DEVICE_DETECT: number | null;
89
91
  declare const BC_CMD_ID_GET_SNAPSHOT = 109;
90
92
  declare const BC_CMD_ID_GET_UID = 114;
91
93
  declare const BC_CMD_ID_CHANNEL_INFO_ALL = 145;
@@ -3060,6 +3062,15 @@ type BcUdpStreamOptions = {
3060
3062
  * - `relay`: fully relayed via Reolink servers
3061
3063
  */
3062
3064
  discoveryMethod?: BcUdpDiscoveryMethod;
3065
+ /**
3066
+ * Override the default 15s timeout on local-direct / local-broadcast
3067
+ * BCUDP discovery (the time we'll wait for a camera reply after
3068
+ * sending C2D_S probes). Battery cams that are awake reply in
3069
+ * 1-5s — keeping the default short collapses the user-visible
3070
+ * failure path for off-LAN / sleeping cameras. Raise this only
3071
+ * for pathologically slow LANs where 15s is genuinely not enough.
3072
+ */
3073
+ localDiscoveryTimeoutMs?: number;
3063
3074
  } | {
3064
3075
  /** Direct connection with already-known parameters. */
3065
3076
  mode: "direct";
@@ -3088,6 +3099,16 @@ declare class BcUdpStream extends EventEmitter<{
3088
3099
  debug: [string, unknown?];
3089
3100
  }> {
3090
3101
  private readonly opts;
3102
+ /**
3103
+ * Optional info-level logger for diagnostic milestones — set via
3104
+ * {@link BcUdpStream.setLogger} by `BaichuanClient` so the lib's
3105
+ * standard logger sink sees BCUDP / P2P progress (DNS resolutions,
3106
+ * outgoing UDP probes, timeouts with elapsed times) without the user
3107
+ * having to opt into the per-packet `debug` event firehose. Kept
3108
+ * separate from `emit('debug', ...)` because that channel is intended
3109
+ * for the per-packet debug trace and is gated by debugOptions.
3110
+ */
3111
+ private discoveryLogger;
3091
3112
  private sock;
3092
3113
  private remote?;
3093
3114
  private mtu;
@@ -3115,6 +3136,15 @@ declare class BcUdpStream extends EventEmitter<{
3115
3136
  private getKeepAliveTid;
3116
3137
  constructor(options: BcUdpStreamOptions);
3117
3138
  /** True if the underlying UDP socket is open and the remote peer is known. */
3139
+ /**
3140
+ * Attach an info-level logger for high-signal diagnostic milestones
3141
+ * (DNS resolution, outgoing UDP probe sends, P2P UID lookup wins/losses,
3142
+ * BCUDP local discovery timeouts). The lib's `BaichuanClient` calls
3143
+ * this immediately after constructing the stream so consumers get
3144
+ * actionable progress logs without enabling the per-packet debug trace.
3145
+ * Safe to call repeatedly; only the most recent logger is used.
3146
+ */
3147
+ setLogger(logger: Logger | undefined): void;
3118
3148
  isConnected(): boolean;
3119
3149
  connect(): Promise<void>;
3120
3150
  private discoveryUid;
@@ -5254,6 +5284,88 @@ interface CompositeStreamPipOptions {
5254
5284
  teleRtspUrl?: string;
5255
5285
  /** ffmpeg `-rtsp_transport` value (default: tcp). */
5256
5286
  rtspTransport?: 'tcp' | 'udp';
5287
+ /**
5288
+ * Absolute path to the `ffmpeg` binary the compositor should `spawn()`.
5289
+ *
5290
+ * When unset, falls back to the bare string `"ffmpeg"`, which relies on
5291
+ * the host's `PATH`. This works on standard Linux / macOS Node setups
5292
+ * but fails silently on environments where the embedding process
5293
+ * strips PATH or ships its own ffmpeg in a non-discoverable location:
5294
+ *
5295
+ * - Scrypted on Windows (the Electron host launches plugins with a
5296
+ * minimal PATH; the bundled ffmpeg lives at a static absolute path
5297
+ * only `sdk.mediaManager.getFFmpegPath()` knows about).
5298
+ * - Scrypted on macOS App Store / sandboxed installs.
5299
+ * - Distroless / minimal Docker base images where ffmpeg is mounted
5300
+ * at a fixed path but not in PATH.
5301
+ *
5302
+ * Consumers in any of those environments should resolve the path
5303
+ * themselves (e.g. via the Scrypted SDK) and pass it through here.
5304
+ */
5305
+ ffmpegPath?: string;
5306
+ /**
5307
+ * Output video encoder name (passed verbatim as `-c:v`). Default
5308
+ * `libx264` — pure software. On a host with hardware-accelerated
5309
+ * H.264 encoding, switching this is the single biggest perf win
5310
+ * available (5-10x less CPU for the same output bitrate). Supported
5311
+ * by ffmpeg in the wild:
5312
+ *
5313
+ * - Intel/AMD QuickSync: `h264_qsv`
5314
+ * - Intel/AMD VAAPI: `h264_vaapi`
5315
+ * - NVIDIA NVENC: `h264_nvenc`
5316
+ * - Apple VideoToolbox: `h264_videotoolbox`
5317
+ * - Raspberry Pi / ARM: `h264_v4l2m2m`
5318
+ *
5319
+ * Caveat: when not `libx264`, the libx264-specific knobs
5320
+ * (`encoderPreset`, `crf`, `x264-params`) are silently dropped because
5321
+ * each HW encoder has its own option vocabulary. Use
5322
+ * {@link extraOutputArgs} to pass encoder-specific options
5323
+ * (e.g. `["-q:v","23"]` for QSV, `["-preset","fast"]` for NVENC).
5324
+ */
5325
+ videoEncoder?: string;
5326
+ /**
5327
+ * libx264 preset (default `ultrafast`). Only consulted when
5328
+ * {@link videoEncoder} is left at its default (libx264). Valid:
5329
+ * `ultrafast | superfast | veryfast | faster | fast | medium | slow |
5330
+ * slower | veryslow | placebo`. Slower = better compression / more CPU.
5331
+ */
5332
+ encoderPreset?: string;
5333
+ /**
5334
+ * CRF (constant rate factor) for libx264. Default 23 (visually
5335
+ * lossless-ish). Range 0 (lossless, huge) — 51 (worst, tiny). Lower
5336
+ * by 2 to roughly halve the bitrate at a given quality. Only consulted
5337
+ * when {@link videoEncoder} is libx264.
5338
+ */
5339
+ crf?: number;
5340
+ /**
5341
+ * Output keyframe interval in seconds. Default 1 — important for
5342
+ * mid-stream join latency (a new HLS / RTSP client only starts
5343
+ * decoding from the next keyframe). Lower = faster join, larger
5344
+ * stream; higher = better compression, slower join.
5345
+ */
5346
+ gopSeconds?: number;
5347
+ /**
5348
+ * Free-form ffmpeg arguments inserted at the START of the argv (after
5349
+ * `-hide_banner -loglevel`). Use for hardware-accel decode hints that
5350
+ * must appear before any `-i`:
5351
+ *
5352
+ * extraGlobalArgs: ["-hwaccel","videotoolbox"]
5353
+ * extraGlobalArgs: ["-hwaccel","qsv","-qsv_device","/dev/dri/renderD128"]
5354
+ *
5355
+ * No validation — invalid args here WILL crash ffmpeg.
5356
+ */
5357
+ extraGlobalArgs?: readonly string[];
5358
+ /**
5359
+ * Free-form ffmpeg arguments inserted just BEFORE the `pipe:1` output.
5360
+ * Use for encoder-specific options when {@link videoEncoder} is not
5361
+ * `libx264`:
5362
+ *
5363
+ * extraOutputArgs: ["-q:v","23"] // qsv/vaapi
5364
+ * extraOutputArgs: ["-preset","fast","-rc","cbr"] // nvenc
5365
+ *
5366
+ * No validation — invalid args here WILL crash ffmpeg.
5367
+ */
5368
+ extraOutputArgs?: readonly string[];
5257
5369
  }
5258
5370
  type CompositeStreamOptions = {
5259
5371
  api: ReolinkBaichuanApi;
@@ -5296,6 +5408,24 @@ type CompositeStreamOptions = {
5296
5408
  teleRtspUrl?: string;
5297
5409
  /** ffmpeg `-rtsp_transport` value (default: tcp). */
5298
5410
  rtspTransport?: 'tcp' | 'udp';
5411
+ /**
5412
+ * Absolute path to the `ffmpeg` binary the compositor should `spawn()`.
5413
+ * Mirrors {@link CompositeStreamPipOptions.ffmpegPath} — see its docstring
5414
+ * for the rationale. Defaults to `"ffmpeg"` (PATH lookup) when unset.
5415
+ */
5416
+ ffmpegPath?: string;
5417
+ /** See {@link CompositeStreamPipOptions.videoEncoder}. */
5418
+ videoEncoder?: string;
5419
+ /** See {@link CompositeStreamPipOptions.encoderPreset}. */
5420
+ encoderPreset?: string;
5421
+ /** See {@link CompositeStreamPipOptions.crf}. */
5422
+ crf?: number;
5423
+ /** See {@link CompositeStreamPipOptions.gopSeconds}. */
5424
+ gopSeconds?: number;
5425
+ /** See {@link CompositeStreamPipOptions.extraGlobalArgs}. */
5426
+ extraGlobalArgs?: readonly string[];
5427
+ /** See {@link CompositeStreamPipOptions.extraOutputArgs}. */
5428
+ extraOutputArgs?: readonly string[];
5299
5429
  /**
5300
5430
  * How long to wait for each input stream to produce frames before starting ffmpeg.
5301
5431
  * Battery cameras can take several seconds to wake and begin streaming.
@@ -11459,6 +11589,16 @@ type AutoDetectInputs = {
11459
11589
  * If omitted, autodetect will try `local-direct`, then `local-broadcast`, then `remote`, then `relay`, then `map`.
11460
11590
  */
11461
11591
  udpDiscoveryMethod?: BaichuanClientOptions["udpDiscoveryMethod"];
11592
+ /**
11593
+ * Hard upper bound on the TCP connect + Baichuan login attempt. The
11594
+ * macOS / Linux TCP stack normally takes 60-160s to return
11595
+ * EHOSTDOWN / EHOSTUNREACH (ARP retry chain). Without a deadline,
11596
+ * autodetect against an unreachable host blocks for that entire
11597
+ * window even though the parallel UDP race already failed. Defaults
11598
+ * to 8s — well above a healthy LAN login (~250ms) and well below
11599
+ * the OS chain. Tune higher only for legitimately slow links.
11600
+ */
11601
+ tcpConnectTimeoutMs?: number;
11462
11602
  };
11463
11603
  type UdpDiscoveryMethod = NonNullable<BaichuanClientOptions["udpDiscoveryMethod"]>;
11464
11604
  /**
@@ -12085,4 +12225,4 @@ interface CreateEmailPushServerParams {
12085
12225
  declare function getCameraEmailAddress(cameraId: string, domain: string): string;
12086
12226
  declare function createEmailPushServer(params: CreateEmailPushServerParams): EmailPushServerInstance;
12087
12227
 
12088
- export { type AIDetectionState, type AIEvent, type AIState, ALL_UDP_DISCOVERY_METHODS, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiDetectCfgZone, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, type AutoRebootConfig, type AutoRebootConfigPatch, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_AUTO_REBOOT, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_DST, BC_CMD_ID_GET_EMAIL, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_NTP, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_SNAPSHOT, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_UID, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_AUTO_REBOOT, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_DST, BC_CMD_ID_SET_EMAIL, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_NTP, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_SYSTEM_GENERAL, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_TEST_EMAIL, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BackchannelCodec, type BackchannelRoute, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFloodlightStatusPush, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspBackchannelServer, type BaichuanRtspBackchannelServerOptions, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSirenStatusPush, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, type CreateEmailPushServerParams, DEFAULT_SHELTER_CANVAS, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DayOfWeek, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DstConfig, type DstConfigPatch, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailAttachmentType, type EmailConfig, type EmailConfigPatch, type EmailPushEvent, type EmailPushInferredType, type EmailPushLogger, type EmailPushServerConfig, type EmailPushServerInstance, type EmailPushServerStatus, type EmailPushTlsOptions, type EmailTaskConfig, type EmailTaskScheduleItem, type EmailTextType, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FloodlightTaskState, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LoadTlsParams, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionSensitivityBand, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NtpConfig, type NtpConfigPatch, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdDateFormat, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PrivacyMaskZones, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, RtspBackchannel, type RtspBackchannelOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type ShelterCanvas, type ShelterRect, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type SystemGeneralPatch, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimeFormat, type TimelapseCfgConfig, type TrackShelterRect, type TwoWayAudioConfig, type UdpDiscoveryMethod, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type XmlJsonObject, type XmlJsonPrimitive, type XmlJsonValue, type ZoomFocusStatus, type ZoomFocusTriplet, _resetEmailPushBusForTests, abilitiesHasAny, aesDecrypt, aesEncrypt, alawToPcm16, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createEmailPushServer, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeAiDetectCfg, decodeHeader, decodeMotionScopeBitmap, decodePrivacyMaskZones, decodeShelterCoord, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, emitEmailPushEvent, encodeHeader, encodeImaAdpcm, encodeMotionScopeBitmap, encodeMotionSensitivityListXml, encodeShelterCoord, encodeShelterListXml, encodeTrackShelterListXml, ensureXmlHeader, extractCanvasFromShelterXml, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getCameraEmailAddress, getConstructedVideoStreamOptions, getEmailPushCameraResolver, getGlobalLogger, getH265NalType, getLastEmailPushEvent, getMjpegContentType, getRecentEmailPushEvents, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isUnroutableForP2P, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, loadEmailPushTls, mapEmailPushInferredType, maskUid, md5HexUpper, md5StrModern, mulawToPcm16, normalizeDayNightMode, normalizeOpenClose, normalizeUid, onEmailPushEvent, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseRtpPacket, parseSupportXml, patchAiDetectCfgXml, patchMotionSensitivityListXml, patchNestedTag, patchShelterXml, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, selectViableUdpMethods, setEmailPushCameraResolver, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, tcpReachabilityProbe, testChannelStreams, upsamplePcm16, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
12228
+ export { type AIDetectionState, type AIEvent, type AIState, ALL_UDP_DISCOVERY_METHODS, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiDetectCfgZone, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, type AutoRebootConfig, type AutoRebootConfigPatch, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DEVICE_DETECT, BC_CMD_ID_DEVICE_DETECT_CANDIDATES, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_AUTO_REBOOT, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_DST, BC_CMD_ID_GET_EMAIL, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_NTP, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_SNAPSHOT, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_UID, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_AUTO_REBOOT, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_DST, BC_CMD_ID_SET_EMAIL, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_NTP, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_SYSTEM_GENERAL, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_TEST_EMAIL, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BackchannelCodec, type BackchannelRoute, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFloodlightStatusPush, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspBackchannelServer, type BaichuanRtspBackchannelServerOptions, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSirenStatusPush, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, type CreateEmailPushServerParams, DEFAULT_SHELTER_CANVAS, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DayOfWeek, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DstConfig, type DstConfigPatch, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailAttachmentType, type EmailConfig, type EmailConfigPatch, type EmailPushEvent, type EmailPushInferredType, type EmailPushLogger, type EmailPushServerConfig, type EmailPushServerInstance, type EmailPushServerStatus, type EmailPushTlsOptions, type EmailTaskConfig, type EmailTaskScheduleItem, type EmailTextType, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FloodlightTaskState, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LoadTlsParams, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionSensitivityBand, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NtpConfig, type NtpConfigPatch, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdDateFormat, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PrivacyMaskZones, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, RtspBackchannel, type RtspBackchannelOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type ShelterCanvas, type ShelterRect, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type SystemGeneralPatch, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimeFormat, type TimelapseCfgConfig, type TrackShelterRect, type TwoWayAudioConfig, type UdpDiscoveryMethod, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type XmlJsonObject, type XmlJsonPrimitive, type XmlJsonValue, type ZoomFocusStatus, type ZoomFocusTriplet, _resetEmailPushBusForTests, abilitiesHasAny, aesDecrypt, aesEncrypt, alawToPcm16, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createEmailPushServer, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeAiDetectCfg, decodeHeader, decodeMotionScopeBitmap, decodePrivacyMaskZones, decodeShelterCoord, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, emitEmailPushEvent, encodeHeader, encodeImaAdpcm, encodeMotionScopeBitmap, encodeMotionSensitivityListXml, encodeShelterCoord, encodeShelterListXml, encodeTrackShelterListXml, ensureXmlHeader, extractCanvasFromShelterXml, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getCameraEmailAddress, getConstructedVideoStreamOptions, getEmailPushCameraResolver, getGlobalLogger, getH265NalType, getLastEmailPushEvent, getMjpegContentType, getRecentEmailPushEvents, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isUnroutableForP2P, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, loadEmailPushTls, mapEmailPushInferredType, maskUid, md5HexUpper, md5StrModern, mulawToPcm16, normalizeDayNightMode, normalizeOpenClose, normalizeUid, onEmailPushEvent, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseRtpPacket, parseSupportXml, patchAiDetectCfgXml, patchMotionSensitivityListXml, patchNestedTag, patchShelterXml, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, selectViableUdpMethods, setEmailPushCameraResolver, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, tcpReachabilityProbe, testChannelStreams, upsamplePcm16, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
package/dist/index.d.ts CHANGED
@@ -373,6 +373,16 @@ export declare type AutoDetectInputs = {
373
373
  * If omitted, autodetect will try `local-direct`, then `local-broadcast`, then `remote`, then `relay`, then `map`.
374
374
  */
375
375
  udpDiscoveryMethod?: BaichuanClientOptions["udpDiscoveryMethod"];
376
+ /**
377
+ * Hard upper bound on the TCP connect + Baichuan login attempt. The
378
+ * macOS / Linux TCP stack normally takes 60-160s to return
379
+ * EHOSTDOWN / EHOSTUNREACH (ARP retry chain). Without a deadline,
380
+ * autodetect against an unreachable host blocks for that entire
381
+ * window even though the parallel UDP race already failed. Defaults
382
+ * to 8s — well above a healthy LAN login (~250ms) and well below
383
+ * the OS chain. Tune higher only for legitimately slow links.
384
+ */
385
+ tcpConnectTimeoutMs?: number;
376
386
  };
377
387
 
378
388
  export declare type AutoDetectMode = "auto" | BaichuanTransport;
@@ -2436,6 +2446,10 @@ export declare const BC_CMD_ID_COVER_STANDALONE_461 = 461;
2436
2446
 
2437
2447
  export declare const BC_CMD_ID_COVER_STANDALONE_462 = 462;
2438
2448
 
2449
+ export declare const BC_CMD_ID_DEVICE_DETECT: number | null;
2450
+
2451
+ export declare const BC_CMD_ID_DEVICE_DETECT_CANDIDATES: readonly [31, 132, 150];
2452
+
2439
2453
  export declare const BC_CMD_ID_DING_DONG_CTRL = 483;
2440
2454
 
2441
2455
  export declare const BC_CMD_ID_DING_DONG_OPT = 485;
@@ -2910,6 +2924,16 @@ export declare class BcUdpStream extends EventEmitter<{
2910
2924
  debug: [string, unknown?];
2911
2925
  }> {
2912
2926
  private readonly opts;
2927
+ /**
2928
+ * Optional info-level logger for diagnostic milestones — set via
2929
+ * {@link BcUdpStream.setLogger} by `BaichuanClient` so the lib's
2930
+ * standard logger sink sees BCUDP / P2P progress (DNS resolutions,
2931
+ * outgoing UDP probes, timeouts with elapsed times) without the user
2932
+ * having to opt into the per-packet `debug` event firehose. Kept
2933
+ * separate from `emit('debug', ...)` because that channel is intended
2934
+ * for the per-packet debug trace and is gated by debugOptions.
2935
+ */
2936
+ private discoveryLogger;
2913
2937
  private sock;
2914
2938
  private remote?;
2915
2939
  private mtu;
@@ -2937,6 +2961,15 @@ export declare class BcUdpStream extends EventEmitter<{
2937
2961
  private getKeepAliveTid;
2938
2962
  constructor(options: BcUdpStreamOptions);
2939
2963
  /** True if the underlying UDP socket is open and the remote peer is known. */
2964
+ /**
2965
+ * Attach an info-level logger for high-signal diagnostic milestones
2966
+ * (DNS resolution, outgoing UDP probe sends, P2P UID lookup wins/losses,
2967
+ * BCUDP local discovery timeouts). The lib's `BaichuanClient` calls
2968
+ * this immediately after constructing the stream so consumers get
2969
+ * actionable progress logs without enabling the per-packet debug trace.
2970
+ * Safe to call repeatedly; only the most recent logger is used.
2971
+ */
2972
+ setLogger(logger: Logger | undefined): void;
2940
2973
  isConnected(): boolean;
2941
2974
  connect(): Promise<void>;
2942
2975
  private discoveryUid;
@@ -2988,6 +3021,15 @@ export declare type BcUdpStreamOptions = {
2988
3021
  * - `relay`: fully relayed via Reolink servers
2989
3022
  */
2990
3023
  discoveryMethod?: BcUdpDiscoveryMethod;
3024
+ /**
3025
+ * Override the default 15s timeout on local-direct / local-broadcast
3026
+ * BCUDP discovery (the time we'll wait for a camera reply after
3027
+ * sending C2D_S probes). Battery cams that are awake reply in
3028
+ * 1-5s — keeping the default short collapses the user-visible
3029
+ * failure path for off-LAN / sleeping cameras. Raise this only
3030
+ * for pathologically slow LANs where 15s is genuinely not enough.
3031
+ */
3032
+ localDiscoveryTimeoutMs?: number;
2991
3033
  } | {
2992
3034
  /** Direct connection with already-known parameters. */
2993
3035
  mode: "direct";
@@ -4103,6 +4145,24 @@ export declare type CompositeStreamOptions = {
4103
4145
  teleRtspUrl?: string;
4104
4146
  /** ffmpeg `-rtsp_transport` value (default: tcp). */
4105
4147
  rtspTransport?: 'tcp' | 'udp';
4148
+ /**
4149
+ * Absolute path to the `ffmpeg` binary the compositor should `spawn()`.
4150
+ * Mirrors {@link CompositeStreamPipOptions.ffmpegPath} — see its docstring
4151
+ * for the rationale. Defaults to `"ffmpeg"` (PATH lookup) when unset.
4152
+ */
4153
+ ffmpegPath?: string;
4154
+ /** See {@link CompositeStreamPipOptions.videoEncoder}. */
4155
+ videoEncoder?: string;
4156
+ /** See {@link CompositeStreamPipOptions.encoderPreset}. */
4157
+ encoderPreset?: string;
4158
+ /** See {@link CompositeStreamPipOptions.crf}. */
4159
+ crf?: number;
4160
+ /** See {@link CompositeStreamPipOptions.gopSeconds}. */
4161
+ gopSeconds?: number;
4162
+ /** See {@link CompositeStreamPipOptions.extraGlobalArgs}. */
4163
+ extraGlobalArgs?: readonly string[];
4164
+ /** See {@link CompositeStreamPipOptions.extraOutputArgs}. */
4165
+ extraOutputArgs?: readonly string[];
4106
4166
  /**
4107
4167
  * How long to wait for each input stream to produce frames before starting ffmpeg.
4108
4168
  * Battery cameras can take several seconds to wake and begin streaming.
@@ -4150,6 +4210,88 @@ export declare interface CompositeStreamPipOptions {
4150
4210
  teleRtspUrl?: string;
4151
4211
  /** ffmpeg `-rtsp_transport` value (default: tcp). */
4152
4212
  rtspTransport?: 'tcp' | 'udp';
4213
+ /**
4214
+ * Absolute path to the `ffmpeg` binary the compositor should `spawn()`.
4215
+ *
4216
+ * When unset, falls back to the bare string `"ffmpeg"`, which relies on
4217
+ * the host's `PATH`. This works on standard Linux / macOS Node setups
4218
+ * but fails silently on environments where the embedding process
4219
+ * strips PATH or ships its own ffmpeg in a non-discoverable location:
4220
+ *
4221
+ * - Scrypted on Windows (the Electron host launches plugins with a
4222
+ * minimal PATH; the bundled ffmpeg lives at a static absolute path
4223
+ * only `sdk.mediaManager.getFFmpegPath()` knows about).
4224
+ * - Scrypted on macOS App Store / sandboxed installs.
4225
+ * - Distroless / minimal Docker base images where ffmpeg is mounted
4226
+ * at a fixed path but not in PATH.
4227
+ *
4228
+ * Consumers in any of those environments should resolve the path
4229
+ * themselves (e.g. via the Scrypted SDK) and pass it through here.
4230
+ */
4231
+ ffmpegPath?: string;
4232
+ /**
4233
+ * Output video encoder name (passed verbatim as `-c:v`). Default
4234
+ * `libx264` — pure software. On a host with hardware-accelerated
4235
+ * H.264 encoding, switching this is the single biggest perf win
4236
+ * available (5-10x less CPU for the same output bitrate). Supported
4237
+ * by ffmpeg in the wild:
4238
+ *
4239
+ * - Intel/AMD QuickSync: `h264_qsv`
4240
+ * - Intel/AMD VAAPI: `h264_vaapi`
4241
+ * - NVIDIA NVENC: `h264_nvenc`
4242
+ * - Apple VideoToolbox: `h264_videotoolbox`
4243
+ * - Raspberry Pi / ARM: `h264_v4l2m2m`
4244
+ *
4245
+ * Caveat: when not `libx264`, the libx264-specific knobs
4246
+ * (`encoderPreset`, `crf`, `x264-params`) are silently dropped because
4247
+ * each HW encoder has its own option vocabulary. Use
4248
+ * {@link extraOutputArgs} to pass encoder-specific options
4249
+ * (e.g. `["-q:v","23"]` for QSV, `["-preset","fast"]` for NVENC).
4250
+ */
4251
+ videoEncoder?: string;
4252
+ /**
4253
+ * libx264 preset (default `ultrafast`). Only consulted when
4254
+ * {@link videoEncoder} is left at its default (libx264). Valid:
4255
+ * `ultrafast | superfast | veryfast | faster | fast | medium | slow |
4256
+ * slower | veryslow | placebo`. Slower = better compression / more CPU.
4257
+ */
4258
+ encoderPreset?: string;
4259
+ /**
4260
+ * CRF (constant rate factor) for libx264. Default 23 (visually
4261
+ * lossless-ish). Range 0 (lossless, huge) — 51 (worst, tiny). Lower
4262
+ * by 2 to roughly halve the bitrate at a given quality. Only consulted
4263
+ * when {@link videoEncoder} is libx264.
4264
+ */
4265
+ crf?: number;
4266
+ /**
4267
+ * Output keyframe interval in seconds. Default 1 — important for
4268
+ * mid-stream join latency (a new HLS / RTSP client only starts
4269
+ * decoding from the next keyframe). Lower = faster join, larger
4270
+ * stream; higher = better compression, slower join.
4271
+ */
4272
+ gopSeconds?: number;
4273
+ /**
4274
+ * Free-form ffmpeg arguments inserted at the START of the argv (after
4275
+ * `-hide_banner -loglevel`). Use for hardware-accel decode hints that
4276
+ * must appear before any `-i`:
4277
+ *
4278
+ * extraGlobalArgs: ["-hwaccel","videotoolbox"]
4279
+ * extraGlobalArgs: ["-hwaccel","qsv","-qsv_device","/dev/dri/renderD128"]
4280
+ *
4281
+ * No validation — invalid args here WILL crash ffmpeg.
4282
+ */
4283
+ extraGlobalArgs?: readonly string[];
4284
+ /**
4285
+ * Free-form ffmpeg arguments inserted just BEFORE the `pipe:1` output.
4286
+ * Use for encoder-specific options when {@link videoEncoder} is not
4287
+ * `libx264`:
4288
+ *
4289
+ * extraOutputArgs: ["-q:v","23"] // qsv/vaapi
4290
+ * extraOutputArgs: ["-preset","fast","-rc","cbr"] // nvenc
4291
+ *
4292
+ * No validation — invalid args here WILL crash ffmpeg.
4293
+ */
4294
+ extraOutputArgs?: readonly string[];
4153
4295
  }
4154
4296
 
4155
4297
  /**
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ import {
69
69
  setGlobalLogger,
70
70
  tcpReachabilityProbe,
71
71
  xmlIndicatesFloodlight
72
- } from "./chunk-OJQLZETO.js";
72
+ } from "./chunk-7HSTETZR.js";
73
73
  import {
74
74
  ReolinkCgiApi,
75
75
  ReolinkHttpClient,
@@ -116,7 +116,7 @@ import {
116
116
  upsertXmlTag,
117
117
  xmlEscape,
118
118
  zipDirectory
119
- } from "./chunk-VOPEOB4H.js";
119
+ } from "./chunk-XDVBNZGR.js";
120
120
  import {
121
121
  AesStreamDecryptor,
122
122
  BC_AES_IV,
@@ -140,6 +140,8 @@ import {
140
140
  BC_CMD_ID_COVER_STANDALONE_460,
141
141
  BC_CMD_ID_COVER_STANDALONE_461,
142
142
  BC_CMD_ID_COVER_STANDALONE_462,
143
+ BC_CMD_ID_DEVICE_DETECT,
144
+ BC_CMD_ID_DEVICE_DETECT_CANDIDATES,
143
145
  BC_CMD_ID_DING_DONG_CTRL,
144
146
  BC_CMD_ID_DING_DONG_OPT,
145
147
  BC_CMD_ID_FILE_INFO_LIST_CLOSE,
@@ -288,7 +290,7 @@ import {
288
290
  parseBcMedia,
289
291
  splitAnnexBToNalPayloads,
290
292
  splitAnnexBToNalPayloads2
291
- } from "./chunk-GVWJGQPT.js";
293
+ } from "./chunk-MZUSWKF3.js";
292
294
 
293
295
  // src/reolink/baichuan/HlsSessionManager.ts
294
296
  var withTimeout = async (p, ms, label) => {
@@ -2515,10 +2517,18 @@ var CompositeStream = class extends EventEmitter {
2515
2517
  }
2516
2518
  }
2517
2519
  async startFfmpegCompositionFromRtspUrls(mainWidth, mainHeight, pipWidth, pipHeight, position, widerRtspUrl, teleRtspUrl, rtspTransport) {
2520
+ const videoEncoder = this.options.videoEncoder ?? "libx264";
2521
+ const isX264 = videoEncoder === "libx264";
2522
+ const encoderPreset = this.options.encoderPreset ?? "ultrafast";
2523
+ const crf = this.options.crf ?? 23;
2524
+ const gopSeconds = this.options.gopSeconds ?? 1;
2525
+ const assumedFps = 30;
2526
+ const gopFrames = Math.max(1, Math.round(gopSeconds * assumedFps));
2518
2527
  const ffmpegArgs = [
2519
2528
  "-hide_banner",
2520
2529
  "-loglevel",
2521
2530
  "error",
2531
+ ...this.options.extraGlobalArgs ?? [],
2522
2532
  "-fflags",
2523
2533
  "+genpts",
2524
2534
  // Input 0: wider
@@ -2539,27 +2549,33 @@ var CompositeStream = class extends EventEmitter {
2539
2549
  // Output: always H.264 Annex-B
2540
2550
  "-an",
2541
2551
  "-c:v",
2542
- "libx264",
2552
+ videoEncoder,
2543
2553
  "-g",
2544
- "30",
2554
+ String(gopFrames),
2545
2555
  "-keyint_min",
2546
- "30",
2556
+ String(gopFrames),
2547
2557
  "-sc_threshold",
2548
2558
  "0",
2549
- "-x264-params",
2550
- "aud=1:repeat-headers=1:keyint=30:min-keyint=30:scenecut=0",
2551
- "-preset",
2552
- "ultrafast",
2553
- "-tune",
2554
- "zerolatency",
2555
- "-crf",
2556
- "23",
2559
+ ...isX264 ? [
2560
+ "-x264-params",
2561
+ `aud=1:repeat-headers=1:keyint=${gopFrames}:min-keyint=${gopFrames}:scenecut=0`,
2562
+ "-preset",
2563
+ encoderPreset,
2564
+ "-tune",
2565
+ "zerolatency",
2566
+ "-crf",
2567
+ String(crf)
2568
+ ] : [],
2569
+ ...this.options.extraOutputArgs ?? [],
2557
2570
  "-f",
2558
2571
  "h264",
2559
2572
  "pipe:1"
2560
2573
  ];
2561
- this.logger.log?.(`[CompositeStream] Starting ffmpeg (rtsp inputs): ${ffmpegArgs.join(" ")}`);
2562
- this.ffmpegProcess = spawn3("ffmpeg", ffmpegArgs, {
2574
+ const ffmpegBin = this.options.ffmpegPath ?? "ffmpeg";
2575
+ this.logger.log?.(
2576
+ `[CompositeStream] Starting ffmpeg (rtsp inputs): bin=${ffmpegBin} args=${ffmpegArgs.join(" ")}`
2577
+ );
2578
+ this.ffmpegProcess = spawn3(ffmpegBin, ffmpegArgs, {
2563
2579
  stdio: ["ignore", "pipe", "pipe"]
2564
2580
  });
2565
2581
  this.ffmpegProcess.on("error", (error) => {
@@ -2626,10 +2642,18 @@ var CompositeStream = class extends EventEmitter {
2626
2642
  "-i",
2627
2643
  "pipe:3"
2628
2644
  ];
2645
+ const videoEncoder = this.options.videoEncoder ?? "libx264";
2646
+ const isX264 = videoEncoder === "libx264";
2647
+ const encoderPreset = this.options.encoderPreset ?? "ultrafast";
2648
+ const crf = this.options.crf ?? 23;
2649
+ const gopSeconds = this.options.gopSeconds ?? 1;
2650
+ const assumedFps = 30;
2651
+ const gopFrames = Math.max(1, Math.round(gopSeconds * assumedFps));
2629
2652
  const ffmpegArgs = [
2630
2653
  "-hide_banner",
2631
2654
  "-loglevel",
2632
2655
  "error",
2656
+ ...this.options.extraGlobalArgs ?? [],
2633
2657
  "-fflags",
2634
2658
  "+genpts",
2635
2659
  "-probesize",
@@ -2648,33 +2672,40 @@ var CompositeStream = class extends EventEmitter {
2648
2672
  "-map",
2649
2673
  "[out]",
2650
2674
  "-c:v",
2651
- "libx264",
2652
- // Re-encode for compatibility
2653
- // Make the stream easy to join mid-flight: frequent IDRs + in-band headers + AUD.
2654
- // Without this, a new client may wait many seconds for the next keyframe.
2675
+ videoEncoder,
2676
+ // Make the stream easy to join mid-flight: frequent IDRs + in-band
2677
+ // headers + AUD. Without this, a new client may wait many seconds
2678
+ // for the next keyframe.
2655
2679
  "-g",
2656
- "30",
2680
+ String(gopFrames),
2657
2681
  "-keyint_min",
2658
- "30",
2682
+ String(gopFrames),
2659
2683
  "-sc_threshold",
2660
2684
  "0",
2661
- "-x264-params",
2662
- "aud=1:repeat-headers=1:keyint=30:min-keyint=30:scenecut=0",
2663
- "-preset",
2664
- "ultrafast",
2665
- "-tune",
2666
- "zerolatency",
2667
- "-crf",
2668
- "23",
2685
+ // libx264-specific knobs. We deliberately skip these for HW encoders
2686
+ // — each one has its own option vocabulary (`-q:v`, `-rc`, etc.)
2687
+ // and the user is expected to express them via extraOutputArgs.
2688
+ ...isX264 ? [
2689
+ "-x264-params",
2690
+ `aud=1:repeat-headers=1:keyint=${gopFrames}:min-keyint=${gopFrames}:scenecut=0`,
2691
+ "-preset",
2692
+ encoderPreset,
2693
+ "-tune",
2694
+ "zerolatency",
2695
+ "-crf",
2696
+ String(crf)
2697
+ ] : [],
2698
+ ...this.options.extraOutputArgs ?? [],
2669
2699
  "-f",
2670
2700
  "h264",
2671
2701
  "pipe:1"
2672
2702
  // Output (stdout)
2673
2703
  ];
2704
+ const ffmpegBin = this.options.ffmpegPath ?? "ffmpeg";
2674
2705
  this.logger.log?.(
2675
- `[CompositeStream] Starting ffmpeg: ${ffmpegArgs.join(" ")}`
2706
+ `[CompositeStream] Starting ffmpeg: bin=${ffmpegBin} args=${ffmpegArgs.join(" ")}`
2676
2707
  );
2677
- this.ffmpegProcess = spawn3("ffmpeg", ffmpegArgs, {
2708
+ this.ffmpegProcess = spawn3(ffmpegBin, ffmpegArgs, {
2678
2709
  stdio: ["pipe", "pipe", "pipe", "pipe"]
2679
2710
  });
2680
2711
  this.ffmpegProcess.on("error", (error) => {
@@ -3382,6 +3413,20 @@ async function createRfc4571TcpServerInternal(options) {
3382
3413
  ...forceH264 !== void 0 ? { forceH264 } : defaultForceH264 ? { forceH264: true } : {},
3383
3414
  ...compositeOptions?.assumeH264Inputs !== void 0 ? { assumeH264Inputs: compositeOptions.assumeH264Inputs } : {},
3384
3415
  ...compositeOptions?.disableTranscode !== void 0 ? { disableTranscode: compositeOptions.disableTranscode } : {},
3416
+ // Propagate ffmpeg binary path — required when the embedder strips
3417
+ // PATH (Scrypted on Windows, Electron sandboxes, distroless Docker)
3418
+ // and the bundled ffmpeg is at a fixed absolute path only the
3419
+ // embedder knows.
3420
+ ...compositeOptions?.ffmpegPath ? { ffmpegPath: compositeOptions.ffmpegPath } : {},
3421
+ // Encoder tuning knobs — see CompositeStreamPipOptions for the
3422
+ // semantic contract on each one. Plumbed verbatim so the
3423
+ // CompositeStream layer can apply defaults.
3424
+ ...compositeOptions?.videoEncoder ? { videoEncoder: compositeOptions.videoEncoder } : {},
3425
+ ...compositeOptions?.encoderPreset ? { encoderPreset: compositeOptions.encoderPreset } : {},
3426
+ ...typeof compositeOptions?.crf === "number" ? { crf: compositeOptions.crf } : {},
3427
+ ...typeof compositeOptions?.gopSeconds === "number" ? { gopSeconds: compositeOptions.gopSeconds } : {},
3428
+ ...compositeOptions?.extraGlobalArgs ? { extraGlobalArgs: compositeOptions.extraGlobalArgs } : {},
3429
+ ...compositeOptions?.extraOutputArgs ? { extraOutputArgs: compositeOptions.extraOutputArgs } : {},
3385
3430
  logger
3386
3431
  });
3387
3432
  isCompositeStream = true;
@@ -9829,6 +9874,8 @@ export {
9829
9874
  BC_CMD_ID_COVER_STANDALONE_460,
9830
9875
  BC_CMD_ID_COVER_STANDALONE_461,
9831
9876
  BC_CMD_ID_COVER_STANDALONE_462,
9877
+ BC_CMD_ID_DEVICE_DETECT,
9878
+ BC_CMD_ID_DEVICE_DETECT_CANDIDATES,
9832
9879
  BC_CMD_ID_DING_DONG_CTRL,
9833
9880
  BC_CMD_ID_DING_DONG_OPT,
9834
9881
  BC_CMD_ID_FILE_INFO_LIST_CLOSE,