Plugin displays video with a mosaic green screen

I’m developing a fisheye Dewarp plugin, and I want to get the real-time yuv format frame data for special processing, referring to the RGBEnhancement project.

_bitmapLiveSource = new BitmapLiveSource(_selectedItem, BitmapFormat.BGR24);

_bitmapLiveSource.LiveContentEvent += BitmapLiveSourceLiveContentEvent;

Initialize the BitmapLiveSource instance, bind the frame processing event, in the BitmapLiveSourceLiveContentEvent, I read the data in BGR24 format, and then convert it to yuv data, do the special processing with the yuv data, and then put it into the image control to display.

Now the problem is that the live video played by the image control sometimes has a green screen with mosaic, is this because the BitmapLiveSourceLiveContentEvent processing time is too long resulting in the loss of frame data, and I’m sure it’s not caused by the image processing? What is the best solution? I did try initializing the BitmapLiveSource to YCbCr420_Planar format, but the data read out and saved to a file to view yuv is not correct.

I’m using sdk version 24.2.2.

Translated with DeepL.com (free version)

What is the Image control you are using for visualizing the dewarped data? To my knowledge the MIP APIs does not contain any controls allowing you to feed in your own images, so I assume it is a common .NET control? In that case it is difficult for us to provide any explanation on what is happening.

In general I would suggest that you make a decoupling of the event and the image processing, so that you don’t block the thread running behind the event triggering. Maybe introduce a queue to which you copy the image data and then have your own thread taking data of the queue, dewarp and invoke it back into the image control.

ok,Is there any way to get real-time YUV video data directly from the SDK?

unfortunately there are only the options listed here: https://doc.developer.milestonesys.com/html/index.html?base=miphelp/namespace_video_o_s_1_1_platform.html#aa3b622c7f194027d9a780e3412d05039&tree=tree_search.html?search=bitmaplivesource

Okay, thanks!