mirror of
https://github.com/koush/scrypted.git
synced 2026-09-17 17:20:39 +01:00
homekit: fix reversed logic when there is no audio
This commit is contained in:
4
plugins/homekit/package-lock.json
generated
4
plugins/homekit/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.142",
|
||||
"version": "0.0.143",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.142",
|
||||
"version": "0.0.143",
|
||||
"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.142"
|
||||
"version": "0.0.143"
|
||||
}
|
||||
|
||||
@@ -4,11 +4,6 @@ import { getH264DecoderArgs, getH264EncoderArgs } from "../../../common/src/ffmp
|
||||
|
||||
const { log, systemManager, deviceManager } = sdk;
|
||||
|
||||
const extraEncoderArgs = [
|
||||
'-b:v',
|
||||
'${request.video.max_bit_rate * 2}k',
|
||||
];
|
||||
|
||||
export const defaultObjectDetectionContactSensorTimeout = 60;
|
||||
|
||||
export class CameraMixin extends SettingsMixinDeviceBase<any> implements Settings {
|
||||
@@ -205,8 +200,17 @@ export class CameraMixin extends SettingsMixinDeviceBase<any> implements Setting
|
||||
if (key === 'h264EncoderArguments') {
|
||||
const encoderArgs = getH264EncoderArgs();
|
||||
const args = encoderArgs[value.toString()];
|
||||
if (args)
|
||||
if (args) {
|
||||
// if default args were specified (ie, videotoolbox, quicksync, etc),
|
||||
// expand that into args that include bitrate and rescale.
|
||||
const extraEncoderArgs = [
|
||||
'-b:v',
|
||||
'${request.video.max_bit_rate * 2}k',
|
||||
'-vf',
|
||||
'scale=${request.video.width}:${request.video.height}',
|
||||
];
|
||||
args.push(...extraEncoderArgs);
|
||||
}
|
||||
const substitute = args?.join(' ');
|
||||
value = substitute ? `\`${substitute}\`` : value;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ addSupportedType({
|
||||
args.push(...ffmpegInput.inputArguments);
|
||||
|
||||
// dummy audio
|
||||
if (!noAudio) {
|
||||
if (noAudio) {
|
||||
// create a dummy audio track if none actually exists.
|
||||
// this track will only be used if no audio track is available.
|
||||
// https://stackoverflow.com/questions/37862432/ffmpeg-output-silent-audio-track-if-source-has-no-audio-or-audio-is-shorter-th
|
||||
|
||||
Reference in New Issue
Block a user