homekit: fix ffmpeg sender when no audio is present

This commit is contained in:
Koushik Dutta
2022-11-17 23:10:19 -08:00
parent 47bb232ce4
commit 5b07b1f445
3 changed files with 8 additions and 4 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/homekit",
"version": "1.1.68",
"version": "1.1.70",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/homekit",
"version": "1.1.68",
"version": "1.1.70",
"dependencies": {
"@koush/werift-src": "file:../../external/werift",
"check-disk-space": "^3.3.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/homekit",
"version": "1.1.68",
"version": "1.1.70",
"description": "HomeKit Plugin for Scrypted",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",

View File

@@ -146,7 +146,11 @@ export async function startCameraStreamFfmpeg(device: ScryptedDevice & VideoCame
// the packet time parameter is different between LAN and LTE.
let opusFramesPerPacket = request.audio.packet_time / 20;
if (audioCodec === AudioStreamingCodecType.OPUS || audioCodec === AudioStreamingCodecType.AAC_ELD) {
const noAudio = mso?.audio === null;
if (noAudio) {
// no op...
}
else if (audioCodec === AudioStreamingCodecType.OPUS || audioCodec === AudioStreamingCodecType.AAC_ELD) {
// by default opus encodes with a packet time of 20. however, homekit may request another value,
// which we will respect by simply outputing frames of that duration, rather than packing
// 20 ms frames to accomodate.