I'm not sure how to describe this problem. Top screen image is playing in Unity. Bottom screen image is VLC player. Problem is highlighted in green. Is it color depth? Do I need to change a libVLC setting or something in Unity? I'm using RTSP for both feeds.
Thanks!
Edited
Designs
Child items
...
Linked items
0
Link issues together to show that they're related.
Learn more.
Color Gamut documentation is very poor. Google search reveals that it's an Occulus setting. It may also apply to Mac.
I'm not sure how to address my color space issue in Unity. Is it possible that changing the transfer function in libVLC to BT709 will update the texture with the correct colors? If I write the texture out to JPG vice rendering it in Unity will the colors be correct?
I took a screen capture of VLC Player and applied it to a texture in Unity and the image below shows the result. Unity can display the color space correctly.
Thank you for the providing the test DLL. Unfortunately it did not fix the issue.
Prior to this issue, my testing was primarily focused on ensuring that multiple video would reliably play via RTSP - which it does - flawlessly. Back then I had eight videos playing at once while the camera was zoomed out. I really wasn't playing attention to the color space. Since then I've been focusing on writing the app. Now that I'm close to production release I'm definitely noticing things. You can use big buck bunny to see color space issue as shown below.
I'm also noticing pixelation when I'm zoomed in - see second image below. You have to enlarge it to see the pixelation.
I'm thinking both issues are being caused by the color space issue I'm having. What do you think?
Hello, I'm the one doing the D3D11 rendering part in VLC and the "external rendering" API around it. That's what VLC for Unity uses.
The pixelated result is likely because the "rendering size" is not set properly. During playback VLC tells the Unity plugin the visible size of the source. The plugin should setup a texture of that size. Othwerwise if the size is too small we'll lose some details. I don't know if that's the way it works (it should). If it does then maybe that's way uses that texture when rendering.
It would be interesting to do the same comparison you did in #92 (comment 70088) with that image.
As for the "posterization" issue it may not come from the color space at all. It may depend on how Unity uses the texture. It would be interresting to see how you configured your texture in #92 (comment 70088) compared to how we do it.
The texture size has always been based what's retrieved from var texptr = _mediaPlayer.GetTexture(out bool updated); I've been scaling the Unity object to fit the user environment.
So based on your feedback, I parented the vlc mesh to an empty that is scaled to 1,1,1 and then after I get the dimensions from GetTexture, I scale the mesh to match the size of the texture. This way the mesh and texture are the same size. Below are the results. I've scaled the empty down to .01, .01, .01 and the results are the same.
You need to enlarge each image to see the differences. When the image is brightly lit with bright colors, there really isn't an issue. It's really the darker/muted colors where you can see the issue.
The K/DA video is 1920 x 1080 - using the current vlc for Unity dll
The Steel video is 1280 x 534 - using the dll that Martin provided
The Sintel video is 1280 x 546 - using the dll that Martin provided
It seems the shadow details and highlights are lost. So we are losing some dynamic range. It could be that we render in "full range" (0-255) but the Unity engine only uses "limited" range (16-235). We could switch to limited range and see if it works. I'm suprises that Unity would do that on a PC though (on console it would be a different story). Otherwise it may have to do with gamma vs linear range. Are you using the build that outputs linear range ?
In the black title screen, the text doesn't have not smooth edges. It could be a sign that the resolution used to render the VLC texture doesn't match what is used to render. It be worth checking what Unity uses to avoid aliasing in this case. In VLC we use D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT so that stretched sources look like the result you see (which looks smoother, more natural).