Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[windows] OpenCV VideoCapture SEH exception with some backends #95

Open
funnbot opened this issue Sep 2, 2022 · 0 comments
Open

[windows] OpenCV VideoCapture SEH exception with some backends #95

funnbot opened this issue Sep 2, 2022 · 0 comments

Comments

@funnbot
Copy link
Contributor

funnbot commented Sep 2, 2022

From my testing the obs-virtualcam dll that gets runtime loaded can throw SEH exceptions which cannot be caught, although considering how frequently people experience this, its likely more backends can aswell.

The only way to catch SEH exceptions in C++ is to compile with the /EHa option, while /EHsc is the default for most C++ apps, as /EHa can introduce some performance and binary size issues.

This leaves the alternative of spawning a separate process to test the camera address, before the main process does.
A small exe distributed in the utilities folder will be included on windows builds, it only needs to link with OpenCV, and will attempt to open the hardware index, Using CreateProcess,the main process will then read the exit code and notify the user that the camera can't be opened with this address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant