Closed bookshiyi closed 9 months ago
btw, may an another bug in these code? https://github.com/l1npengtul/nokhwa/blob/dd0cd6e62850ba3a08de8d4fbd682b7033156459/nokhwa-bindings-macos/src/lib.rs#L1014-L1026
only min_frame_duration
but max_frame_duration
can not be found
I found a temporary solution that may help people with similar problems:
Use camera.set_camera_requset(request)
after camera.open_stream()
to set frame_format to YUYV, it can work.
btw, If you want set frame format to YUYV by function set_frame_format() in anywhere, or set_camera_request() before open_stream(), maybe not take effect.
Although I don't know where the problem is.
As mentioned before : https://github.com/l1npengtul/nokhwa/issues/72#issuecomment-1380531832
Even if I use function
camera.set_frame_format(FrameFormat::YUYV)
try to set frame format to YUYV, but frame's format is still NV12 by functioncamera.frame().unwrap().source_frame_format()
After some checks:
https://github.com/l1npengtul/nokhwa/blob/dd0cd6e62850ba3a08de8d4fbd682b7033156459/src/backends/capture/avfoundation.rs#L207-L211
Thanks to all contributors.