Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been using import from Imagemagick to take screenshot of my second monitor every 15 seconds, and then later assembled the images using mencoder - thus creating a timelapse of what has been going on on my desktop during the time. This worked great when I used Gnome 2 - but as of late, my shots has gotten several artifacts in them. Black rectangles appearing in various places.

This does not occur with gnome-screenshot, but I need something that is powerful enough to do the equivilent to this:

# Capture 1920 x 1080 to file, starting at position 1680 x 0 (Monitor to the
# left is 1680x1050, monitor to the right is 1920 x 1080 - I want to capture the
# monitor to the right.)

while [ 1 ]; do
    import -window root -crop 1920x1080+1680+0 ~/img/foo-$(date +%y%m%d-%H%M%S).jpg
    sleep 15
done

and gnome-screenshot does not seem to have the options available to do this. I have not found any way to make the artifacts in the shots of import go away.

Does anyone have any clever suggestions for me?

share|improve this question
add comment

1 Answer

I have had some pretty good luck with xwd. I screenshot the whole desktop then use imagemagick to cut out just the portion I want.

I have also been using the tool's ability to pull from specific window titles.

http://blog.tordeu.com/?p=135

Using the information on that blog post I have created the following python function which I use to take screenshots of a window with "mywindow" in the title bar.

def store_mywindow_screenshot():
    command = 'xdotool windowraise `xdotool search --title ".*mywindow.*"`'
    os.system(command)
    command = 'xwd -id `xdotool search --title ".*mywindow.*"` -out mywindow_screenshot.xwd'
    os.system(command)
    command = "convert mywindow_screenshot.xwd mywindow_screenshot_%s.png" % datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
    os.system(command)

As I have been capturing a window that is a 3d opengl app, i imagine xwd would be robust enough for your application

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.