Does Fakesink block X11 display server?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) : GPU RTX 2070
• DeepStream Version : 5.0
• TensorRT Version : 7
• NVIDIA GPU Driver Version (valid for GPU only): 440.33.01

Hi, I’m using Deepstream to detect object in one thread, and put result to a buffer. In main thread, I use OpenCV to display detected frames from buffer, but the OpenCV command like cv::imshow(), cv::waitKey() are freeze, while cv::imwrite() work. When I comment out the fakesink element of Deepstream, OpenCV command work but Deepstream stop working with error streaming stop, reason not link (-1). I wonder if the fakesink still do some video render process and make the display server not available for the others.

Finally I found a solution, the problem comes from g_main_loop_run(), it blocks the main loop until it finish.
So, base on this thread:,
instead of using

gst_bus_add_watch() with a callback to handle bus messages, and run g_main_loop_run()

I use

gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GstMessageType(GST_MESSAGE_ERROR | GST_MESSAGE_EOS)) to handle bus message without run g_main_loop_run()

and it work fine.
Hope to help other people if have same problem.

1 Like