mirror of
https://github.com/koush/scrypted.git
synced 2026-07-09 08:30:39 +01:00
homekit: transcode cleanup
This commit is contained in:
@@ -118,8 +118,6 @@ export function getH264EncoderArgs() {
|
||||
encoderArgs[name] = [
|
||||
'-c:v',
|
||||
encoder,
|
||||
'-b:v',
|
||||
'${request.video.max_bit_rate * 10}k',
|
||||
]
|
||||
}
|
||||
return encoderArgs;
|
||||
|
||||
4
plugins/homekit/package-lock.json
generated
4
plugins/homekit/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.115",
|
||||
"version": "0.0.117",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.115",
|
||||
"version": "0.0.117",
|
||||
"dependencies": {
|
||||
"hap-nodejs": "file:../../external/HAP-NodeJS",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -40,5 +40,5 @@
|
||||
"@types/qrcode": "^1.4.1",
|
||||
"@types/url-parse": "^1.4.3"
|
||||
},
|
||||
"version": "0.0.115"
|
||||
"version": "0.0.117"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,11 @@ import { getH264DecoderArgs, getH264EncoderArgs } from "../../../common/src/ffmp
|
||||
|
||||
const { log, systemManager, deviceManager } = sdk;
|
||||
|
||||
const extraEncoderArgs = [
|
||||
'-b:v',
|
||||
'${request.video.max_bit_rate * 2}k',
|
||||
];
|
||||
|
||||
export class CameraMixin extends SettingsMixinDeviceBase<any> implements Settings {
|
||||
constructor(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: { [key: string]: any }, providerNativeId: string) {
|
||||
super(mixinDevice, mixinDeviceState, {
|
||||
@@ -84,8 +89,8 @@ export class CameraMixin extends SettingsMixinDeviceBase<any> implements Setting
|
||||
}
|
||||
|
||||
if (showTranscodeArgs) {
|
||||
const encoderArgs = getH264EncoderArgs();
|
||||
const decoderArgs = getH264DecoderArgs();
|
||||
const encoderArgs = getH264EncoderArgs();
|
||||
|
||||
settings.push({
|
||||
title: 'Video Decoder Arguments',
|
||||
@@ -167,7 +172,10 @@ export class CameraMixin extends SettingsMixinDeviceBase<any> implements Setting
|
||||
|
||||
if (key === 'h264EncoderArguments') {
|
||||
const encoderArgs = getH264EncoderArgs();
|
||||
const substitute = encoderArgs[value.toString()]?.join(' ');
|
||||
const args = encoderArgs[value.toString()];
|
||||
if (args)
|
||||
args.push(...extraEncoderArgs);
|
||||
const substitute = args?.join(' ');
|
||||
value = substitute ? `\`${substitute}\`` : value;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ export function bindCharacteristic(device: ScryptedDevice, event: ScryptedInterf
|
||||
service.getCharacteristic(characteristic).on(CharacteristicEventTypes.GET, callback => {
|
||||
try {
|
||||
if (device.interfaces.includes(ScryptedInterface.Refresh)) {
|
||||
(device as ScryptedDevice & Refresh).refresh(event, true);
|
||||
// it's not possible to determine if this is user initiated.
|
||||
// homekit seems to aggressively call get...
|
||||
(device as ScryptedDevice & Refresh).refresh(event, false);
|
||||
}
|
||||
callback(null, map());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user