mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
unifi-protect: Fixup codec reporting
This commit is contained in:
4
plugins/unifi-protect/package-lock.json
generated
4
plugins/unifi-protect/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.164",
|
||||
"version": "0.0.165",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.164",
|
||||
"version": "0.0.165",
|
||||
"license": "Apache",
|
||||
"dependencies": {
|
||||
"@koush/unifi-protect": "file:../../external/unifi-protect",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.164",
|
||||
"version": "0.0.165",
|
||||
"description": "Unifi Protect Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -391,17 +391,17 @@ export class UnifiCamera extends ScryptedDeviceBase implements Notifier, Interco
|
||||
const data = Buffer.from(JSON.stringify({
|
||||
url: u,
|
||||
container: 'rtsp',
|
||||
mediaStreamOptions: this.createMediaStreamOptions(rtspChannel),
|
||||
mediaStreamOptions: this.createMediaStreamOptions(rtspChannel, (camera as any).videoCodec),
|
||||
} as MediaStreamUrl));
|
||||
return this.createMediaObject(data, ScryptedMimeTypes.MediaStreamUrl);
|
||||
}
|
||||
|
||||
createMediaStreamOptions(channel: ProtectCameraChannelConfig) {
|
||||
createMediaStreamOptions(channel: ProtectCameraChannelConfig, cameraVideoCodec: string) {
|
||||
const ret: ResponseMediaStreamOptions = {
|
||||
id: channel.id.toString(),
|
||||
name: channel.name,
|
||||
video: {
|
||||
codec: 'h264',
|
||||
codec: cameraVideoCodec || 'h264',
|
||||
width: channel.width,
|
||||
height: channel.height,
|
||||
bitrate: channel.maxBitrate,
|
||||
@@ -425,7 +425,7 @@ export class UnifiCamera extends ScryptedDeviceBase implements Notifier, Interco
|
||||
async getVideoStreamOptions(): Promise<ResponseMediaStreamOptions[]> {
|
||||
const camera = this.findCamera();
|
||||
const vsos = camera.channels
|
||||
.map(channel => this.createMediaStreamOptions(channel));
|
||||
.map(channel => this.createMediaStreamOptions(channel, (camera as any).videoCodec));
|
||||
|
||||
return vsos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user