I've been reading here a lot, even though I haven't been using Keyboard Maestro for long.
Unfortunately I don't quite understand the logic of the programme and am hoping for some inspiration:
I want to monitor a selected area in a video and take a screenshot every time the image content changes.
These are teaching videos from my university and I would like to receive screenshots of the slides, which we otherwise only receive at the end of the semester so that we can take notes.
I had thought about whether it might be a macro that repeats every 5 seconds and could work with the ‘if all conditions met execute actions’ and ‘the OCR of Screen Area’.
But I don't know exactly how to set up the command so that it does what I want. So far I have configured the area and specified the interval. I can only save the screenshot in a clipboard, but not as a file.
I would prefer individual images. The second step is to create a PDF file to mark up and annotate the slides. This is the only reason why I want to create this macro.
Then the next questions are -- what are the videos like presentation-wise, and how can you tell when "the image content changes"? OCR adds some overhead but would help stop extra images when you've a screenful of unchanging text but a lecturer's talking head moving around in the corner. Straight-up image comparison will be quicker, will cope with changing slides that contain no OCRable content, but could be susceptible to, for example, colour shifts but no content change.
Neither will be as good as your own judgement, so you might prefer to write/use a macro that captured and sequentially-saved "slides" whenever you tapped a hot key.
I already have some of the videos. I would like to run the Keyboard Maestro macro over it in preparation so that I already have the slides and can then use these slides to watch the videos and take notes.
Basically, I would try both, as the videos are different. Sometimes you can see the lecturer's head, sometimes not. To start with, the simple method of direct image comparison is certainly sufficient. But I would be interested to know how good the recognition with OCR is.
Here's one that works the other way around -- you run it at the start of the "lecture", give it a time (in minutes) to run for, and it sits there capturing a screen shot every time the chosen screen area has changed but with a minimum delay of ~5 seconds.
You might have to play with the "Pause for n seconds" action -- different machines will take different times to do the "capture and save part", the pause is there to pad that bit out to about 5 seconds.
I've assumed you are saving the screen shots to a folder called "Lectures" on your Desktop -- change the path in the first action if you want to save them somewhere else. The macro automatically makes a sub-folder to hold this lecture's pictures -- there's no check, so make the lecture's "name" unique or process out old pictures before the next lecture -- and timestamps each image name to make it easier to process them later.
Even if you wanted OCR, I probably still do it this way and then post-process the images to do the text recognition -- if nothing else that'll let you triage the images first so you don't waste time on things like a slide that is built one line at a time and you only want the final version.
Wow, that's great. Thank you very much for the quick reply and especially for the script. I will try it out over the next few days. But the first test run looks very promising. Thank you very much