From 5dbeb8c5e56ddc55a4c4feed5775698bf4be3b6e Mon Sep 17 00:00:00 2001 From: Moe Date: Sat, 2 May 2020 13:25:38 -0700 Subject: [PATCH] Add Wallclock Timestamp toggle in Monitor Settings --- definitions/en_CA.js | 19 +++++++++++++++++++ languages/en_CA.json | 1 + libs/config.js | 1 - libs/ffmpeg.js | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/definitions/en_CA.js b/definitions/en_CA.js index 1412be01..f0b8a24a 100644 --- a/definitions/en_CA.js +++ b/definitions/en_CA.js @@ -478,6 +478,25 @@ module.exports = function(s,config,lang){ "example": "25", "possible": "" }, + { + "name": "detail=wall_clock_timestamp_ignore", + "field": lang['Use Camera Timestamps'], + "description": "Base all incoming camera data in camera time instead of server time.", + "default": "0", + "example": "", + "form-group-class": "h_t_input h_t_h264", + "fieldType": "select", + "possible": [ + { + "name": lang.No, + "value": "0" + }, + { + "name": lang.Yes, + "value": "1" + } + ] + }, { hidden: true, "name": "height", diff --git a/languages/en_CA.json b/languages/en_CA.json index 913c1d2a..3d660298 100644 --- a/languages/en_CA.json +++ b/languages/en_CA.json @@ -22,6 +22,7 @@ "RAM": "RAM", "CPU": "CPU", "on": "on", + "Use Camera Timestamps": "Use Camera Timestamps", "Power Viewer": "Power Viewer", "Power Video Viewer": "Power Video Viewer", "Time-lapse": "Time-lapse", diff --git a/libs/config.js b/libs/config.js index ab444352..10d1e6fb 100644 --- a/libs/config.js +++ b/libs/config.js @@ -40,7 +40,6 @@ module.exports = function(s){ if(config.insertOrphans === undefined){config.insertOrphans = true} if(config.orphanedVideoCheckMax === undefined){config.orphanedVideoCheckMax = 2} if(config.detectorMergePamRegionTriggers === undefined){config.detectorMergePamRegionTriggers = false} - if(config.wallClockTimestampAsDefault === undefined){config.wallClockTimestampAsDefault = true} //Child Nodes if(config.childNodes === undefined)config.childNodes = {}; //enabled diff --git a/libs/ffmpeg.js b/libs/ffmpeg.js index 436f3a18..139f2e07 100644 --- a/libs/ffmpeg.js +++ b/libs/ffmpeg.js @@ -422,7 +422,7 @@ module.exports = function(s,config,lang,onFinish){ x.hwaccel = '' x.cust_input = '' //wallclock fix for strangely long, single frame videos - if(config.wallClockTimestampAsDefault && e.type === 'h264' && x.cust_input.indexOf('-use_wallclock_as_timestamps 1') === -1){x.cust_input+=' -use_wallclock_as_timestamps 1';} + if(e.details.wall_clock_timestamp_ignore !== '1' && e.type === 'h264' && x.cust_input.indexOf('-use_wallclock_as_timestamps 1') === -1){x.cust_input+=' -use_wallclock_as_timestamps 1';} //input - frame rate (capture rate) if(e.details.sfps && e.details.sfps!==''){x.input_fps=' -r '+e.details.sfps}else{x.input_fps=''} //input - analyze duration