| | |
| | | #include "EncodeVideoManager.h" |
| | | #include "NewRecordVideoElement.h" |
| | | #include <basic/util/app/AppConfig.h> |
| | | #include <qdatetime.h> |
| | | |
| | | EncodeVideoManager::EncodeVideoManager(): |
| | | TimerElement(1000) |
| | | TimerElement(10*1000) |
| | | { |
| | | // m_hiredisTool.delKey("") |
| | | int thread_num=appConfig.getIntProperty("encode_thread_num"); |
| | |
| | | { |
| | | m_newEncodeVideoVec[i]->stop(); |
| | | delete m_newEncodeVideoVec[i]; |
| | | m_newEncodeVideoVec[i]=nullptr; |
| | | } |
| | | } |
| | | m_newEncodeVideoVec.clear(); |
| | | |
| | | } |
| | | void EncodeVideoManager::timerFunc() |
| | | { |
| | | // std::string tmp="camId="+m_camId+"videoCaptureElement"; |
| | | //ClockTimer cl("timerFunc"); |
| | | std::map<std::string,int> fileMap=m_hiredisTool.findAllFileStatus(); |
| | | // auto it=fileMap.begin(); |
| | | for(auto it=fileMap.begin();it!=fileMap.end();it++) |
| | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | //----/home/basic/work/qiaojia/cut/DS-2CD2T46WDA2-I20180622AACHC30488278/201901/22/2019012210/2019-01-22 10:32:38:171.mp4 |
| | | |
| | | std::string file_name=it->first; |
| | | int begin=file_name.find_last_of("/")+1; |
| | | int end= file_name.find(".mp4"); |
| | | std::string file_time=file_name.substr(begin,end-begin); |
| | | QDateTime dt = QDateTime::fromString(QString::fromStdString(file_time), "yyyy-MM-dd hh:mm:ss:zzz"); |
| | | if( (AppUtil::getCurrentUs()-dt.toMSecsSinceEpoch())>5*60*1000*1000) |
| | | { |
| | | DBG(file_name<<">5*60*1000*1000"); |
| | | m_hiredisTool.hashSet(file_list,file_name,RECORD_ENDING); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |