import temporarilly stalls
Posted: 2013-05-19T07:00:24-07:00
Dear ImageMagick users & developers,
I am using ImageMagick to import whole desktop screenshots in some of my bash scripts in order to take action when certain "visual patterns" appear on screen. I actually monitor a fullscreen window that runs a video. While importing the desktop there are freezes of the screen and mouse movement and in-window graphics/video movement is quit erratic. I guess this happens when import runs after each new iteration.
Could you please tell me if I can somehow prevent them ?
Example script:
Thank you very much in advance...
PS: System information:
I am using ImageMagick to import whole desktop screenshots in some of my bash scripts in order to take action when certain "visual patterns" appear on screen. I actually monitor a fullscreen window that runs a video. While importing the desktop there are freezes of the screen and mouse movement and in-window graphics/video movement is quit erratic. I guess this happens when import runs after each new iteration.
Could you please tell me if I can somehow prevent them ?
Example script:
Code: Select all
#!/bin/bash
while true
do
# sleep 1s -> it also happens when there is 1s (or more) sleep between each iteration, although at proportionally longer intervals
import -window root -crop 400x200+400+950 "screenshot.png" && visgrep_pattern=$( visgrep -t 1000 "screenshot.png" "pattern.pat" "pattern.pat" | sed "s/,/ /g" | cut -d' ' -f 1 ) ;
[[ "${visgrep_pattern}" != "" ]] && echo 'Pattern found'
done
PS: System information:
Code: Select all
$ uname -a
Linux hostname 3.8.0-21-generic #32-Ubuntu SMP Tue May 14 16:16:16 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ import --version
Version: ImageMagick 6.7.7-10 2013-02-25 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"