QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
QiaoJiaSystem/VideoAnalysFromHC/main.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
QiaoJiaSystem/VideoToImageMulth/main.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp
@@ -75,15 +75,34 @@ appPref.setIntData("n_cut_min_duration", lst_dev.n_cut_min_duration); if (lst.size() > 0) { Json::Value json; for (auto item : lst) { std::string t_camIdex = item.str_cam_dev_id.toStdString(); std::string rtsp_url = rtspAddrBuild(item.str_ip.toStdString(), 554, item.str_username.toStdString(), item.str_password.toStdString(), item.str_brand.toStdString()); SdkRuleMap ruleMap = m_lDBTool->searchSdkRuleByCamId(item.str_cam_dev_id); int startCamNO = appPref.getIntData("CamStart") * appPref.getIntData("CamStep"); int CamCount = appPref.getIntData("CamStep"); auto itor = lst.begin(); if(startCamNO >= lst.size()) { ERR("startCamNO > lst.size()"); return; } for(int i=0; i < startCamNO; i++){ itor++; } for (int i = 0; i < CamCount; i++) { if (itor == lst.end()) { ERR("itor == lst.end()"); return; } std::string t_camIdex = itor->str_cam_dev_id.toStdString(); std::string rtsp_url = rtspAddrBuild(itor->str_ip.toStdString(), 554, itor->str_username.toStdString(), itor->str_password.toStdString(), itor->str_brand.toStdString()); SdkRuleMap ruleMap = m_lDBTool->searchSdkRuleByCamId(itor->str_cam_dev_id); for (auto &rule:ruleMap) { rule.second.strAddr = item.str_addr; rule.second.weekRuleVec = m_lDBTool->searchCameraWeekRuleByCamId(item.str_cam_dev_id, rule.first); rule.second.strAddr = itor->str_addr; rule.second.weekRuleVec = m_lDBTool->searchCameraWeekRuleByCamId(itor->str_cam_dev_id, rule.first); if(rule.second.nSdkType == PerStaticSdk) { @@ -94,7 +113,7 @@ else if(rule.second.nSdkType != FaceSdk) { float temp=1-(float)(rule.second.nThreshold)/100; rule.second.fSensitivity=(5+90*temp)/100; rule.second.fSensitivity=(5+90*temp)/100; } // if (rule.second.nThreshold < 5 ) // { @@ -116,10 +135,57 @@ json["rtsp"] = rtsp_url; // json["addr"] = item.str_addr.toStdString(); INFO("cam add is " << item.str_addr.toStdString()); INFO("cam add is " << itor->str_addr.toStdString()); addCamera(t_camIdex, ruleMap); itor++; } // for (auto item : lst) { // std::string t_camIdex = item.str_cam_dev_id.toStdString(); // std::string rtsp_url = rtspAddrBuild(item.str_ip.toStdString(), 554, item.str_username.toStdString(), // item.str_password.toStdString(), item.str_brand.toStdString()); // SdkRuleMap ruleMap = m_lDBTool->searchSdkRuleByCamId(item.str_cam_dev_id); // for (auto &rule:ruleMap) { // // rule.second.strAddr = item.str_addr; // rule.second.weekRuleVec = m_lDBTool->searchCameraWeekRuleByCamId(item.str_cam_dev_id, rule.first); // // if(rule.second.nSdkType == PerStaticSdk) // { // float temp=1-(float)(rule.second.nThreshold)/100; // rule.second.fSensitivity=(75+25*temp)/100; // // } // else if(rule.second.nSdkType != FaceSdk) // { // float temp=1-(float)(rule.second.nThreshold)/100; // rule.second.fSensitivity=(5+90*temp)/100; // } //// if (rule.second.nThreshold < 5 ) //// { //// rule.second.fSensitivity=0.95; //// } //// else if(rule.second.nThreshold > 95) //// { //// rule.second.fSensitivity=0.05; //// } //// else //// { //// rule.second.fSensitivity = 1-(float) (rule.second.nThreshold) / 100; //// } // // DBG("fSensitivity" << rule.second.fSensitivity); // } // appPref.setStringData(t_camIdex + "rtsp", rtsp_url); // // appPref.setStringData(t_camIdex+"addr", item.str_addr.toStdString()); // json["rtsp"] = rtsp_url; // // json["addr"] = item.str_addr.toStdString(); // // INFO("cam add is " << item.str_addr.toStdString()); // // addCamera(t_camIdex, ruleMap); // } } else { ERR("searchCamDevTableAll size is 0"); } QiaoJiaSystem/VideoAnalysFromHC/main.cpp
@@ -74,6 +74,10 @@ appPref.setLongData("gpu.index", 1); appPref.setIntData("show.image", 0); //todo appPref.setIntData("CamStart", atoi(argv[1])); appPref.setIntData("CamStep", atoi(argv[2])); //#todo get from config File // appPref.setStringData("ipAdd", "192.168.1.185"); // appPref.setIntData("ipPort", 9200); QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp
@@ -40,7 +40,7 @@ //初始化函数 void RtspAnalysManager::init() { NFO("MYH DEBUG HERE") INFO("MYH DEBUG HERE") auto lst = m_lDBTool->searchCamDevTableAll(); Record_Config lst_dev = m_lDBTool->searchConfigTableWithinServerInfo(); @@ -48,18 +48,51 @@ appPref.setIntData("n_cut_max_duration", lst_dev.n_cut_max_duration); appPref.setIntData("n_cut_min_duration", lst_dev.n_cut_min_duration); if (lst.size() > 0) { int startCamNO = appPref.getIntData("CamStart") * appPref.getIntData("CamStep"); int CamCount = appPref.getIntData("CamStep"); INFO("StartCamNO: "<<startCamNO<<" CamStep: "<<CamCount); auto itor = lst.begin(); for (auto item : lst) if(startCamNO >= lst.size()) { INFO("MYH DEBUG HERE"); std::string t_camIdex = item.str_cam_dev_id.toStdString(); std::string rtsp_url = rtspAddrBuild(item.str_ip.toStdString(), 554, item.str_username.toStdString(), item.str_password.toStdString(), item.str_brand.toStdString()); INFO("cam add is " << item.str_addr.toStdString()); ERR("startCamNO > lst.size()"); return; } for(int i=0; i < startCamNO; i++){ std::string t_camIdex = itor->str_cam_dev_id.toStdString(); std::string rtsp_url = rtspAddrBuild(itor->str_ip.toStdString(), 554, itor->str_username.toStdString(), itor->str_password.toStdString(), itor->str_brand.toStdString()); INFO("JumpCam: "<<t_camIdex<<" URL: "<<rtsp_url); itor++; } for (int i = 0; i < CamCount; i++) { if (itor == lst.end()) { ERR("itor == lst.end()"); return; } std::string t_camIdex = itor->str_cam_dev_id.toStdString(); std::string rtsp_url = rtspAddrBuild(itor->str_ip.toStdString(), 554, itor->str_username.toStdString(), itor->str_password.toStdString(), itor->str_brand.toStdString()); INFO("cam add is " << itor->str_addr.toStdString()); addCamera(t_camIdex, rtsp_url); itor++; } // for (auto item : lst) // { // std::string t_camIdex = item.str_cam_dev_id.toStdString(); // std::string rtsp_url = rtspAddrBuild(item.str_ip.toStdString(), 554, item.str_username.toStdString(), // item.str_password.toStdString(), item.str_brand.toStdString()); // INFO("cam add is " << item.str_addr.toStdString()); // // addCamera(t_camIdex, rtsp_url); // // } } else { ERR("searchCamDevTableAll size is 0"); } @@ -106,6 +139,7 @@ } else { removeCamera(index); INFO("removeCamera " << index); //DBG("removeCamera " << index); return addCamera(index, rtsp); } } @@ -208,7 +242,7 @@ INFO("Save Succeed Cam: "<<camId<<" ImageKey: "<<imageName); item->second->SaveImage(imageName,img); } else { ERROR("Save Failed Cam: "<<camId<<" ImageKey: "<<imageName); ERR("Save Failed Cam: "<<camId<<" ImageKey: "<<imageName); } INFO("MYH DEBUG HERE"); return true; QiaoJiaSystem/VideoToImageMulth/main.cpp
@@ -36,6 +36,10 @@ appPref.setLongData("gpu.index", 1); appPref.setIntData("show.image", 0); //todo appPref.setIntData("CamStart", atoi(argv[1])); appPref.setIntData("CamStep", atoi(argv[2])); appPref.setStringData("user.loop.absolute.path", appConfig.getStringProperty("cutPath")); IceRpcServer<RtspAnalysManager> server("RtspAnalysServer", 10009, "tcp"); server.setMessageSizeMax(1024 * 1024 * 50);