Skip to content

Commit 923c58a

Browse files
committed
Dev artefacts of CV2
- OBS Virtual Camera support - Update type stubs
1 parent e56175a commit 923c58a

10 files changed

+11838
-5273
lines changed

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ This program can be used to automatically start, split, and reset your preferred
8686
About 10-15x slower than BitBlt based on original window size and can mess up some applications' rendering pipelines.
8787
- **Video Capture Device**
8888
Uses a Video Capture Device, like a webcam, virtual cam, or capture card.
89-
If you want to use this with OBS' Virtual Camera, use the [Virtualcam plugin](https://github.com/Avasam/obs-virtual-cam/releases) instead.
9089

9190
#### Capture Device
9291

@@ -218,7 +217,6 @@ The AutoSplit LiveSplit Component will directly connect AutoSplit with LiveSplit
218217

219218
- For many games, it will be difficult to find a split image for the last split of the run.
220219
- The window of the capture region cannot be minimized.
221-
- OBS' integrated Virtual Camera does not work and makes AutoSplit crash. So it's been disabled. Use the [Virtualcam plugin](https://github.com/Avasam/obs-virtual-cam/releases) instead.
222220

223221
## Resources
224222

Binary file not shown.

scripts/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ certifi
77
ImageHash>=4.3.1 # Contains type information + setup as package not module
88
git+https://github.com/boppreh/keyboard.git#egg=keyboard # Fix install on macos and linux-ci https://github.com/boppreh/keyboard/pull/568
99
numpy>=1.23.2 # Python 3.11 wheels
10-
opencv-python-headless>=4.6 # Breaking changes importing cv2.cv2
10+
# opencv-python-headless>=4.6 # Breaking changes importing cv2.cv2
11+
./res/opencv_python_headless-4.7.0+be945d8-cp37-abi3-win_amd64.whl # New typing + OBS Camera fixes
1112
packaging
1213
Pillow>=9.2 # gnome-screeshot checks
1314
psutil

src/capture_method/VideoCaptureDeviceCaptureMethod.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
if TYPE_CHECKING:
1515
from AutoSplit import AutoSplit
1616

17-
OBS_CAMERA_BLANK_PIXEL = [127, 129, 128]
17+
OBS_VIRTUALCAM_PLUGIN_BLANK_PIXEL = [127, 129, 128]
1818

1919

2020
def is_blank(image: cv2.Mat):
2121
# Running np.all on the entire array or looping manually through the
2222
# entire array is extremely slow when we can't stop early.
2323
# Instead we check for a few key pixels, in this case, corners
24-
return np.all(image[::image.shape[0] - 1, ::image.shape[1] - 1] == OBS_CAMERA_BLANK_PIXEL)
24+
return np.all(image[::image.shape[0] - 1, ::image.shape[1] - 1] == OBS_VIRTUALCAM_PLUGIN_BLANK_PIXEL)
2525

2626

2727
class VideoCaptureDeviceCaptureMethod(CaptureMethodBase):
@@ -30,8 +30,6 @@ class VideoCaptureDeviceCaptureMethod(CaptureMethodBase):
3030
description = (
3131
"\nUses a Video Capture Device, like a webcam, virtual cam, or capture card. "
3232
+ "\nYou can select one below. "
33-
+ "\nIf you want to use this with OBS' Virtual Camera, use the Virtualcam plugin instead "
34-
+ "\nhttps://github.com/Avasam/obs-virtual-cam/releases"
3533
)
3634

3735
capture_device: cv2.VideoCapture

src/capture_method/__init__.py

-3
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ async def get_camera_info(index: int, device_name: str):
185185
*[
186186
get_camera_info(index, name) for index, name
187187
in enumerate(named_video_inputs)
188-
# Will crash when trying to resize, and does not work to begin with
189-
# TODO: Should be fixed in next release of OpenCV (4.8)
190-
if name != "OBS Virtual Camera"
191188
],
192189
)
193190

0 commit comments

Comments
 (0)