Video is broken in unity webgl builds

Why does the video look like this?

The original video looks like this

Unity 2022.3.9f1
Canvas - Raw Image - Render Texture - Video Player

        var vp = GetComponent<VideoPlayer>();
        vp.url = System.IO.Path.Combine(Application.streamingAssetsPath, streamingVideo);
        Debug.Log("web stream video: " + vp.url);
        vp.isLooping = true;
        vp.Play();

Does the video play correctly in any browser? Or is it like that in all browsers?

If you use a native video player program (Windows Media Player, VideoLan, etc) to view the file, does that work?

Something to try here to double check if it is Unity, or web browsers that would be at fault, is to create a small stand-alone video.html file with contents

<html><body><video controls autoplay src='test.mp4'></video></body></html>

and place that next to test.mp4, and then open the .html file in a browser. If that shows up correctly, then it is likely a Unity bug → please open a bug report with the test video file.

If that also shows up incorrectly, then it is likely a browser bug, or a system-installed codec bug. → report a bug to Chrome/Firefox/Safari.

As a workaround, I wonder if changing video codecs might help. Do you know which video codec the video is using?

@jukka_j Thank you for your reply.

I’ve tested in other browsers and only Firefox shows the problem.

QuickTime Player:

Safari:

Chrome:

Firefox:

By the way, I have no problem opening the video directly in Firefox. (with your test html)
It’s only through Unity Player that the problem occurs.

The codec for the video in question is shown below.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vecteezy_space.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:00:10.00, start: 0.000000, bitrate: 17881 kb/s
  Stream #0:0[0x1](eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 17877 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : Apple Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 libx264
      timecode        : 00:00:00:00
  Stream #0:1[0x2](eng): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      handler_name    : Apple Video Media Handler
      timecode        : 00:00:00:00

Thanks for the detailed data. This does suggest it would be a Firefox bug. Would you be able to report it over to Bugzilla Main Page ?