eduramiba / webcam-capture-driver-native

Native driver for Webcam Capture API
25 stars 8 forks source link

macOS M1 frame size issues #10

Closed msgilligan closed 1 year ago

msgilligan commented 1 year ago

on macOS Mojave, Mac M1, running the sample app using the built-in FaceTime camera:

name='FaceTime HD Camera', resolutions=[java.awt.Dimension[width=1920,height=1080], java.awt.Dimension[width=1280,height=720], java.awt.Dimension[width=1080,height=1920], java.awt.Dimension[width=1760,height=1328], java.awt.Dimension[width=640,height=480], java.awt.Dimension[width=1328,height=1760], java.awt.Dimension[width=1552,height=1552]

I'm seeing the following resolutions display "diagonal-striped" video:

It seems all the cases where height >= width, but I don't know if this is the actual cause.

The following workaround was used because the default size was failing:

        final Dimension dimension = new Dimension( 1920, 1080);
        device.setResolution(dimension);
msgilligan commented 1 year ago

Here's what the bad video looks like:

Screenshot 2022-12-09 at 4 34 42 PM

eduramiba commented 1 year ago

This must be related to height > width, I will check it, thanks for noticing! It will probably need some change in the code that updates the FX image and the buffered image.

eduramiba commented 1 year ago

Some resolutions were decoded wrong in Mac and Windows, this should now be fixed.