diff --git a/plugins/amcrest/package-lock.json b/plugins/amcrest/package-lock.json index 8e89050b3..9d7a9eae6 100644 --- a/plugins/amcrest/package-lock.json +++ b/plugins/amcrest/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/amcrest", - "version": "0.0.155", + "version": "0.0.156", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/amcrest", - "version": "0.0.155", + "version": "0.0.156", "license": "Apache", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/amcrest/package.json b/plugins/amcrest/package.json index 8b8ffad97..394e2b747 100644 --- a/plugins/amcrest/package.json +++ b/plugins/amcrest/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/amcrest", - "version": "0.0.155", + "version": "0.0.156", "description": "Amcrest Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/amcrest/src/amcrest-api.ts b/plugins/amcrest/src/amcrest-api.ts index 5ef5e4a58..2ba88ea58 100644 --- a/plugins/amcrest/src/amcrest-api.ts +++ b/plugins/amcrest/src/amcrest-api.ts @@ -484,10 +484,20 @@ export class AmcrestCameraClient { } const caps = `caps[${cameraNumber - 1}].${format}[${formatNumber}]`; + const singleCaps = `caps.${format}[${formatNumber}]`; - const resolutions = findValue(capsResponse.body, caps, 'Video.ResolutionTypes').split(',').map(fromAmcrestResolution); - const bitrates = findValue(capsResponse.body, caps, 'Video.BitRateOptions').split(',').map(s => parseInt(s) * 1000); - const fpsMax = parseInt(findValue(capsResponse.body, caps, 'Video.FPSMax')); + const findCaps = (key: string) => { + const found = findValue(capsResponse.body, caps, key); + if (found) + return found; + // ad410 doesnt return a camera number if accessed directly + if (cameraNumber - 1 === 0) + return findValue(capsResponse.body, singleCaps, key); + } + + const resolutions = findCaps('Video.ResolutionTypes').split(',').map(fromAmcrestResolution); + const bitrates = findCaps('Video.BitRateOptions').split(',').map(s => parseInt(s) * 1000); + const fpsMax = parseInt(findCaps('Video.FPSMax')); const vso: MediaStreamConfiguration = { id: options.id, video: {},