SDL icon indicating copy to clipboard operation
SDL copied to clipboard

[Camera] CoreMedia: Incorrect pixel format used for USB HDMI Video grabber (YUYV 4:2:2)

Open oo8dev opened this issue 2 years ago • 3 comments

SDL_CameraSpec output (MacOS, testcamera): format: UYVY width: 1920 height: 1080

Device info (reported by Linux): USB: 1e4e:7111 (UVC 1.00 device eEver USB Device)

v4l2-ctl --device=/dev/video1 --all
Format Video Capture:
        Width/Height      : 1920/1080
        Pixel Format      : 'YUYV' (YUYV 4:2:2)
        Field             : None
        Bytes per Line    : 3840
        Size Image        : 4147200
        Colorspace        : sRGB
        Transfer Function : Rec. 709
        YCbCr/HSV Encoding: ITU-R 601
        Quantization      : Default (maps to Limited Range)

This aliexpress-cheap USB video grabber requires USB 3.0 and supports raw YUV transmission instead of MPEG. Also tested this video grabber on Windows and Linux, on both it works perfectly.

Internal "FaceTime HD Camera" also works perfectly.

Photo: out

oo8dev avatar Jun 10 '24 10:06 oo8dev

What are the inputs and outputs of CoreMediaFormatToSDL() when setting up the available formats?

slouken avatar Jun 10 '24 15:06 slouken

Actually, I looked at the spec and the formats were just wrong. Does this work better for you?

slouken avatar Jun 10 '24 16:06 slouken

Yup, works perfectly. Thanks!

oo8dev avatar Jun 10 '24 18:06 oo8dev