From 6e6ee65e9bf8b2b8e55da87d4dabbcf088b4687a Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 16 Dec 2021 22:30:02 -0800 Subject: [PATCH] rebroadcast: fix regression in camera disconnection --- common/src/ffmpeg-rebroadcast.ts | 7 +++---- plugins/prebuffer-mixin/package-lock.json | 4 ++-- plugins/prebuffer-mixin/package.json | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/src/ffmpeg-rebroadcast.ts b/common/src/ffmpeg-rebroadcast.ts index 5cd1c907f..7d7642b4e 100644 --- a/common/src/ffmpeg-rebroadcast.ts +++ b/common/src/ffmpeg-rebroadcast.ts @@ -90,6 +90,7 @@ export async function startRebroadcastSession(ffmpegInput: FFMpegInput, options: let ffmpegIncomingConnectionTimeout: NodeJS.Timeout; let isActive = true; const events = new EventEmitter(); + events.on('error', e => console.error('rebroadcast error', e)); const { console } = options; let inputAudioCodec: string; @@ -133,10 +134,7 @@ export async function startRebroadcastSession(ffmpegInput: FFMpegInput, options: const servers = []; - ffmpegIncomingConnectionTimeout = setTimeout(() => { - kill(); - reject(new Error('timed out waiting for incoming initiate ffmpeg tcp connection')); - }, 30000); + ffmpegIncomingConnectionTimeout = setTimeout(kill, 30000); for (const container of Object.keys(options.parsers)) { const parser = options.parsers[container]; @@ -223,6 +221,7 @@ export async function startRebroadcastSession(ffmpegInput: FFMpegInput, options: await socketPromise; clearTimeout(ffmpegIncomingConnectionTimeout); + console.log('ok!'); return { inputAudioCodec, diff --git a/plugins/prebuffer-mixin/package-lock.json b/plugins/prebuffer-mixin/package-lock.json index c3ec8c476..0a7a4fd82 100644 --- a/plugins/prebuffer-mixin/package-lock.json +++ b/plugins/prebuffer-mixin/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/prebuffer-mixin", - "version": "0.1.101", + "version": "0.1.102", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/prebuffer-mixin", - "version": "0.1.101", + "version": "0.1.102", "license": "Apache-2.0", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/prebuffer-mixin/package.json b/plugins/prebuffer-mixin/package.json index 8999deba6..6392871ed 100644 --- a/plugins/prebuffer-mixin/package.json +++ b/plugins/prebuffer-mixin/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/prebuffer-mixin", - "version": "0.1.101", + "version": "0.1.102", "description": "Rebroadcast and Prebuffer for VideoCameras.", "author": "Scrypted", "license": "Apache-2.0",