| | |
| | | #include "RtspAnalysManager.h" |
| | | //#include <basic/pipe_element/ffmpeg/cap_ffmpeg_impl.hpp> |
| | | #include "../../../BasicPlatForm/basic/pipe_element/ffmpeg/FfmpegElement.cpp" |
| | | #include <basic/util/app/AppConfig.h> |
| | | |
| | | RtspCaptureElement::RtspCaptureElement(const std::string &path, const std::string &camId, int fps, int reopenTime, |
| | | int gpuIndex, RtspAnalysManager *manager) : |
| | |
| | | img.copyTo(copyMat); |
| | | std::string imageName = m_capture->GetImageName(); |
| | | m_pManager->SaveImageToRedis(m_camId, imageName, copyMat); |
| | | } |
| | | //#todo publish Video |
| | | if (m_publishVideoRet) { |
| | | if (videoPublishElement == nullptr) { |
| | | string path = appConfig.getStringProperty("srsAddr") + "cam" + m_camId + ".flv"; |
| | | cv::Size size_(appConfig.getIntProperty("pulish.width"), appConfig.getIntProperty("pulish.height")); |
| | | int gupIdx = appPref.getIntData("gpu.index"); |
| | | videoPublishElement = new ffmpeg::VideoPublishElement(path, size_, "flv", 25, gupIdx); |
| | | } else { |
| | | videoPublishElement->stop(); |
| | | videoPublishElement->wait(); |
| | | delete videoPublishElement; |
| | | videoPublishElement = nullptr; |
| | | } |
| | | } |
| | | fireConnectors(); |
| | | } |
| | |
| | | m_capture->SetMinMaxVideoSeconds(minSeconds, maxSeconds); |
| | | } |
| | | |
| | | void RtspCaptureElement::startPublishVideo() { |
| | | m_publishVideoRet = true; |
| | | } |
| | | |
| | | void RtspCaptureElement::stopPublishVideo() { |
| | | m_publishVideoRet = false; |
| | | } |
| | | |