diff --git a/CHANGELOG.md b/CHANGELOG.md index 253cf62a..18d2cd30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Changelog All notable changes to this project will be documented in this file. +# v1.1.8 - 2022-04-16 + +## Other Changes +- Minor recording improvements + +## Bugfixes +- Fixed an issue where the notification in the interface referred to a saved recording even though recordings were disabled +- Fixed an issue where the recorded video could not be sent via Telegram +- Fix ffmpeg command `-stimeout` +- Minor bugfixes + # v1.1.7 - 2022-04-15 ## Other Changes diff --git a/package-lock.json b/package-lock.json index 54381f74..57562a43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "camera.ui", - "version": "1.1.7", + "version": "1.1.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "camera.ui", - "version": "1.1.7", + "version": "1.1.8", "funding": [ { "type": "paypal", diff --git a/package.json b/package.json index 1c2528be..09c4f759 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "camera.ui", - "version": "1.1.7", + "version": "1.1.8", "description": "NVR like user interface for RTSP capable cameras.", "author": "SeydX (https://github.com/SeydX/camera.ui)", "scripts": { diff --git a/src/api/components/notifications/notifications.model.js b/src/api/components/notifications/notifications.model.js index 469f8f0c..f51be401 100644 --- a/src/api/components/notifications/notifications.model.js +++ b/src/api/components/notifications/notifications.model.js @@ -120,7 +120,6 @@ export const createNotification = async (data) => { '_CUI'; const extension = data.type === 'Video' ? 'mp4' : 'jpeg'; - const storing = data.type === 'Video' || data.type === 'Snapshot'; const label = (data.label || 'no label').toString(); const notification = { @@ -129,7 +128,7 @@ export const createNotification = async (data) => { fileName: `${fileName}.${extension}`, name: fileName, extension: extension, - recordStoring: storing, + recordStoring: data.storing, recordType: data.type, trigger: data.trigger, room: room, @@ -143,8 +142,8 @@ export const createNotification = async (data) => { title: cameraName, message: `${data.trigger} - ${time}`, subtxt: room, - mediaSource: storing ? `/files/${fileName}.${extension}` : false, - tumbnail: storing + mediaSource: data.storing ? `/files/${fileName}.${extension}` : false, + thumbnail: data.storing ? data.type === 'Video' ? `/files/${fileName}@2.jpeg` : `/files/${fileName}.${extension}` diff --git a/src/common/telegram.js b/src/common/telegram.js index 981b7b21..b7eb8a5c 100644 --- a/src/common/telegram.js +++ b/src/common/telegram.js @@ -60,7 +60,7 @@ export default class Telegram { if (content.img) { try { log.debug('Telegram: Sending Image'); - const stream = fs.createReadStream(content.img); + const stream = Buffer.isBuffer(content.img) ? content.img : fs.createReadStream(content.img); await Telegram.bot.sendPhoto(chatID, stream, {}, { filename: content.fileName }); } catch (error) { log.info('An error occured during sending image!', 'Telegram', 'notifications'); @@ -71,7 +71,7 @@ export default class Telegram { if (content.video) { try { log.debug('Telegram: Sending Video'); - const stream = fs.createReadStream(content.video); + const stream = Buffer.isBuffer(content.video) ? content.video : fs.createReadStream(content.video); await Telegram.bot.sendVideo(chatID, stream, {}, { filename: content.fileName }); } catch (error) { log.info('An error occured during sending video!', 'Telegram', 'notifications'); diff --git a/src/controller/camera/services/prebuffer.service.js b/src/controller/camera/services/prebuffer.service.js index 7e5485e4..708ef8fa 100644 --- a/src/controller/camera/services/prebuffer.service.js +++ b/src/controller/camera/services/prebuffer.service.js @@ -89,7 +89,7 @@ export default class PrebufferService { const timer = this.#millisUntilTime('02:00'); - log.info(`Prebuffering scheduled for restart at 2AM: ${Math.round(timer / 1000 / 60)} minutes`, this.cameraName); + log.debug(`Prebuffering scheduled for restart at 2AM: ${Math.round(timer / 1000 / 60)} minutes`, this.cameraName); this.restartTimer = setTimeout(() => { log.info('Sheduled restart of prebuffering is executed...', this.cameraName); @@ -571,7 +571,7 @@ export default class PrebufferService { }); cp.on('close', () => { - log.info('Prebufferring process closed', this.cameraName); + log.debug('Prebuffering process closed', this.cameraName); kill(); diff --git a/src/controller/camera/services/stream.service.js b/src/controller/camera/services/stream.service.js index ffcb482f..b2ed7d72 100644 --- a/src/controller/camera/services/stream.service.js +++ b/src/controller/camera/services/stream.service.js @@ -101,7 +101,7 @@ export default class StreamService { '-q', '1', '-max_muxing_queue_size', - '1024', + '9999', ]; return { diff --git a/src/controller/camera/services/videoanalysis.service.js b/src/controller/camera/services/videoanalysis.service.js index 6e5a192a..8a939676 100644 --- a/src/controller/camera/services/videoanalysis.service.js +++ b/src/controller/camera/services/videoanalysis.service.js @@ -158,7 +158,7 @@ export default class VideoAnalysisService { if (!withPrebuffer) { const timer = this.#millisUntilTime('04:00'); - log.info( + log.debug( `Videoanalysis scheduled for restart at 4AM: ${Math.round(timer / 1000 / 60)} minutes`, this.cameraName ); diff --git a/src/controller/camera/utils/camera.utils.js b/src/controller/camera/utils/camera.utils.js index 2d843df0..9fc65923 100644 --- a/src/controller/camera/utils/camera.utils.js +++ b/src/controller/camera/utils/camera.utils.js @@ -264,7 +264,7 @@ export const startFFMPegFragmetedMP4Session = async ( '-movflags', 'frag_keyframe+empty_moov+default_base_moof', '-max_muxing_queue_size', - '1024', + '9999', '-vsync', 'cfr', 'tcp://127.0.0.1:' + serverPort, @@ -311,8 +311,8 @@ export const generateInputSource = (videoConfig, source) => { inputSource = `-re ${inputSource}`; } - if (videoConfig.stimeout > 0 && !inputSource.includes('-stimeout')) { - inputSource = `-stimeout ${videoConfig.stimeout * 10000000} ${inputSource}`; + if (videoConfig.stimeout > 0 && !inputSource.includes('-timeout')) { + inputSource = `-timeout ${videoConfig.stimeout * 10000000} ${inputSource}`; } if (videoConfig.maxDelay >= 0 && !inputSource.includes('-max_delay')) { diff --git a/src/controller/event/event.controller.js b/src/controller/event/event.controller.js index efafad53..5f9afb49 100644 --- a/src/controller/event/event.controller.js +++ b/src/controller/event/event.controller.js @@ -134,7 +134,7 @@ export default class EventController { }*/ if (fileBuffer) { - motionInfo.label = 'Custom'; + motionInfo.label = 'no label'; motionInfo.type = type || 'Video'; } diff --git a/ui/src/i18n/locale/de.json b/ui/src/i18n/locale/de.json index 12918db9..20e1709c 100644 --- a/ui/src/i18n/locale/de.json +++ b/ui/src/i18n/locale/de.json @@ -427,7 +427,7 @@ "thursday": "Donnerstag", "time": "Zeit", "timeout": "Zeitüberschreitung", - "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-stimeout).", + "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-timeout).", "timestamp": "Zeitstempel", "token": "Token", "tuesday": "Dienstag", diff --git a/ui/src/i18n/locale/en.json b/ui/src/i18n/locale/en.json index a29c8999..0844be77 100644 --- a/ui/src/i18n/locale/en.json +++ b/ui/src/i18n/locale/en.json @@ -426,7 +426,7 @@ "thursday": "Thursday", "time": "Time", "timeout": "Timeout", - "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-stimeout).", + "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-timeout).", "timestamp": "Timestamp", "tuesday": "Tuesday", "typ": "Typ", diff --git a/ui/src/i18n/locale/es.json b/ui/src/i18n/locale/es.json index 3b3fcfdf..db2b983d 100644 --- a/ui/src/i18n/locale/es.json +++ b/ui/src/i18n/locale/es.json @@ -426,7 +426,7 @@ "thursday": "Jueves", "time": "Tiempo", "timeout": "Timeout", - "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-stimeout).", + "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-timeout).", "timestamp": "Timestamp", "tuesday": "Martes", "typ": "Typ", diff --git a/ui/src/i18n/locale/fr.json b/ui/src/i18n/locale/fr.json index a8e69098..8f82f6ad 100644 --- a/ui/src/i18n/locale/fr.json +++ b/ui/src/i18n/locale/fr.json @@ -426,7 +426,7 @@ "thursday": "Jeudi", "time": "Temps", "timeout": "Délai d'expiration", - "timeout_info": "Délai d'expiration des E/S du socket TCP en secondes. Si vous avez des problèmes de processus FFmpeg bloqués en arrière-plan, vous pouvez entrer une valeur ici pour stopper le processus automatiquement après le temps désiré si aucune réponse n'arrive (-stimeout).", + "timeout_info": "Délai d'expiration des E/S du socket TCP en secondes. Si vous avez des problèmes de processus FFmpeg bloqués en arrière-plan, vous pouvez entrer une valeur ici pour stopper le processus automatiquement après le temps désiré si aucune réponse n'arrive (-timeout).", "timestamp": "Horodatage", "tuesday": "Mardi", "typ": "Type", diff --git a/ui/src/i18n/locale/nl.json b/ui/src/i18n/locale/nl.json index 4e630555..b961c66a 100644 --- a/ui/src/i18n/locale/nl.json +++ b/ui/src/i18n/locale/nl.json @@ -426,7 +426,7 @@ "thursday": "Donderdag", "time": "Tijd", "timeout": "Timeout", - "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-stimeout).", + "timeout_info": "Socket TCP I/O timeout in seconds. If you have problems with hanging FFmpeg processes in the background, you can enter any value here to stop the process automatically after the entered time, if no response comes (-timeout).", "timestamp": "Tijdstempel", "tuesday": "Dinsdag", "type": "Type", diff --git a/ui/src/i18n/locale/th.json b/ui/src/i18n/locale/th.json index ba1b875a..0362f307 100644 --- a/ui/src/i18n/locale/th.json +++ b/ui/src/i18n/locale/th.json @@ -429,7 +429,7 @@ "thursday": "วันพฤหัสบดี", "time": "เวลา", "timeout": "หมดเวลา", - "timeout_info": "ซ็อกเก็ต TCP I/O หมดเวลาในไม่กี่วินาที หากคุณมีปัญหากับการหยุดทำงาน FFmpeg ในพื้นหลัง คุณสามารถป้อนค่าใดๆ ที่นี่เพื่อหยุดกระบวนการโดยอัตโนมัติหลังจากเวลาที่ป้อน หากไม่มีการตอบสนอง (-stimeout)", + "timeout_info": "ซ็อกเก็ต TCP I/O หมดเวลาในไม่กี่วินาที หากคุณมีปัญหากับการหยุดทำงาน FFmpeg ในพื้นหลัง คุณสามารถป้อนค่าใดๆ ที่นี่เพื่อหยุดกระบวนการโดยอัตโนมัติหลังจากเวลาที่ป้อน หากไม่มีการตอบสนอง (-timeout)", "timestamp": "การประทับเวลา", "tuesday": "วันอังคาร", "typ": "Typ",