ScreenGrab
==========

Do you want to record your desktop, but can't seem to find one that works well?
Are you intimidated by ffmpeg? Then ScreenGrab might be able to help you!

## Dependencies

 *  `ffmpeg` must be installed. It does all the heavy lifting.
 *  `xdotool` is needed to find window dimensions etc.
 *  `php`

## Usage

ScreenGrab has defaults for most options. To record the current (`-c`) terminal window,
just type:

    $ screengrab -c

You can also select a window to record by clicking on it. You do this with the
`-s` option. Instead of this option you can also specify `-n` to minimize the
terminal before starting the capture. Specifying `-n` implies `-s`.

You can also record the entire screen (or rather, the root window; your desktop)
by passing `-f`.

Now that you have specified a mode, you can also give some options to control the
output. The `-o` option sets the output filename, `-r` the output frame rate, and
`-S` the scale of the output.

    $ screengrab -f -r 10 -S 50% -o full.mp4
                  |  |    |      |
      fullscreen -'  |    |      |
      frame rate ----'    |      |
      scale --------------'      |
      output --------------------'

The scale can be specified as `WIDTHxHEIGHT` or `PERCENT%`.

You can add a delay before the actual capture begins with `-d` and the number of
seconds you would like to wait:

    $ screengrab -c -d 5 -o term.mp4
                  |  |    |
      current ----'  |    |
      delay ---------'    |
      output -------------'

Once screengrab is running, you can call on `screengrab -K` to stop the original
instance.

The output file doesn't have to be a .mp4, it can be anything that ffmpeg can produce,
such as a .gif!

## ProTip

Add the following to your .bashrc to use alt-shift-q from any terminal (other than the
one running screengrab) to stop and finish the capture:

    bind -x '"\eQ":"screengrab -K"'


## Notes

 *  ScreenGrab will parse the output from `ffmpeg` and produce pretty output in the
    console window and the title bar. To disable the title bar updates, pass `-n`
    on the command line.
 *  Audio capture might not work as intended depending on the build of ffmpeg you are
    using.
