You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following latest updates to fix YUV Conversion #3828, I started to notice an issue with some video colors that is flickering. The issue only happens when launching multiple video readers from multiple threads on a single process (using Python) and when these videos have a different color space for example some videos with yuvj420p (BT470) and others in yuv420p.
In my use case, as a video is being read, new VideoReader are being created on seperate threads.
So therefore instanciating a new video reader seems to alter that common constant in some way causing a shift of color since the values in the matrix are different for the other video. I'm not yet 100% sure this is the issue since I did not yet work on fixing it.
I'm unsure how to best resolve this optimally for a proper PR.
@laurentchicoine This is something I've been meaning to fix since I submitted the original PR. The fix is to pass the yuv2rgb conversion matrix each time a frame is converted. I'll take a look next week.
Following latest updates to fix YUV Conversion #3828, I started to notice an issue with some video colors that is flickering. The issue only happens when launching multiple video readers from multiple threads on a single process (using Python) and when these videos have a different color space for example some videos with yuvj420p (BT470) and others in yuv420p.
In my use case, as a video is being read, new VideoReader are being created on seperate threads.
When investigating the issue I found that this is caused because the code is using a global constant matYuv2Color that is being updated in SetMatYuv2Rgb with call to cudaMemcpyToSymbol.
https://github.com/opencv/opencv_contrib/blame/eebd8977e158d81a4aaf41653a038b82cf6507d4/modules/cudacodec/src/cuda/ColorSpace.cu#L11
So therefore instanciating a new video reader seems to alter that common constant in some way causing a shift of color since the values in the matrix are different for the other video. I'm not yet 100% sure this is the issue since I did not yet work on fixing it.
I'm unsure how to best resolve this optimally for a proper PR.
@cudawarped since you worked on the original fix.
The text was updated successfully, but these errors were encountered: