Save frames in deepstream sample_test_1 c++ code

 //convert buffer to mat and image save
 GstMapInfo map_info;
 gst_buffer_map(buf, &map_info, GST_MAP_READ);
 uint8_t* image_data =;

 cv::Mat image(1280, 960, CV_8UC3, image_data);
 //cv::cvtColor(image, image, cv::COLOR_RGBA2BGR);
 cv::imwrite("/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream_lpr_app/deepstream-lpr-app/Frames/" + std::to_string (frame_number) + ".jpg", image);

gst_buffer_unmap(buf, &map_info);

This solution is not working its give me black image.
please guide me with improved code in c++.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Please refer to the open source code: osd_sink_pad_buffer_probe sources\apps\sample_apps\deepstream-image-meta-test\deepstream_image_meta_test.c to save pictures.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.