From f2cd0218fd0f3ea5a563baa2e550949da046252f Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 28 Jun 2024 11:12:01 -0700 Subject: [PATCH] reolink: switch to mainEncType marker --- plugins/reolink/package-lock.json | 4 ++-- plugins/reolink/package.json | 2 +- plugins/reolink/src/main.ts | 18 ++++++++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/plugins/reolink/package-lock.json b/plugins/reolink/package-lock.json index 624e77ef3..36567d9f5 100644 --- a/plugins/reolink/package-lock.json +++ b/plugins/reolink/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/reolink", - "version": "0.0.77", + "version": "0.0.78", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/reolink", - "version": "0.0.77", + "version": "0.0.78", "license": "Apache", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/reolink/package.json b/plugins/reolink/package.json index 40d43d119..9ed0117f7 100644 --- a/plugins/reolink/package.json +++ b/plugins/reolink/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/reolink", - "version": "0.0.77", + "version": "0.0.78", "description": "Reolink Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/reolink/src/main.ts b/plugins/reolink/src/main.ts index a5106bc91..b97a88c2e 100644 --- a/plugins/reolink/src/main.ts +++ b/plugins/reolink/src/main.ts @@ -521,12 +521,22 @@ class ReolinkCamera extends RtspSmartCamera implements Camera, DeviceProvider, R ]; // this property seems to be: - // 1: rtmp main, sub ext + rtsp main + sub - // 2: rtmp sub + rtsp main + sub + // 1 (Doorbell): rtmp main, sub, ext + rtsp main, sub + // 2 (Duo 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) { + // update: unfortunately this property is unusable on the E1 Pro. + // However, the mainEncType property seems like a reliable marker + // 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); + // } + + const mainEncType = this.storageSettings.values.abilities?.value?.Ability?.abilityChn?.[0].mainEncType?.ver; + // 0 (Doorbell): rtmp main, sub, ext + rtsp main, sub + // 1 (Duo 2 + E1 Pro): rtmp sub + rtsp main, sub + if (mainEncType === 1) { // remove the rtmp main and ext streams.splice(0, 2); }