macOS 11: test captures in CI are darker than in 10.15
letmaik opened this issue · 3 comments
As far as I see, the only relevant change was GitHub Action's upgrade to macOS 11.
Old:
- Test captures from CI: test_captures.zip
- Actions: https://github.com/letmaik/pyvirtualcam/actions/runs/1538778242
- Commit: ee8f89a
- Note: The commit just after that unfortunately introduced an issue in storing of the test capture artifacts, which only was fixed in the current commit (see below). No relevant changes happened within the "blackout" though in the code.
- OS: macOS 10.15.7
Current:
- Test captures from CI: test_captures.zip
- Actions: https://github.com/letmaik/pyvirtualcam/actions/runs/1884252051
- Commit: c8b67f6
- OS: macOS 11.6.3
In both old and current, the OBS version used in CI was the same: 26.1.2.
Log excerpt showing the diff for current:
FAILED ../test/test_capture.py::test_capture[diff-RGB-obs] - assert 24.0 <= 2
FAILED ../test/test_capture.py::test_capture[diff-BGR-obs] - assert 24.0 <= 2
FAILED ../test/test_capture.py::test_capture[diff-I420-obs] - assert 33.0 <= 2
FAILED ../test/test_capture.py::test_capture[diff-NV12-obs] - assert 33.0 <= 2
FAILED ../test/test_capture.py::test_capture[diff-YUYV-obs] - assert 33.0 <= 2
FAILED ../test/test_capture.py::test_capture[diff-UYVY-obs] - assert 33.0 <= 2
Comparison
This is for UYVY which is the native pixel format of this camera, so theoretically it should be closest to the reference.
Reference
Old
Current
I'm not sure where the issue is coming from. It would be good to get independent user verification from someone running macOS 11.
I should note that the test capture mechanism used here relies on OpenCV's VideoCapture, but the OpenCV Python package version is pinned to 4.5.1.48 (see dev-requirements.txt for why), both in old and current.
Things to try:
-
Bumping the OBS version in CI to the latest is worth a try, maybe some fixes were needed for macOS 11, though it's unlikely. EDIT: Tried that but didn't help: https://github.com/letmaik/pyvirtualcam/runs/5300762692
-
Run the CI workflow to use macOS 10.15 which is still available. Currently it uses macos-latest which switched to macos 11 recently. EDIT: This avoids the issue! https://github.com/letmaik/pyvirtualcam/actions/runs/1886403645
Status: To keep CI green, I switched back to 10.15 in the meantime. EDIT: CI is now using macOS 11 because 10.15 is EOL. The capture tests have been relaxed to accept a larger diff for macOS. See #96.
Call for help: If someone has macOS 11, try the following experiment and report back:
- Output a fixed test image on the virtual camera in OBS (the app, not using Python).
- Start some video app like Zoom and take a screenshot of the virtual cam image.
- Check if they are identical or not.
- If the screenshot is darker, then the issue can be reported to OBS and is not related to pyvirtualcam.
I used the color picker to check your images. Zoom and Teams are actually identical. Note that the image is flipped horizontally in Zoom for preview.
Both images differ from the reference image but I'm not sure what the difference is exactly - the greens are brighter in Zoom/Teams, but the orange and red are slightly darker.
I'm not sure if this is an actual issue or maybe coming from some settings of the graphics driver which sometimes tune images to look "better". After all, this is a camera device and goes through a few layers of the operating system.
Just did some tests on macOS 11.7 with OBS 28.0.2 and pyvirtualcam 0.10.0.
When using pyvirtualcam to send the test image, then there is a perfect match between the input image and what's shown in webcamtests.com in Firefox, so that's good.
When using OBS to send the test image, then the image in Firefox is slightly different. This is a bit surprising.
When using pyvirtualcam to send the test image and capturing it in Python via OpenCV, then the captured image is slightly different. This is the behavior described in this issue.
I'm going to close this issue as it doesn't seem to be an issue with pyvirtualcam itself. It's a bit unfortunate but a proper investigation on what's going on in macOS would take too much time.