From e82bf2150aba4d2d3b389f36e41564087f4e37c5 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 17 Sep 2021 14:04:29 -0700 Subject: [PATCH] rebroadcast: better logging --- plugins/prebuffer-mixin/src/main.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/prebuffer-mixin/src/main.ts b/plugins/prebuffer-mixin/src/main.ts index 45569fea6..2e8711b76 100644 --- a/plugins/prebuffer-mixin/src/main.ts +++ b/plugins/prebuffer-mixin/src/main.ts @@ -176,7 +176,7 @@ class PrebufferMixin extends SettingsMixinDeviceBase implements Vid } const fmp4OutputServer = createServer(socket => { - fragmentClientHandler(socket).catch(e => console.log('fragmented mp4 session ended', e)); + fragmentClientHandler(socket).catch(e => console.log(this.name, 'fragmented mp4 session ended', e)); }); const fmp4Port = await listenZeroCluster(fmp4OutputServer); @@ -197,8 +197,11 @@ class PrebufferMixin extends SettingsMixinDeviceBase implements Vid this.detectedAcodec = session.inputAudioCodec || ''; this.detectedVcodec = session.inputVideoCodec || ''; - if (this.detectedAcodec !== 'aac') { - console.error('Detected audio codec was not AAC.'); + if (!this.detectedAcodec) { + console.warn(this.name, 'no audio detected.'); + } + else if (this.detectedAcodec !== 'aac') { + console.error(this.name, 'Detected audio codec was not AAC.'); if (this.name?.indexOf('pcm') !== -1 && !reencodeAudio) { log.a(`${this.name} is using PCM audio. You will need to enable Reencode Audio in Rebroadcast Settings for this stream.`); } @@ -234,7 +237,7 @@ class PrebufferMixin extends SettingsMixinDeviceBase implements Vid const session = await this.prebufferSession; // if a specific stream is requested, and it's not what we're streaming, just fall through to source. - if (options && options.id !== session.ffmpegInput.mediaStreamOptions?.id) { + if (options?.id && options.id !== session.ffmpegInput.mediaStreamOptions?.id) { console.log(this.name, 'rebroadcast session cant be used here', options); return this.mixinDevice.getVideoStream(options); }