webrtc别墅门口机配置 - housekeeper-software/tech GitHub Wiki

app.json

{
   "interface":"eth0", #主网卡接口名称,一般设备上只有一个网卡,ifconfig看下
   "workspace":"/data/jingxi", #影子文件目录,此目录必须可写
   "scheme":"webrtc_outdoor", #用于升级定义的命令空间,正式版应该是 linux
   "disableFaceRecognition":false, #是否禁用人脸识别,如果禁用,人脸识别引擎不会启动,虹软引擎可以全部删除,因为我们是动态加载
   "autoReboot":"2,0-5", #设备自动重启规则,2表示2天重启一次,0-5:表示在0点到5点之间随机找个时间启动,每次都不固定,减少服务器的并发压力  
   "screenOffDelay":60, #灭屏时间,虽然此设备没有屏幕,但需要设置,时间合适,讲关闭摄像头和灯光
   "externalServiceTimeout":300 #外部服务(extservice)定时重启,单位为分钟,一般不需要改
}

device.json

{
   "camera":[  #这里定义设备中全部的camera,参数由设备固件决定,如果单射,去掉IR即可
      {
         "camera_id":1, #rgb camrea编号
         "name":"RGB", #rgb camera名称,必须叫这个名字
         "vi_dev_name":"rkispp_scale0", #驱动名称
         "rotation":270, #rgb摄像头需要旋转270度,这个是硬件参数决定的
         "fps":30, #帧率 
         "channel_id":0, #设备通道编号,rkmedia所需
         "buf_cnt":2, #硬件缓冲区个数
         "capture_size":"1280,720", #我们使用的分辨率,这个是设备呈现的分辨率,因为我们是竖屏,还需要旋转
         "iq_file_dir":"/etc/iqfiles" #camera的3a配置文件
      },
      {
         "camera_id":0, #ir摄像头编号
         "name":"IR", #必须叫这个名字
         "vi_dev_name":"rkispp_scale0",
         "rotation":90, #需要旋转90度
         "fps":30,
         "channel_id":1,
         "buf_cnt":2,
         "capture_size":"1280,720",
         "iq_file_dir":"/etc/iqfiles"
      }
   ],
   "encoder":{ #视频编码基本参数,用于webrtc视频通话
      "crop":"0,0,960,720", #摄像头视频剪裁区域,宽高必须为16的倍数
      "coded_size":"480,640", #编码分辨率
      "miniFPS":20, #未接通的时候视频帧率
      "maxFPS":25  #接通之后的视频帧率
   },
   "display":{ #屏幕显示参数,这个设备没有也无所谓
      "vo_dev_name":"/dev/dri/card0",
      "display_size":"800,1280"
   },
   "qrcode":{ #二维码识别参数
      "qr_code_interval":500, #每隔500毫秒识别一帧图像,图像来自rgb摄像头
      "crop_rect":"0,0,1280,720", #先对来自摄像头的图像进行剪裁,这个是剪裁区域定义,可以直接给摄像头的大小
      "target_size":"544,960", #对经过剪裁的图像进行缩放到这个尺寸,减小识别的CPU占用,提高效率
      "authedExpiredTime":120, #二维码识别成功之后就会缓存起来,这里设置缓存过期时间,秒单位
      "unAuthedExpiredTime":60, #未识别成功的过期时间
      "miniRepeatTime":2 #对于相同的二维码,报告给用户的间隔,意思是对于相同的二维码,每2秒钟报告一次
   },
   "mp4":{ #移动侦测录制视频的参数 
      "codec":"H264",  #编码格式为H264
      "rcMode":"VBR", #码率控制为动态码率
      "profile":66,  #h264编码参数
      "level":31,  #h264编码参数
      "rcQuality":"Higher", #编码质量控制
      "keyFrameInterval":10000, #关键帧间隔,毫秒为单位,目前配置为10秒输出一个关键帧
      "bitrateFactor":2.0 #比特率控制因子,
   }
}

face.json

{
   "face":{
      "max_buffer":4,
      "feature_mask":"",
      "detect_threshold":0.3,
      "postfilter_threshold":0.5,
      "sreen_attack_thr":0.6,
      "confidence_threshold":70,
      "compare_threshold":60,
      "ir_liveness_threshold":0.9,
      "rgb_liveness_threshold":0.65,
      "min_face_height":100, #人脸最小高度,这些参数可以控制灵敏度
      "face_within_thr":0.75, #人脸面积占比
      "offset":"1.00, 133.01, 1.00, 11.95, 0.4",  #双目偏差参数
      "pose_blur":{  #俯仰角
         "yaw":10,
         "pitch":10,
         "blur":0.8
      },
      "model":[
         {
            "name":"anchor_path",
            "path":"rv1109_anchor_A_encrypt.bin"
         },
         {
            "name":"detect_model",
            "path":"rv1109_detect_F2_encrypt.bin"
         },
         {
            "name":"postfilter_model",
            "path":"rv1109_postfilter_E_encrypt.bin"
         },
         {
            "name":"poseblur_model",
            "path":"rv1109_poseblur_A_encrypt.bin"
         },
         {
            "name":"refine_model",
            "path":"rv1109_landmark_A_encrypt.bin"
         },
         {
            "name":"liveness_bgr_model",
            "path":"rv1109_live_rgb_A_encrypt.bin"
         },
         {
            "name":"liveness_bgrir_model",
            "path":"rv1109_live_rgbir_B_encrypt.bin"
         },
         {
            "name":"age_gender_model",
            "path":"rv1109_age_gender_A_encrypt.bin"
         },
         {
            "name":"rc_model",
            "path":"rv1109_rc_attr_E_encrypt.bin"
         },
         {
            "name":"occl_model",
            "path":"rv1109_occlusion_A.bin"
         },
         {
            "name":"feature_model",
            "path":"rv1109_feat_Aries_encrypt.bin"
         },
         {
            "name":"liveness_feat_model",
            "path":"rv1109_liveness_feat_A.bin"
         }
      ]
   }
}

http_server.json

{ #定义本地http服务的参数
   "protocol_handlers":[
      {
         "name":"http",
         "port":8080, #侦听在8080端口
         "use_tls":false #不适用tls
      }
   ],
   "use_debug":true,
   "log_directory":"/tmp"
}

mqtt.json

{ #定义mqtt的一些基本参数 
   "mqtt":{
      "sendWhileDisconnected":false,
      "cleanSession":true,  #不能改,目前来说
      "keepAliveInterval":20 #mqtt心跳周期,20秒
   }
}

perpheral.json

{ #设备外设定义
   "antiTamper":{ #防拆传感器
      "dev":"/dev/at_adc",
      "threshold":900,
      "interval":100
   },
   "relay":{ #开门io接口
      "dev":"/dev/relay",
      "level":0
   },
   "watchdog":{ #看门狗配置
      "dev":"/dev/watchdog",
      "timeout":0,
      "interval":30
   },
   "human":{ #人体传感器配置,这是目前室外机的配置,不是小门铃的配置
      "delay":10
   },
   "rs485":{ #485,目前没有用到
      "dev":"/dev/ttyS4:115200",
      "dir":"/dev/rs485_dir",
      "write_level":1,
      "delay":20
   },
   "button":[ #小门铃按键的IO口
      {
         "dev":"/dev/doorbell",
         "level":0
      }
   ],
   "light":[ #小门铃的所有灯光IO口
      {
         "name":"rgb", #rgb补光灯
         "dev":"/dev/rgb_led",
         "maxValue":255,
         "defValue":1.0
      },
      {
         "name":"ir", #ir补光灯
         "dev":"/dev/ir_led",
         "maxValue":255,
         "defValue":1.0
      },
      {
         "name":"number", #门牌号背景灯
         "dev":"/dev/key_led2",
         "maxValue":255,
         "defValue":1.0
      },
      {
         "name":"button", #按键背景灯
         "dev":"/dev/key_led1",
         "maxValue":255,
         "defValue":1.0
      }
   ],
   "gpio":[ #这是gpio口的配置
      {
         "name":"human", #人体传感器,这是老款设备的配置,门铃可能会不同
         "listen":true,
         "pin":117,
         "edge":"both",
         "active":"",
         "dir":"in",
         "level":1
      }
   ]
}

push.json

[ #这是门口机推送呼叫请求的配置,目前还没用到
   {
      "name":"invite",
      "lang":"zh-cn",
      "pushType":"NOTICE",
      "deviceType":"ALL",
      "target":"TAG",
      "targetValue":"push_%s", #这是移动端需要注册的推送tag,我们是按照tag推送,规则是push_${FID}
      "title":"访客呼叫",
      "body":"门口有访客呼叫您",
      "isProduct":true,
      "storeOffline":true,
      "expireTime":60
   }
]

ssdp.json

{ #这是自动发现的配置 
	"host":"239.255.255.250:1900", #组播地址,这是ssdp标准的组播地址,在这个地址上不光会收到我们的包,也会收到其他设备的包,比如chrome浏览器的包
	"groupInterface":"eth0", #组播绑定的接口
	"nt":"urn:genius-intercom:device:outdoor", #表明我方是室外机 
	"st":"urn:genius-intercom:device:room", #表明是寻找室内机
	"productName":"Villa-Intercom-Outdoor",
	"enableLoopback":false,
	"httpPort":8080,  #本地http服务器的端口
	"sipPort":5080, #本地sip的端口
	"maxAge":60, #超时为1分钟
	"ttl":4 #包的生命周期,就是最多被路由器转发几次
}

webrtc.json

{
   "audioLabel":"audio",
   "videoLabel":"video",
   "portRange":"50000,55000",
   "initializeMute":true,  #呼叫未接通时静音
   "ice_transport_type":"All", #ice模式,这里可以修改为 None:不使用ICE,Relay:表示只走中转, NoHost:不走点对点
   "video_direction":"sendonly", #室外机只发送视频
   "webrtc_audio":{  #webrtc通过的语音处理参数
      "echo_cancellation":true,
      "auto_gain_control":true,
      "noise_suppression":true,
      "highpass_filter":true,
      "typing_detection":true,
      "experimental_agc":false,
      "experimental_ns":true,
      "residual_echo_detector":true,
      "audio_jitter_buffer_max_packets":200,
      "audio_jitter_buffer_fast_accelerate":true,
      "audio_jitter_buffer_min_delay_ms":0,
      "audio_jitter_buffer_enable_rtx_handling":false
   },
   "voip_audio":{ #电话的语音处理参数
      "echo_cancellation":true,
      "auto_gain_control":true,
      "noise_suppression":true,
      "highpass_filter":true,
      "typing_detection":false,
      "experimental_agc":false,
      "experimental_ns":true,
      "residual_echo_detector":true
   }
}