Program hang on quit on Mac OS X
See original GitHub issueThe program run and capture images properly but hang on exit and force quit is need on Mac (with Retina display) installed with OS X Yosemite (running inside eclipse).
17:46:30.145 [main] INFO com.github.sarxos.webcam.Webcam - WebcamDefaultDriver capture driver will be used
17:46:30.151 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
17:46:30.476 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Found device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:30.478 [main] DEBUG com.github.sarxos.webcam.Webcam - Setting new resolution 320x240
17:46:30.478 [main] WARN com.github.sarxos.webcam.Webcam - Automated deallocation on TERM signal is now enabled! Make sure to not use it in production!
17:46:30.478 [main] DEBUG com.github.sarxos.webcam.WebcamLock - Lock Webcam FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:30.488 [atomic-processor-1] INFO c.g.s.webcam.ds.cgt.WebcamOpenTask - Opening webcam FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:30.488 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Opening webcam device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:30.488 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Webcam device 0x1470000005ac8511 starting session, size java.awt.Dimension[width=320,height=240]
17:46:30.532 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Webcam device session started
17:46:30.532 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Initialize buffer
17:46:33.481 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
17:46:34.175 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Webcam device com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice@be4535e is now open
17:46:34.175 [main] DEBUG com.github.sarxos.webcam.Webcam - Webcam is now open FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:34.176 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Found device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:34.219 [main] DEBUG c.github.sarxos.webcam.WebcamUpdater - Webcam updater has been started
17:46:34.225 [main] DEBUG com.github.sarxos.webcam.WebcamPanel - Starting panel rendering and trying to open attached webcam
17:46:37.181 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
17:46:37.213 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Found device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:40.217 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
17:46:40.246 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Found device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:43.247 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
17:46:43.253 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Found device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:45.653 [shutdown-hook-1] INFO c.g.sarxos.webcam.WebcamShutdownHook - Automatic FaceTime HD Camera (Built-in) 0x1470000005ac8511 deallocation
17:46:45.653 [shutdown-hook-1] INFO com.github.sarxos.webcam.Webcam - Disposing webcam FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:45.664 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Disposing webcam device FaceTime HD Camera (Built-in) 0x1470000005ac8511
17:46:45.664 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Closing webcam device
17:46:46.256 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
The above is the message shown on eclipse console and hang after “Searching devices”.
Issue Analytics
- State:
- Created 9 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
How to force an app to quit on your Mac - Apple Support
Force an app to quit · Press these three keys together: Option (or Alt), Command, Esc (Escape).* · Or choose Force Quit from...
Read more >What happens when force quit doesn't work on your Mac?
A quick replacement for Force Quit is found in CleanMyMac X. This program by MacPaw has a tool that switches off your hanging...
Read more >What to do when an app hangs in OS X - CNET
Try forcing the Finder to quit by using the Force-quit window (in the Apple menu), but you can also relaunch the Dock by...
Read more >Apps Freeze or Quit Unexpectedly on macOS 10.14? How to Fix
1. Force-Quit and Restart the App ... You can quickly fix a frozen or unresponsive app by forcing it to quit if the...
Read more >Apps Crash and Unexpectedly Quit on Mac - Macube Cleaner
Solution 1. Force quit the app. When the app gets frozen or unresponsive, you might as well try force quit it by going...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just for the record, simply writing the static void main as follows:
Now you can use the webcam in JavaFx. My assumption is natively the main thread needs to exist, or something… I hope this is a useable workaround for some.
Of course you need to set running = false, when your JavaFX application is done with the Webcam.
The only way that I could solve this was by putting a shutdown hook with a halt:
If someone has a better solution, please share.
Thanks.