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

How does one reinstantiate a WebCam instance? #903

Open
brianmichalk1 opened this issue Jul 11, 2023 · 0 comments
Open

How does one reinstantiate a WebCam instance? #903

brianmichalk1 opened this issue Jul 11, 2023 · 0 comments

Comments

@brianmichalk1
Copy link

I need to recreate a webcam after it's been disconnected, and reconnected. When I do that, an error is thrown:

com.github.sarxos.webcam.WebcamLockException: Webcam HD USB Camera: HD USB Camera /dev/video0 has already been locked

The source says I need to reinstantiate, so what is the proper way to do that?

Completely dispose capture device. After this operation webcam cannot be used any more and
full reinstantiation is required.
protected void dispose() {
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