Screen Capture

Submitted by rootlet on Fri, 04/02/2010 - 14:46

You can capture still images of videos of anything on the computer screens that Biology supports.

Capture Stills

To capture still images, you can use some magic keystrokes:

Capture whole screen: Command + Shift + 3

Capture region: Command + Shift + 4 to turn cursor to cross-hairs, then select region.

There is also an application in the Utilities folder called "Grab" that will let you set some options or get images just of particular windows.

Capture Video

To capture video, you need to use the command-line. Videos of the entire screen are very large. You might want to use the System Preferences to set the screen resolution lower before starting to capture video. We're using the vnc2flv project. Start up Terminal (Also in the Utilities folder, but there a shortcut in the Dock). You can use two commands to start recording video. With any luck, it will be as simple as this:

First, go to the Desktop to save your work there: delfeno:~ sbrewer$ cd Desktop

Then start x11vnc: delfeno:Desktop sbrewer$ x11vnc &

You'll see a bunch of output -- once the output stops, hit return to get the prompt back, then type: delfeno:Desktop sbrewer$ flvrec.py

It will record video and save it in a file on the Desktop until you tell it to stop. You tell it to stop by typing Control + C. You should end up with a file on the Desktop called something like "out201004020900.flv". You can open this file using VLC to watch the video. To import the file into iMovie, you need to transcode the file into something iMovie understands: delfeno:Desktop sbrewer$ ffmpeg -i out201004020900.flv -sameq out201004020900.mov

The .mov file can be imported into iMovie, where you can edit the clip, add a sound-track, or combine with other videos.

Below is a complete session so you can see all the parts put together.

   Last login: Fri Apr  2 09:21:58 on ttys006
   delfeno:~ sbrewer$ cd Desktop
   delfeno:Desktop sbrewer$ x11vnc &
   [1] 37779
   delfeno:Desktop sbrewer$ 02/04/2010 09:44:17 MacOS X: set -connect file to /tmp/x11vnc-macosx-remote.sbrewer
   ###############################################################
   #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
   #@                                                           @#
   #@  **  WARNING  **  WARNING  **  WARNING  **  WARNING  **   @#
   #@                                                           @#
   #@        YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!!        @#
   #@                                                           @#
   #@  This means anyone with network access to this computer   @#
   #@  may be able to view and control your desktop.            @#
   #@                                                           @#
   #@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
   #@                                                           @#
   #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
   #@                                                           @#
   #@  You can create an x11vnc password file by running:       @#
   #@                                                           @#
   #@       x11vnc -storepasswd password /path/to/passfile      @#
   #@  or   x11vnc -storepasswd /path/to/passfile               @#
   #@  or   x11vnc -storepasswd                                 @#
   #@                                                           @#
   #@  (the last one will use ~/.vnc/passwd)                    @#
   #@                                                           @#
   #@  and then starting x11vnc via:                            @#
   #@                                                           @#
   #@      x11vnc -rfbauth /path/to/passfile                    @#
   #@                                                           @#
   #@  an existing ~/.vnc/passwd file from another VNC          @#
   #@  application will work fine too.                          @#
   #@                                                           @#
   #@  You can also use the -passwdfile or -passwd options.     @#
   #@  (note -passwd is unsafe if local users are not trusted)  @#
   #@                                                           @#
   #@  Make sure any -rfbauth and -passwdfile password files    @#
   #@  cannot be read by untrusted users.                       @#
   #@                                                           @#
   #@  Use x11vnc -usepw to automatically use your              @#
   #@  ~/.vnc/passwd or ~/.vnc/passwdfile password files.       @#
   #@  (and prompt you to create ~/.vnc/passwd if neither       @#
   #@  file exists.)  Under -usepw, x11vnc will exit if it      @#
   #@  cannot find a password to use.                           @#
   #@                                                           @#
   #@                                                           @#
   #@  Even with a password, the subsequent VNC traffic is      @#
   #@  sent in the clear.  Consider tunnelling via ssh(1):      @#
   #@                                                           @#
   #@    <a href="http://www.karlrunge.com/x11vnc/#tunnelling">http://www.karlrunge.com/x11vnc/#tunnelling</a>            @#
   #@                                                           @#
   #@  Or using the x11vnc SSL options: -ssl and -stunnel       @#
   #@                                                           @#
   #@  Please Read the documention for more info about          @#
   #@  passwords, security, and encryption.                     @#
   #@                                                           @#
   #@    <a href="http://www.karlrunge.com/x11vnc/faq.html#faq-passwd">http://www.karlrunge.com/x11vnc/faq.html#faq-passwd</a>    @#
   #@                                                           @#
   #@  To disable this warning use the -nopw option, or put     @#
   #@  the setting in your ~/.x11vncrc file.                    @#
   #@                                                           @#
   #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
   ###############################################################
   02/04/2010 09:44:19 x11vnc version: 0.9.9 lastmod: 2009-12-21  pid: 37779
   02/04/2010 09:44:19 XOpenDisplay(":0.0") failed.
   02/04/2010 09:44:19 Trying again with XAUTHLOCALHOSTNAME=localhost ...
   02/04/2010 09:44:19 Continuing without X display in -rawfb mode.
   02/04/2010 09:44:19 macosxCG_init: initializing display.
   02/04/2010 09:44:19 console_guess: file is /dev/null
   02/04/2010 09:44:19 console_guess returned: map:macosx:/dev/null@1680x1050x32:ff0000/ff00/ff
   02/04/2010 09:44:19 raw fb is non-regular file: /dev/null
   02/04/2010 09:44:19 rawfb: macosx fb: /dev/null
   02/04/2010 09:44:19    w: 1680 h: 1050 b: 32 addr: 0x1860000 sz: 7056000
   02/04/2010 09:44:20 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/6720
   02/04/2010 09:44:20 
   02/04/2010 09:44:20 Raw fb at addr 0x1860000 is 32bpp depth=24 true color
   02/04/2010 09:44:20 
   02/04/2010 09:44:20 Autoprobing TCP port 
   02/04/2010 09:44:20 Autoprobing selected port 5900
   02/04/2010 09:44:20 fb read rate: 10 MB/sec
   02/04/2010 09:44:20 Manually set num_buttons to: 5
   02/04/2010 09:44:20 screen setup finished.
   02/04/2010 09:44:20 
   02/04/2010 09:44:20 WARNING: You are running x11vnc WITHOUT a password.  See
   02/04/2010 09:44:20 WARNING: the warning message printed above for more info.
   02/04/2010 09:44:20 
   
   The VNC desktop is:      delfeno.bio.mor.nsm:0
   PORT=5900
   
   delfeno:Desktop sbrewer$ flvrec.py 
   start recording
   02/04/2010 09:44:26 Got connection from client 127.0.0.1
   02/04/2010 09:44:26   other clients:
   02/04/2010 09:44:26 macosxCG_callback: register
   02/04/2010 09:44:26 incr accepted_client=1 for 127.0.0.1:53061  sock=5
   02/04/2010 09:44:26 Client Protocol Version 3.8
   02/04/2010 09:44:26 Protocol version sent 3.8, using 3.8
   02/04/2010 09:44:26 rfbProcessClientSecurityType: executing handler for type 1
   02/04/2010 09:44:26 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
   02/04/2010 09:44:26 Pixel format for client 127.0.0.1:
   02/04/2010 09:44:26   32 bpp, depth 8, big endian
   02/04/2010 09:44:26   true colour: max r 255 g 255 b 255, shift r 24 g 16 b 8
   02/04/2010 09:44:26 Using raw encoding for client 127.0.0.1
   02/04/2010 09:44:26 copy_tiles: allocating first_line at size 54
   02/04/2010 09:44:27 client_set_net: 127.0.0.1  0.0007
   ^Cstop recording
   delfeno:Desktop sbrewer$ 02/04/2010 09:44:33 client_count: 0
   02/04/2010 09:44:33 viewer exited.
   02/04/2010 09:44:33 deleted 53 tile_row polling images.
   02/04/2010 09:44:33 macosxCG_callback: unregister
   
   [1]+  Done                    x11vnc
   delfeno:Desktop sbrewer$ ffmpeg -i out201004020944.flv -sameq out201004020944.mov
   FFmpeg version 0.5.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
     configuration: --enable-libmp3lame --enable-libfaac --enable-nonfree
     libavutil     49.15. 0 / 49.15. 0
     libavcodec    52.20. 1 / 52.20. 1
     libavformat   52.31. 0 / 52.31. 0
     libavdevice   52. 1. 0 / 52. 1. 0
     built on Mar 31 2010 12:11:13, gcc: 4.0.1 (Apple Inc. build 5493)
   
   Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 12.00 (12/1)
   Input #0, flv, from 'out201004020944.flv':
     Duration: 00:00:07.16, start: 0.000000, bitrate: N/A
       Stream #0.0: Video: flashsv, bgr24, 1696x1056, 12 tbr, 1k tbn, 1k tbc
   Output #0, mov, to 'out201004020944.mov':
       Stream #0.0: Video: mpeg4, yuv420p, 1696x1056, q=2-31, 200 kb/s, 90k tbn, 12 tbc
   Stream mapping:
     Stream #0.0 -> #0.0
   Press [q] to stop encoding
   frame=   87 fps= 42 q=0.0 Lsize=    7277kB time=7.25 bitrate=8222.8kbits/s    
   video:7276kB audio:0kB global headers:0kB muxing overhead 0.019529%
   delfeno:Desktop sbrewer$