From e6828d8a225512872d487420e7f1083207f0e3e5 Mon Sep 17 00:00:00 2001 From: eduard256 Date: Wed, 26 Nov 2025 15:29:56 +0300 Subject: [PATCH] Add ?mp4 parameter support for BUBBLE streams in Frigate config - Add buildRtspPath() helper method to conditionally append ?mp4 - Only BUBBLE stream types get ?mp4 suffix for proper recording - Other stream types (RTSP, ONVIF, JPEG, etc.) remain unchanged - Handles both single and dual-stream configurations correctly --- .../web/js/config-generators/frigate/index.js | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/webui/web/js/config-generators/frigate/index.js b/webui/web/js/config-generators/frigate/index.js index 61227f7..379877b 100644 --- a/webui/web/js/config-generators/frigate/index.js +++ b/webui/web/js/config-generators/frigate/index.js @@ -252,6 +252,15 @@ export class FrigateGenerator { return lines; } + /** + * Build RTSP path with optional ?mp4 suffix for BUBBLE streams + */ + static buildRtspPath(streamName, streamType) { + const basePath = `rtsp://127.0.0.1:8554/${streamName}`; + // Add ?mp4 parameter only for BUBBLE streams to enable recording in Frigate + return streamType === 'BUBBLE' ? `${basePath}?mp4` : basePath; + } + /** * Generate camera lines for cameras section */ @@ -264,11 +273,14 @@ export class FrigateGenerator { if (cameraInfo.subStream) { // Use sub for detect, main for record - lines.push(` - path: rtsp://127.0.0.1:8554/${cameraInfo.subStreamName}`); + const subPath = this.buildRtspPath(cameraInfo.subStreamName, cameraInfo.subStream.type); + const mainPath = this.buildRtspPath(cameraInfo.mainStreamName, cameraInfo.mainStream.type); + + lines.push(` - path: ${subPath}`); lines.push(' input_args: preset-rtsp-restream'); lines.push(' roles:'); lines.push(' - detect'); - lines.push(` - path: rtsp://127.0.0.1:8554/${cameraInfo.mainStreamName}`); + lines.push(` - path: ${mainPath}`); lines.push(' input_args: preset-rtsp-restream'); lines.push(' roles:'); lines.push(' - record'); @@ -280,7 +292,9 @@ export class FrigateGenerator { lines.push(` Sub Stream: ${cameraInfo.subStreamName} # Низкое разрешение (опционально)`); } else { // Use main for both detect and record - lines.push(` - path: rtsp://127.0.0.1:8554/${cameraInfo.mainStreamName}`); + const mainPath = this.buildRtspPath(cameraInfo.mainStreamName, cameraInfo.mainStream.type); + + lines.push(` - path: ${mainPath}`); lines.push(' input_args: preset-rtsp-restream'); lines.push(' roles:'); lines.push(' - detect');