Search Unity

Video Issue with VideoPlayer Colors being washed out (WebGL)

Discussion in 'Audio & Video' started by bondd_dev, Aug 11, 2020.

  1. bondd_dev

    bondd_dev

    Joined:
    Feb 13, 2014
    Posts:
    2
    Hello,

    A quick background on the issue,

    I have a video I'm looking to play for a WebGL project. While the video looks just fine in the editor, when I go to build it out for the web, the colors are noticeably different (washed out) compared to the original/editor quality.

    (Left: Web Build, Right: Original Video)

    WashedOutColor.PNG

    As shown in the image, the colors are significantly washed out.


    The problem exists in both the locally hosted build and the web build hosted via GitHub pages. I'm using Chrome (Version 84.0.4147.125 (Official Build) (64-bit))


    I stream the video in using a URL from Dropbox. For privacy reasons, I haven't shown the entire video URL but I end it with ".mp4?dl=0" which I read about from here, (https://answers.unity.com/questions/1370621/using-videoplayer-to-stream-a-video-from-a-website.html Sir-Gatlin 's comment)

    In regards to the VideoPlayer, the video is played on a plane mesh that has a custom material with the URP Unlit shader. The VideoPlayer render mode is set to Render Texture. I have not tweaked any of the default Render Texture settings, aside from the dimensions to match the video file.

    The file type of the video is .mp4

    Below is a picture of the inspector properties for the following (left to right)

    1. The Video Player gameObject (the plane) and it's VideoPlayer component.

    2. The Render Texture.

    3. The Plane's Material with the Render Texture applied to the base map.

    InspectorSettings.PNG


    Here's a little more background about the render pipeline / lighting / editor settings. (Might seem random but I've read about these potentially creating issues with video playback.)

    1. The color space is Linear.

    2. There is no fog enabled.

    3. I am using the Universal Render Pipeline.

    4. I am using Post Processing effects (I don't think that's creating the issue but I included a picture of what effects I'm currently using.)

    PostProcessVolume.PNG

    5. I am using Unity 2020.1.0f1


    My thoughts on the issue,

    If I had to guess I'd say the problem lies in the Render Texture's Color Format. Unfortunately looking at the Unity Docs for answers hasn't proved very helpful explaining how/when to select certain ones.
    (https://docs.unity3d.com/2020.1/Documentation/ScriptReference/RenderTextureFormat.html)

    Any thoughts/insights would be greatly appreciated!

    Thanks for reading!
     
  2. EricBlanchard-Deleptual

    EricBlanchard-Deleptual

    Joined:
    Dec 28, 2014
    Posts:
    3
    Bobby, I saw your post here and on stack overflow. I'm having the same issue. I tried switching from Linear to Gamma, but still have the same problem. Did you try anything else to solve this?

    Cheers!
     
  3. Wim-Wouters

    Wim-Wouters

    Joined:
    Sep 26, 2012
    Posts:
    36
    same issue... any solutions?
     
  4. laxersaz

    laxersaz

    Joined:
    Apr 20, 2019
    Posts:
    5
    Also the same issue here... Any idea?
     
  5. sumpfkraut

    sumpfkraut

    Joined:
    Jan 18, 2013
    Posts:
    242
    same here...
    a solution is to change the color space from linear to gamma. not cool, but... :rolleyes:
     
    Salvador-Romero likes this.
  6. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I tried reproducing the problem with a new WebGL project, but I could not reproduce the washout issue. My project setup was:

    -A 5 seconds mp4 H264
    -Chrome Version 95.0.4638.69
    -Unity 2021.1.12f1
    -RenderTexture R8G8B8A8_UNORM
    -Universal Render Pipeline
    -Material Unlit/Texture
    -Colorspace Linear

    I am not sure what it could be. In WebGL, the browsers manage the decoding. Did you try another browser or shader? Did you have the same issues? It isn't easy to debug without reproducing the issue locally. If you or anyone has the same problems, could you please open a bug report? We will try looking into it.
     
    DhiaSendi likes this.
  7. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    43
    Thank you !
    Fixed by upgrading to Unity 2021.2.19f
     
    The_Island likes this.