| | |
| | | #include <opencv2/opencv.hpp> |
| | | #include "../StructureApp/HiredisTool.h" |
| | | #include <atomic> |
| | | |
| | | class RtspAnalysManager; |
| | | |
| | | struct CvCapture_FFMPEG; |
| | | |
| | | /** |
| | |
| | | */ |
| | | class RtspCaptureElement: public TimerElement { |
| | | public: |
| | | RtspCaptureElement(const std::string& path,const std::string& camId, int fps = 30, int reOpenTime = -1, int gpuIndex = -1,RtspAnalysManager* manager= nullptr); |
| | | RtspCaptureElement(const std::string &path, const std::string &camId, int fps = 30, int reOpenTime = -1, |
| | | int gpuIndex = -1, RtspAnalysManager *manager = nullptr); |
| | | |
| | | //保存视频接口,从RtspAnalysManager发起调用 |
| | | void SaveVideo(const std::string& strImageName); |
| | | |
| | | //设置保存视频的最小和最大长度,单位是秒,实际的运行情况有一些差距,需要完善 |
| | | void SetVideoMinMaxSeconds(const int minSeconds,const int maxSeconds); |
| | | |
| | | private: |
| | | //线程执行函数 |
| | | virtual void timerFunc() override; |
| | | |
| | | //线程的一些变量初始化,线程启动的时候调用 |
| | | virtual void threadInitial() override; |
| | | |
| | | //线程结束函数的时候调用,完成一些资源的释放 |
| | | virtual void threadClosing() override; |
| | | |
| | | //打开视频 |
| | | void openVideo(); |
| | | |
| | | //根据timeStamp创建路径 |
| | | std::string MakeDir(const std::string& timeStamp); |
| | | |
| | | private: |
| | | //用来抓取视频的Ffmpeg的封装类 |
| | | CvCapture_FFMPEG* m_capture; |