Skip to content

Add video test to check copyExternalImageToTexture scaling issues #4576

Open

Description

@greggman

I'm not sure how to describe this but I was trying to use video with WebGPU and ran into the issue that Chrome and Safari mis-scales video when using copyExternalImageToTexture with certain videos.

I didn't check if the same issue exists with importExternalTexture

There's a repo here: https://greggman.github.io/doodles/test/webgpu-video-issue/video-test-with-file.html

It loads a 1920x1080 video. In WebGPU it sets the canvas size to the size of the video and the uses copyExternalImageToTexture to copy it directly into the canvas. In Chrome, in Windows the result is wrong size. In Safari on Mac the result is also the wrong size.

In WebGL it uses texImage2D to copy the video into a texture and then renders that texture to the canvs, This works on both browsers.


Safari, Mac

Image

Chrome, Windows

Image

Once we know what the issue is hopefully we can make a test for it

Activity

  1. added theissue type on Jan 26, 2026
  2. kainino0x commented on Jan 27, 2026

    @kainino0x
    Collaborator

    The chrome issue looks like a problem with the coded size (1920x1088) vs the display size (1920x1080). Dunno about the safari issue, might be unrelated

  3. greggman commented on Jan 27, 2026

    @greggman
    MemberAuthor

    I'm pretty sure the actual issue is more 1088 vs 1080. Looking at the right red border it looks plausible it's 8px off. Looking at the size of the text it's not just 8px off

  4. kainino0x commented on Jan 27, 2026

    @kainino0x
    Collaborator

    Oh I totally missed that. I saw the border was part of the video, I didn't realize the webpage ALSO had a 1px red border

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions