1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #pragma once
- #include <iostream>
- #include <list>
- #include <opencv2/core.hpp>
- #include <opencv2/videoio.hpp>
- #include <opencv2/highgui.hpp>
- #include <opencv2/imgproc.hpp>
- #include <opencv2/imgproc/types_c.h>
- #include <time.h>
- #include <cstdlib>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- using namespace std;
- using namespace cv;
- class InferVideo
- {
- private:
- std::string m_fileName;
- string m_enc_type;
- string m_outputDir;
- int m_fps;
- int m_cacheTime;
- list<Mat> m_frameBuffer;
- int m_count;
- int m_videoMaxTime;
- Size m_frameSize;
- std::shared_ptr<cv::VideoWriter> m_videoWriter;
- bool m_videoStart;
- std::string pid;
- public:
- InferVideo(const string &outputDir,const string &enc_type, const int fps, const int videoMaxTime,const int cacheTime,const Size& frameSize);
- ~InferVideo();
- void Destroy();
- bool capture(int num, Mat& dst);
- string getFileName();
- int getVideoFps();
- int getVideoTime();
- void setPid(std::string Pid){
- this->pid = Pid;
- }
- };
|