Merge branch 'dev' into 'master'

Undo some ONVIF Scanner Changes

See merge request Shinobi-Systems/Shinobi!507
alpha
Moe 2024-08-28 20:10:10 +00:00
commit d8cd1b75f4
3 changed files with 33 additions and 28 deletions

View File

@ -2112,7 +2112,7 @@ module.exports = function(s,config,lang){
"description": lang["fieldTextCrf"],
"default": "15",
"example": "1",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": "1-23"
},
{
@ -2122,7 +2122,7 @@ module.exports = function(s,config,lang){
"description": lang["fieldTextPresetRecord"],
"default": "",
"example": "ultrafast",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": ""
},
{
@ -2187,7 +2187,7 @@ module.exports = function(s,config,lang){
"description": lang["fieldTextFps"],
"default": "",
"example": "2",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": ""
},
{
@ -2196,7 +2196,7 @@ module.exports = function(s,config,lang){
"description": "Height of the stream image.",
"default": "",
"example": "720",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": ""
},
{
@ -2205,7 +2205,7 @@ module.exports = function(s,config,lang){
"description": "Width of the stream image.",
"default": "",
"example": "1280",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": ""
},
{
@ -2225,7 +2225,7 @@ module.exports = function(s,config,lang){
"example": "",
"selector": "h_vc",
"fieldType": "select",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": [
{
"name": lang["No Rotation"],
@ -2260,7 +2260,7 @@ module.exports = function(s,config,lang){
"description": lang["fieldTextVf"],
"default": "",
"example": "",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"form-group-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"possible": ""
}
]
@ -2270,7 +2270,7 @@ module.exports = function(s,config,lang){
"name": lang['Recording Timestamp'],
"color": "red",
isAdvanced: true,
"section-pre-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"section-pre-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"section-class": "h_m_input h_m_record h_m_idle",
"isSection": true,
"info": [
@ -2360,7 +2360,7 @@ module.exports = function(s,config,lang){
"name": lang['Recording Watermark'],
"color": "red",
isAdvanced: true,
"section-pre-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"section-pre-class": "h_vc_input h_vc_libvpx h_vc_libvpx-vp9 h_vc_libx264 h_vc_libx265 h_vc_hevc_nvenc h_vc_h264_nvenc h_vc_h264_nvmpi h_vc_h264_vaapi h_vc_hevc_vaapi h_vc_h264_qsv h_vc_hevc_qsv h_vc_mpeg2_qsv h_vc_default h_vc_none",
"section-class": "h_m_input h_m_record h_m_idle",
"isSection": true,
"info": [

View File

@ -287,7 +287,7 @@ module.exports = (s,config,lang) => {
case'hls':
const hlsTime = !isNaN(parseInt(channel.hls_time)) ? `${parseInt(channel.hls_time)}` : '2'
const hlsListSize = !isNaN(parseInt(channel.hls_list_size)) ? `${parseInt(channel.hls_list_size)}` : '2'
if(videoCodec !== 'h264_vaapi' && !videoCodecisCopy){
if(videoCodec !== 'h264_nvmpi' && videoCodec !== 'h264_vaapi' && !videoCodecisCopy){
if(!arrayContains('-tune',streamFlags)){
streamFlags.push(`-tune zerolatency`)
}
@ -470,7 +470,7 @@ module.exports = (s,config,lang) => {
case'hls':
const hlsTime = !isNaN(parseInt(e.details.hls_time)) ? `${parseInt(e.details.hls_time)}` : '2'
const hlsListSize = !isNaN(parseInt(e.details.hls_list_size)) ? `${parseInt(e.details.hls_list_size)}` : '2'
if(videoCodec !== 'h264_vaapi' && !videoCodecisCopy){
if(videoCodec !== 'h264_nvmpi' && videoCodec !== 'h264_vaapi' && !videoCodecisCopy){
if(!arrayContains('-tune',streamFlags)){
streamFlags.push(`-tune zerolatency`)
}
@ -541,16 +541,17 @@ module.exports = (s,config,lang) => {
const segmentLengthInMinutes = !isNaN(parseFloat(e.details.cutoff)) ? parseFloat(e.details.cutoff) : '15'
const inputMap = buildInputMap(e,e.details.input_map_choices.record)
const { videoWidth, videoHeight } = validateDimensions(e.details.record_scale_x,e.details.record_scale_y)
const isNotCertainHwAccel = videoCodec !== 'h264_nvmpi' && videoCodec !== 'h264_vaapi';
if(inputMap)recordingFlags.push(inputMap)
if(e.details.cust_record)customRecordingFlags.push(e.details.cust_record)
//record - resolution
if(customRecordingFlags.indexOf('-strict -2') === -1)customRecordingFlags.push(`-strict -2`)
// if(customRecordingFlags.indexOf('-threads') === -1)customRecordingFlags.push(`-threads 10`)
if(!videoCodecisCopy){
if(!videoCodecisCopy) {
if(videoWidth && videoHeight){
recordingFlags.push(`-s ${videoWidth}x${videoHeight}`)
}
if(videoExtIsMp4){
if(isNotCertainHwAccel && videoExtIsMp4){
recordingFlags.push(`-crf ${videoQuality}`)
}else{
recordingFlags.push(`-q:v ${videoQuality}`)
@ -754,7 +755,7 @@ module.exports = (s,config,lang) => {
if(outputFilters.length > 0){
outputFlags.push(`-vf "${outputFilters.join(',')}"`)
}
if(videoCodec !== 'h264_vaapi' && !videoCodecisCopy){
if(videoCodec !== 'h264_nvmpi' && videoCodec !== 'h264_vaapi' && !videoCodecisCopy){
if(!arrayContains('-tune',outputFlags)){
outputFlags.push(`-tune zerolatency`)
}

View File

@ -133,12 +133,12 @@ module.exports = (s,config,lang) => {
}
const fetchCameraDetails = async (camera, onvifUsername, onvifPassword, foundCameraCallback, failedCameraCallback) => {
const previousSuccess = scanStatus.allSuccessful[camera.ip];
if (previousSuccess) {
// console.log('FOUND PREVIOUS', camera.ip);
foundCameraCallback(previousSuccess);
return;
}
// const previousSuccess = scanStatus.allSuccessful[camera.ip];
// if (previousSuccess) {
// // console.log('FOUND PREVIOUS', camera.ip);
// foundCameraCallback(previousSuccess);
// return;
// }
try {
const device = new onvif.OnvifDevice(camera);
const info = await device.init();
@ -176,11 +176,11 @@ module.exports = (s,config,lang) => {
};
const handleCameraError = (camera, err, failedCameraCallback) => {
const previousSuccess = scanStatus.allSuccessful[camera.ip];
if (previousSuccess) {
// console.log('FOUND PREVIOUS AFTER ERROR', camera.ip);
return previousSuccess;
}
// const previousSuccess = scanStatus.allSuccessful[camera.ip];
// if (previousSuccess) {
// // console.log('FOUND PREVIOUS AFTER ERROR', camera.ip);
// return previousSuccess;
// }
const searchError = (find) => stringContains(find, err.message, true);
const commonIgnoredErrors = ['ECONNREFUSED', 'socket hang up'];
let foundDevice = false;
@ -293,7 +293,7 @@ module.exports = (s,config,lang) => {
if (signal.aborted) {
throw new Error('Aborted');
}
if(!scanStatus.allSuccessful[camera.ip]){
// if(!scanStatus.allSuccessful[camera.ip]){
const cameraIp = task.camera.ip;
const hasPingSuccess = allPingSuccess[cameraIp];
if (hasPingSuccess !== false) {
@ -302,11 +302,15 @@ module.exports = (s,config,lang) => {
const result = await fetchPromise;
if (result.refused) allPingSuccess[cameraIp] = !result.refused;
if (result.uri){
result.uri = detectAndReplaceReolinkRTSP(task.camera, addCredentialsToUrl({ url: result.uri, username: task.camera.user, password: task.camera.pass }));
try{
result.uri = detectAndReplaceReolinkRTSP(task.camera, addCredentialsToUrl({ url: result.uri, username: task.camera.user, password: task.camera.pass }));
}catch(err){
console.error(err)
}
}
responseList.push({...result});
}
}
// }
}, 1);
}
ipQueues[camera.ip].push({