fix timelapse resolution, add resolution option for Traditional Recording

mitchross-coral-installer-update
Moe Alam 2020-12-04 06:53:59 -08:00
parent 5dfd8fc67b
commit 74a699698b
2 changed files with 25 additions and 3 deletions

View File

@ -3268,6 +3268,28 @@ module.exports = function(s,config,lang){
"form-group-class": "h_buff_input h_buff_libx264 h_buff_h264_vaapi h_buff_hevc_vaapi",
"possible": ""
},
{
"name": "detail=event_record_scale_x",
"field": lang.Width,
"description": "Width of the Event-based Recording image that is output after processing.",
"default": "",
"fieldType": "number",
"numberMin": "1",
"example": "640",
"form-group-class": "h_buff_input h_buff_libx264 h_buff_h264_vaapi h_buff_hevc_vaapi",
"possible": ""
},
{
"name": "detail=event_record_scale_y",
"field": lang.Height,
"description": "Height of the Event-based Recording image that is output after processing.",
"default": "",
"fieldType": "number",
"numberMin": "1",
"example": "480",
"form-group-class": "h_buff_input h_buff_libx264 h_buff_h264_vaapi h_buff_hevc_vaapi",
"possible": ""
},
{
"name": "detail=detector_buffer_hls_time",
"field": lang['HLS Segment Length'],

View File

@ -670,7 +670,7 @@ module.exports = (s,config,lang) => {
const videoCodecisCopy = videoCodec === 'copy'
const videoFps = !isNaN(parseFloat(e.details.stream_fps)) && e.details.stream_fps !== '0' ? parseFloat(e.details.stream_fps) : null
const inputMap = buildInputMap(e,e.details.input_map_choices.detector_sip_buffer)
const { videoWidth, videoHeight } = validateDimensions(e.details.record_scale_x,e.details.record_scale_y)
const { videoWidth, videoHeight } = validateDimensions(e.details.event_record_scale_x,e.details.event_record_scale_y)
const hlsTime = !isNaN(parseInt(e.details.detector_buffer_hls_list_time)) ? `${parseInt(e.details.detector_buffer_hls_list_time)}` : '2'
const hlsListSize = !isNaN(parseInt(e.details.detector_buffer_hls_list_size)) ? `${parseInt(e.details.detector_buffer_hls_list_size)}` : '4'
if(inputMap)outputFlags.push(inputMap)
@ -735,8 +735,8 @@ module.exports = (s,config,lang) => {
const videoFilters = []
const videoFlags = []
const inputMap = buildInputMap(e,e.details.input_map_choices.record_timelapse)
const { videoWidth, videoHeight } = validateDimensions(e.details.record_scale_x,e.details.record_scale_y)
if(videoWidth && videoHeight)streamFlags.push(`-s ${videoWidth}x${videoHeight}`)
const { videoWidth, videoHeight } = validateDimensions(e.details.record_timelapse_scale_x,e.details.record_timelapse_scale_y)
if(videoWidth && videoHeight)videoFlags.push(`-s ${videoWidth}x${videoHeight}`)
if(inputMap)videoFlags.push(inputMap)
videoFilters.push(`fps=${(1 / (!isNaN(parseFloat(e.details.record_timelapse_fps)) ? parseFloat(e.details.record_timelapse_fps) : 900)).toFixed(3)}`)
if(e.details.record_timelapse_vf)videoFilters.push(e.details.record_timelapse_vf)