diff --git a/gst_get_ndi.cpp b/gst_get_ndi.cpp index fd55e18..a28a199 100644 --- a/gst_get_ndi.cpp +++ b/gst_get_ndi.cpp @@ -94,19 +94,19 @@ GstFlowReturn new_sample(GstAppSink* appsink, gpointer data) { static int framecount = 0; framecount++; - std::cout << "nnew frame " << framecount << std::endl; + //std::cout << "nnew frame " << framecount << std::endl; GstSample* sample = gst_app_sink_pull_sample(appsink); GstCaps* caps = gst_sample_get_caps(sample); GstBuffer* buffer = gst_sample_get_buffer(sample); const auto& n_memory = gst_buffer_n_memory(buffer); - std::cout << "n_memory = " << n_memory << std::endl; - std::cout << "buffer->pts = " << buffer->pts << std::endl; - std::cout << "buffer->dts = " << buffer->dts << std::endl; - std::cout << "buffer->duration = " << buffer->duration << std::endl; - std::cout << "buffer->offset = " << buffer->offset << std::endl; - std::cout << "buffer->offset_end = " << buffer->offset_end << std::endl; + //std::cout << "n_memory = " << n_memory << std::endl; + //std::cout << "buffer->pts = " << buffer->pts << std::endl; + //std::cout << "buffer->dts = " << buffer->dts << std::endl; + //std::cout << "buffer->duration = " << buffer->duration << std::endl; + //std::cout << "buffer->offset = " << buffer->offset << std::endl; + //std::cout << "buffer->offset_end = " << buffer->offset_end << std::endl; const GstStructure* info = gst_sample_get_info(sample); @@ -318,8 +318,8 @@ GstFlowReturn new_sample(GstAppSink* appsink, gpointer data) { // convert gstreamer data to OpenCV Mat, you could actually // resolve height / width from caps... - int width = 2560; - int height = 1440; + int width = 480; + int height = 270; GstStructure* s = gst_caps_get_structure(caps, 0); gboolean res = true; @@ -353,7 +353,7 @@ GstFlowReturn new_sample(GstAppSink* appsink, gpointer data) { } static gboolean my_bus_callback(GstBus* bus, GstMessage* message, gpointer data) { - g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message)); + //g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message)); switch (GST_MESSAGE_TYPE(message)) { case GST_MESSAGE_ERROR: { GError* err; @@ -781,6 +781,7 @@ int main(int argc, char* argv[]) { } else { std::cout << "Don't have any frames yet ..." << std::endl; + //std::cout << ""; } } diff --git a/my_ndi_source.cpp b/my_ndi_source.cpp index 4d191eb..25c0d32 100644 --- a/my_ndi_source.cpp +++ b/my_ndi_source.cpp @@ -45,8 +45,12 @@ int main(int argc, char* argv[]) { int64_t total_frames_counter = 0; // Let's open the video with OpenCV and read it - std::string path_to_file = "C:\\Users\\ivan\\Source\\Repos\\cv_networking_pipeline\\gstreamer_receive_video\\videos\\camera1-2020-10-14---19-38-42---093390448_scaled.mp4"; + // std::string path_to_file = "C:\\Users\\ivan\\Source\\Repos\\cv_networking_pipeline\\gstreamer_receive_video\\videos\\camera1-2020-10-14---19-38-42---093390448_scaled.mp4"; + std::string path_to_file; + std::cout << "Please, enter the path to the video_file" << std::endl; + std::cin >> path_to_file; cv::VideoCapture video_file(path_to_file); + std::cout << "Video File opened" << std::endl; cv::Mat frame;