l1npengtul / nokhwa

Cross Platform Rust Library for Powerful Webcam/Camera Capture
Apache License 2.0
482 stars 111 forks source link

avfoundation: set videoSettings explicitly #151

Closed yamt closed 9 months ago

yamt commented 9 months ago

It seems by default AVCaptureVideoDataOutput converts frames to kCMVideoCodecType_422YpCbCr8. (= kCMPixelFormat_422YpCbCr8) Unfortunately it doesn't match what nokhwa decides to use on my environment. (kCMPixelFormat_422YpCbCr8_yuvs)

This commit configures AVCaptureVideoDataOutput to use the same pixel format. (Thus no conversions)

Only tested for kCMPixelFormat_422YpCbCr8_yuvs.