This commit is contained in:
Ivan
2022-06-09 16:13:32 +03:00
parent 24e2a91778
commit 6fc9ff1ae3
175 changed files with 29765 additions and 8329 deletions

View File

@@ -93,6 +93,7 @@ int main(int argc, char* argv[]) {
// Run for one minute
using namespace std::chrono;
int counter = 0;
cv::namedWindow("test2");
while (!is_terminated) {
counter += 1;
// The descriptors
@@ -124,18 +125,17 @@ int main(int argc, char* argv[]) {
std::cout << "metadata len = " << len << " "
<< std::string(video_frame.p_metadata)
<< std::endl;
cv::Mat frame(video_frame.yres, video_frame.xres, CV_8UC4, (char*)video_frame.p_data);
// cv::namedWindow("test");
std::cout << "The frame dimensions: " << frame.cols << " " << frame.rows << std::endl;
// cv::imshow("test2", frame);
// cv::waitKey(0);
} else {
std::cout << "video_frame.p_metadata is nullptr" << std::endl;
std::cout << "metadata len = " << len << std::endl;
}
if (!video_frame.p_metadata) {
auto p_data = video_frame.p_data;
std::cout << "The frame format type is: " << video_frame.frame_format_type << std::endl;
cv::Mat frame(video_frame.yres, video_frame.xres, CV_8UC4, p_data);
std::cout << "The frame dimensions: " << frame.cols << " " << frame.rows << std::endl;
cv::imshow("test2", frame);
cv::waitKey(0);
}
std::cout << "space (video frame)" << std::endl;
NDIlib_recv_free_video_v2(pNDI_recv, &video_frame);
break;