-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Is it possible to take a screenshot/screencapture using opencv on a mac? #1756
Comments
According to the docs at https://trac.ffmpeg.org/wiki/Capture/Desktop something like this should work: FrameGrabber grabber = new FFmpegFrameGrabber("1");
grabber.setFormat("avfoundation");
grabber.setFrameRate(30);
grabber.start(); |
I tried using that. However, I keep getting an When I run I am using the following dependencies:
Here is the full error statement:
I tried calling I was able to record from the webcam using |
Could you check what you get after setting the "org.bytedeco.javacpp.logger.debug" system property to "true"? |
I do not see the path |
It's a "system property", you can set it however your want: |
Typically, calling something like |
Got it, thanks. Here is what it gives
|
…FrameRecorder.tryLoad()` (issue #1756)
I see, |
It works now! Thank you @saudet! It the default pixel format (bgr24) gave an error. I used one of the suggested supported pixel formats |
@saudet do you know of a more efficient way of saving the captured frames? I am currently capturing the screen frames, displaying them on a CanvasFrame and recording from the frame. Do you have an example of how to have the program capture the screen without using a CanvasFrame? I am trying to use a while loop to continuously capture the frames. However, only one frame gets captured and the recording stops. Any ideas on what I am doing wrong?
I am getting the following warnings but could not figure out how to resolve them: |
You can stop using CanvasFrame entirely, that's just to display frames. We don't need it to record them.
I don't know, but according to a quick search, it just sounds like a permission problem with your system, for example, see |
I also saw that thread and made sure the permissions were correctly set. The screen gets recorded for one second and the one-two frame clip gets saved. However it then terminates. |
@spectacularcrackers There's another issue in the case of avfoundation that was fixed in commit 8d75c0a, see issue #1784. |
The new snapshot fixed it. Thanks @saudet ! |
The fix has been released with JavaCV 1.5.8. Thanks for reporting! |
I would like to take a screenshot of my mac every second using opencv. Is this possible? If so, is there an example that I could reference?
I see the wiki document for windows (https://github.com/bytedeco/javacv/wiki/Screen-Capture-on-Windows), but I am not sure how to implement it for Mac.
The text was updated successfully, but these errors were encountered: