Using Terminal to Take Screenshots


 
Thread Tools Search this Thread
# 1  
Using Terminal to Take Screenshots

So I sometimes use the Terminal to take many screenshots in rapid succession. Since I have an interest in animation, I sometimes use this to capture and examine how other animators have drawn certain movements. To take my screenshots, I made a script (at least I think it's a script) with the following code:

Code:
screencapture -T .04 ~/Desktop/screenshot0.jpg;
screencapture -T .04 ~/Desktop/screenshot1.jpg;
screencapture -T .04 ~/Desktop/screenshot2.jpg;
screencapture -T .04 ~/Desktop/screenshot3.jpg;
screencapture -T .04 ~/Desktop/screenshot4.jpg;
screencapture -T .04 ~/Desktop/screenshot4.jpg;
screencapture -T .04 ~/Desktop/screenshot4.jpg;
screencapture -T .04 ~/Desktop/screenshot5.jpg;
screencapture -T .04 ~/Desktop/screenshot6.jpg;
screencapture -T .04 ~/Desktop/screenshot7.jpg;
screencapture -T .04 ~/Desktop/screenshot8.jpg;
screencapture -T .04 ~/Desktop/screenshot9.jpg;
screencapture -T .04 ~/Desktop/screenshot10.jpg;
screencapture -T .04 ~/Desktop/screenshot11.jpg;
screencapture -T .04 ~/Desktop/screenshot12.jpg;
screencapture -T .04 ~/Desktop/screenshot13.jpg;
screencapture -T .04 ~/Desktop/screenshot14.jpg;
screencapture -T .04 ~/Desktop/screenshot15.jpg;
screencapture -T .04 ~/Desktop/screenshot16.jpg;
screencapture -T .04 ~/Desktop/screenshot17.jpg;
screencapture -T .04 ~/Desktop/screenshot18.jpg;
screencapture -T .04 ~/Desktop/screenshot19.jpg;
screencapture -T .04 ~/Desktop/screenshot20.jpg;
screencapture -T .04 ~/Desktop/screenshot21.jpg;
screencapture -T .04 ~/Desktop/screenshot22.jpg;
screencapture -T .04 ~/Desktop/screenshot23.jpg;
screencapture -T .04 ~/Desktop/screenshot24.jpg;
screencapture -T .04 ~/Desktop/screenshot25.jpg;
screencapture -T .04 ~/Desktop/screenshot26.jpg;
screencapture -T .04 ~/Desktop/screenshot27.jpg;
screencapture -T .04 ~/Desktop/screenshot28.jpg;
screencapture -T .04 ~/Desktop/screenshot29.jpg;
screencapture -T .04 ~/Desktop/screenshot30.jpg

This should, in theory, take 30 screenshots in 1.5 seconds. In practice, my computer can't handle this either a) because it simply to much of a burden to capture so many images in 1.5 seconds, or b) because I haven't actually effectively told my computer what I want it to do. Right now, my computer takes the thirty screenshots over the course of about 5 or 6 seconds. For the purposes of capturing an animated movement, this is too slow.

Can anyone help me get my computer to do what I want it to do?

Last edited by vbe; 12-09-2011 at 02:00 PM.. Reason: reformat to be able to read it...
# 2  
I don't know the true reason but talking about script, you execute 30 times the same command line... that can be put in a script in two different ways:
Either you use a loop with a counter or
you use a loop with something that allow you to quit.

e.g. with counter:
Code:
#!/bin/ksh
i=0
while [ "$i" -le 30 ]
do
 screencapture -T .04 ~/Desktop/screenshot$i.jpg
 sleep 2
 let i=i+1
done

# 3  
Consider the concept of Stop Motion animation. You don't need to capture in real time, but you do need to play back in real time. Choose the resolution of your images to match the capabilities of you computer on playback.
# 4  
So I've changed the script to be more or less what vbe recommended. With regard to methyl, that's a fantastic idea! But how do I adjust the resolution of the screenshots? I read the manual entry of screencapture, but I didn't see a way to adjust picture quality.
# 5  
I'm assuming that your shell is bash. Does this help?
Code:
for i in {0..29}
do
    screencapture -x -T 0 -t tiff screenshot"$i".tiff
done

 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Science: Computers
Difficulty: Easy
The Windows ME operating system was released in the year 2000.
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to login and screenshots?

Dear All, Is that possible to open a url in chrome and then login with credentials and then click on particular link there ,then taking screenshot of that page via shell script ? I need to open an website like XXXXX.XXXX.XXX.XX:1235 ..there will be two fields for login Username and Password ... (2 Replies)
Discussion started by: onenessboy
2 Replies

2. Shell Programming and Scripting

How to get notified when screenshots are taken?

Hi, I use third-party softwares but like to get notified when screenshots, if any, are taken. Any hints on how to achieve it? Thanks, Riku Linux 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Ubuntu 14.04.3 LTS (3 Replies)
Discussion started by: rikuito
3 Replies

3. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

4. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies

5. What is on Your Mind?

Post Geeky Screenshots - Just for Fun

Hello All, I have been sitting idle (as usual -- what are scripts for!!) and just thought why can't we have a colorful thread full of screnshots of terminal emulators (PuTTY for example) of admins doing their work. It could be geeky enough and inspiring to those new to UNIX/Linux world. ... (1 Reply)
Discussion started by: admin_xor
1 Replies

6. UNIX for Dummies Questions & Answers

Taking Screenshots With the Terminal

Hi, So this is kind of a bizarre request: Is there a way I can get the Terminal to take 30 successive screenshot images over the course of 2 seconds? I figure you can do almost anything through the terminal, so I'm hoping this is possible, too. Truthfully, I don't know that much about Unix,... (1 Reply)
Discussion started by: TranscendArcus
1 Replies

7. UNIX for Dummies Questions & Answers

Taking Screenshots in Unix

Hello, I am trying to take screenshots of various windows and dialog boxes in Unix. I am primarily a Windows user and am wondering if Unix has the capability of taking screenshots similar to using "Print Screen" and "Alt+Print Screen" in Windows? If not, then could anyone please suggest a method... (3 Replies)
Discussion started by: Skybum105
3 Replies

8. UNIX for Advanced & Expert Users

GUI Screenshots - HP-UX

How do I capture screenshots on HP-UX and how do I name the files so I can move them to microsoft? (2 Replies)
Discussion started by: jay_mow
2 Replies

Featured Tech Videos