From ea11e787034d14fc329b7b4405f2bf89b1584fdc Mon Sep 17 00:00:00 2001 From: Kevin Kuehler Date: Wed, 10 Jan 2024 08:35:11 -0800 Subject: [PATCH] ffmpeg: Expose stdout callback to user (#1386) --- package-lock.json | 44 +++++++++---------- packages/ring-client-api/package.json | 2 +- .../streaming/streaming-session.ts | 2 + 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4ebf45a4..e64a6fee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1668,15 +1668,15 @@ } }, "node_modules/@homebridge/camera-utils": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@homebridge/camera-utils/-/camera-utils-2.2.4.tgz", - "integrity": "sha512-SXyj80OBGI9SSdXoxvTkskgMdHlyQ17prmtrj6YO25Rh8VX511ccPdgQpzUKa4rnb/tBCX1fJCUaHomfS4UaJg==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@homebridge/camera-utils/-/camera-utils-2.2.5.tgz", + "integrity": "sha512-fIvzX9qIHiinekmZNooxgQ8yf4BtScZkSY1FZY7zUsdCzj783PLSMW2LV4K+PIEAv/nKDBrx5FVKKrRY7eT2Cw==", "dependencies": { "execa": "^5.1.1", "ffmpeg-for-homebridge": "^2.1.1", "pick-port": "^1.0.1", "rxjs": "^7.8.1", - "systeminformation": "^5.21.15" + "systeminformation": "^5.21.22" } }, "node_modules/@homebridge/ciao": { @@ -10781,9 +10781,9 @@ } }, "node_modules/systeminformation": { - "version": "5.21.20", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.20.tgz", - "integrity": "sha512-AyS1fNc+MDoAJtFknFbbo587H8h6yejJwM+H9rVusnOToIEkiMehMyD5JM7o3j55Cto20MawIZrcgNMgd4BfOQ==", + "version": "5.21.22", + "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.22.tgz", + "integrity": "sha512-gNHloAJSyS+sKWkwvmvozZ1eHrdVTEsynWMTY6lvLGBB70gflkBQFw8drXXr1oEXY84+Vr9tOOrN8xHZLJSycA==", "os": [ "darwin", "linux", @@ -11801,12 +11801,12 @@ "dotenv": "16.3.1", "eslint-config-shared": "*", "express": "4.18.2", - "ring-client-api": "12.0.1", + "ring-client-api": "12.1.0", "tsconfig": "*" } }, "packages/homebridge-ring": { - "version": "12.0.1", + "version": "12.1.0", "funding": [ { "type": "paypal", @@ -11821,7 +11821,7 @@ "dependencies": { "@homebridge/camera-utils": "^2.2.4", "@homebridge/plugin-ui-utils": "^1.0.0", - "ring-client-api": "12.0.1", + "ring-client-api": "12.1.0", "werift": "0.18.17" }, "devDependencies": { @@ -11851,7 +11851,7 @@ } }, "packages/ring-client-api": { - "version": "12.0.1", + "version": "12.1.0", "funding": [ { "type": "paypal", @@ -11865,7 +11865,7 @@ "license": "MIT", "dependencies": { "@eneris/push-receiver": "^3.1.5", - "@homebridge/camera-utils": "^2.2.4", + "@homebridge/camera-utils": "^2.2.5", "@peculiar/asn1-schema": "^2.3.8", "@peculiar/webcrypto": "^1.4.3", "@types/socket.io-client": "1.4.36", @@ -13383,15 +13383,15 @@ } }, "@homebridge/camera-utils": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@homebridge/camera-utils/-/camera-utils-2.2.4.tgz", - "integrity": "sha512-SXyj80OBGI9SSdXoxvTkskgMdHlyQ17prmtrj6YO25Rh8VX511ccPdgQpzUKa4rnb/tBCX1fJCUaHomfS4UaJg==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@homebridge/camera-utils/-/camera-utils-2.2.5.tgz", + "integrity": "sha512-fIvzX9qIHiinekmZNooxgQ8yf4BtScZkSY1FZY7zUsdCzj783PLSMW2LV4K+PIEAv/nKDBrx5FVKKrRY7eT2Cw==", "requires": { "execa": "^5.1.1", "ffmpeg-for-homebridge": "^2.1.1", "pick-port": "^1.0.1", "rxjs": "^7.8.1", - "systeminformation": "^5.21.15" + "systeminformation": "^5.21.22" } }, "@homebridge/ciao": { @@ -16417,7 +16417,7 @@ "dotenv": "16.3.1", "eslint-config-shared": "*", "express": "4.18.2", - "ring-client-api": "12.0.1", + "ring-client-api": "12.1.0", "tsconfig": "*" } }, @@ -17090,7 +17090,7 @@ "eslint-config-shared": "*", "homebridge": "1.7.0", "nodemon": "^3.0.2", - "ring-client-api": "12.0.1", + "ring-client-api": "12.1.0", "tsconfig": "*", "typescript": "5.2.2", "werift": "0.18.17" @@ -19456,7 +19456,7 @@ "version": "file:packages/ring-client-api", "requires": { "@eneris/push-receiver": "^3.1.5", - "@homebridge/camera-utils": "^2.2.4", + "@homebridge/camera-utils": "^2.2.5", "@peculiar/asn1-schema": "^2.3.8", "@peculiar/webcrypto": "^1.4.3", "@types/debug": "4.1.12", @@ -20282,9 +20282,9 @@ } }, "systeminformation": { - "version": "5.21.20", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.20.tgz", - "integrity": "sha512-AyS1fNc+MDoAJtFknFbbo587H8h6yejJwM+H9rVusnOToIEkiMehMyD5JM7o3j55Cto20MawIZrcgNMgd4BfOQ==" + "version": "5.21.22", + "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.22.tgz", + "integrity": "sha512-gNHloAJSyS+sKWkwvmvozZ1eHrdVTEsynWMTY6lvLGBB70gflkBQFw8drXXr1oEXY84+Vr9tOOrN8xHZLJSycA==" }, "tar": { "version": "6.2.0", diff --git a/packages/ring-client-api/package.json b/packages/ring-client-api/package.json index 936c9958..1e4de54b 100644 --- a/packages/ring-client-api/package.json +++ b/packages/ring-client-api/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@eneris/push-receiver": "^3.1.5", - "@homebridge/camera-utils": "^2.2.4", + "@homebridge/camera-utils": "^2.2.5", "@peculiar/asn1-schema": "^2.3.8", "@peculiar/webcrypto": "^1.4.3", "@types/socket.io-client": "1.4.36", diff --git a/packages/ring-client-api/streaming/streaming-session.ts b/packages/ring-client-api/streaming/streaming-session.ts index 64beab6f..0bf2f7d4 100644 --- a/packages/ring-client-api/streaming/streaming-session.ts +++ b/packages/ring-client-api/streaming/streaming-session.ts @@ -17,6 +17,7 @@ export interface FfmpegOptions { input?: SpawnInput[] video?: SpawnInput[] | false audio?: SpawnInput[] + stdoutCallback?: (data: Buffer) => void output: SpawnInput[] } @@ -138,6 +139,7 @@ export class StreamingSession extends Subscribed { ...(ffmpegOptions.output || []), ), ffmpegPath: getFfmpegPath(), + stdoutCallback: ffmpegOptions.stdoutCallback, exitCallback: () => this.callEnded(), logLabel: `From Ring (${this.camera.name})`, logger: {