Update libs/ffmpeg/builders.js, libs/events/utils.js

video-slicer-reencoder
Katie Roberts 2022-09-11 04:13:49 +00:00
parent 2aade4631d
commit 777d56bc3c
2 changed files with 6 additions and 4 deletions

View File

@ -549,7 +549,9 @@ module.exports = (s,config,lang,app,io) => {
){
outputMap += `-map 0:1 `
}
const ffmpegCommand = `-loglevel warning -live_start_index -99999 -analyzeduration ${analyzeDuration} -probesize ${probeSize} -re -i "${s.dir.streams+d.ke+'/'+d.id}/detectorStream.m3u8" ${outputMap}-movflags faststart+frag_keyframe+empty_moov -fflags +igndts -c:v copy -c:a aac -strict -2 -strftime 1 -y "${s.getVideoDirectory(monitorConfig) + filename}"`
const secondsBefore = parseInt(monitorDetails.detector_buffer_seconds_before) || 5
let LiveStartIndex = parseInt(secondsBefore + 1)
const ffmpegCommand = `-loglevel warning -live_start_index -${LiveStartIndex} -analyzeduration ${analyzeDuration} -probesize ${probeSize} -re -i "${s.dir.streams+d.ke+'/'+d.id}/detectorStream.m3u8" ${outputMap}-movflags faststart+frag_keyframe+empty_moov -fflags +igndts -c:v copy -c:a aac -strict -2 -strftime 1 -y "${s.getVideoDirectory(monitorConfig) + filename}"`
s.debugLog(ffmpegCommand)
activeMonitor.eventBasedRecording.process = spawn(
config.ffmpegDir,

View File

@ -685,11 +685,11 @@ module.exports = (s,config,lang) => {
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.event_record_scale_x,e.details.event_record_scale_y)
const hlsTime = !isNaN(parseInt(e.details.detector_buffer_hls_time)) ? `${parseInt(e.details.detector_buffer_hls_time)}` : '2'
const hlsTime = !isNaN(parseInt(e.details.detector_buffer_hls_time)) ? `${parseInt(e.details.detector_buffer_hls_time)}` : '1'
// const hlsListSize = !isNaN(parseInt(e.details.detector_buffer_hls_list_size)) ? `${parseInt(e.details.detector_buffer_hls_list_size)}` : '4'
const secondsBefore = parseInt(e.details.detector_buffer_seconds_before) || 5
let hlsListSize = parseInt(secondsBefore * 0.6)
hlsListSize = hlsListSize < 3 ? 3 : hlsListSize;
let hlsListSize = parseInt(secondsBefore + 5)
// hlsListSize = hlsListSize < 3 ? 3 : hlsListSize;
if(inputMap)outputFlags.push(inputMap)
if(e.details.cust_sip_record)outputFlags.push(e.details.cust_sip_record)
if(videoCodec === 'auto'){