#include "EncodeVideo.h"
|
|
EncodeVideo::EncodeVideo():
|
videoEncoderElement(cv::Size(1920, 1080), 8, 0)
|
{
|
|
}
|
EncodeVideo::~EncodeVideo()
|
{
|
|
}
|
|
void EncodeVideo::threadFunc()
|
{
|
// std::string tmp="threadFunc";
|
// ClockTimer cl(tmp);
|
|
std::string src_path=getProperty("src_path");
|
if(src_path.empty())
|
{
|
DBG("src_path.empty()");
|
return ;
|
}
|
int size=m_hiredisTool.getSize(src_path);
|
|
bool fileCreate = false;
|
for(int i=0;i<size;++i)
|
{
|
|
cv::Mat img;
|
m_hiredisTool.getImage(src_path,img);
|
if(img.empty()){
|
DBG("img.empty()");
|
continue;
|
}
|
|
if(!fileCreate)
|
{
|
fileCreate = true;
|
DBG("fileCreate buf_size="<<size<<" file_name="<<src_path);
|
videoEncoderElement.threadInitial(getProperty("src_path"),img);
|
|
}
|
else
|
{
|
|
videoEncoderElement.doFunc(img);
|
}
|
// usleep(1000);
|
}
|
|
videoEncoderElement.threadClosing();
|
m_hiredisTool.delKey(src_path);
|
m_hiredisTool.hashDel(file_list,src_path);
|
}
|