9#include <boost/program_options.hpp>
11void TestVideo(
const boost::program_options::variables_map &vm,
12 const std::map<std::string, std::string> &ffmpegOptions) {
13 std::vector<std::unique_ptr<FFmpegFrameSink>> sinks;
14 sinks.push_back(std::make_unique<VideoFrameSink>());
17 av_log_set_level(AV_LOG_QUIET);
20 vm[
"deviceName"].as<std::string>(), ffmpegOptions,
23 std::vector<uint8_t> data;
24 long long lastFrame = videoSink->getData(data);
25 cv::Mat mat = cv::Mat(videoSink->getHeight(), videoSink->getWidth(),
26 CV_8UC3, data.data());
28 std::atomic<bool> running =
true;
29 std::string title = std::to_string(
30 std::chrono::steady_clock::now().time_since_epoch().count());
33 while (running.load()) {
34 lastFrame = videoSink->getNextData(data, lastFrame);
35 cv::imshow(title, mat);
40 std::cout <<
"Press enter to stop\n";
void TestVideo(const boost::program_options::variables_map &vm, const std::map< std::string, std::string > &ffmpegOptions)
Definition: TestVideo.h:11
Definition: FFmpegRecorder.h:12
Definition: VideoFrameSink.h:17