From 028d601674ba55b8cfcd9f7bfe9be9ed538c8258 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 28 Jun 2024 10:37:58 -0700 Subject: [PATCH] reolink: automatically remove nonfunctional streams using opaque getAbility api results lol --- plugins/reolink/package-lock.json | 4 ++-- plugins/reolink/package.json | 2 +- plugins/reolink/src/main.ts | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/reolink/package-lock.json b/plugins/reolink/package-lock.json index e318cb7e5..624e77ef3 100644 --- a/plugins/reolink/package-lock.json +++ b/plugins/reolink/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/reolink", - "version": "0.0.76", + "version": "0.0.77", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/reolink", - "version": "0.0.76", + "version": "0.0.77", "license": "Apache", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/reolink/package.json b/plugins/reolink/package.json index 6bdbdb0d1..40d43d119 100644 --- a/plugins/reolink/package.json +++ b/plugins/reolink/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/reolink", - "version": "0.0.76", + "version": "0.0.77", "description": "Reolink Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/reolink/src/main.ts b/plugins/reolink/src/main.ts index 05dfe8680..a5106bc91 100644 --- a/plugins/reolink/src/main.ts +++ b/plugins/reolink/src/main.ts @@ -520,8 +520,15 @@ class ReolinkCamera extends RtspSmartCamera implements Camera, DeviceProvider, R } ]; - if (deviceInfo?.model?.replace(' ', '').includes('Duo2') || deviceInfo?.model?.replace(' ', '').includes('Duo3')) { - // these models don't have rtmp main stream or any ext streams... need to filter those out. + // this property seems to be: + // 1: rtmp main, sub ext + rtsp main + sub + // 2: rtmp sub + rtsp main + sub + // 4k cams seem to be 2. + // unsure if there are other values + const live = this.storageSettings.values.abilities?.value?.Ability?.abilityChn?.[0].live?.ver; + if (live === 2) { + // remove the rtmp main and ext + streams.splice(0, 2); } if (deviceInfo?.model == "Reolink TrackMix PoE") {