Record screen in Debian

Install recordmydesktop

sudo apt-get install recordmydesktop

Record specific application window with no sound

recordmydesktop --no-sound --windowid `xwininfo -display :0 | grep 'id: 0x' | grep -Eo '0x[a-z0-9]+'`

.OGV to .MP4 conversion

sudo apt-get install libav-tools
avconv -i out.ogv out.mp4

recordmydesktop options

Usage: recordmydesktop [OPTIONS]^filename
Generic Options
  -h, --help                              Print this help and exit.
      --version                           Print program version and exit.
      --print-config                      Print info about options selected during compilation and
Image Options
      --windowid=id_of_window             id of window to be recorded.
      --display=DISPLAY                   Display to connect to.
  -x, --x=N>=0                            Offset in x direction.
  -y, --x=N>=0                            Offset in y direction.
      --width=N>0                         Width of recorded window.
      --height=N>0                        Height of recorded window.
      --dummy-cursor=color                Color of the dummy cursor [black|white]
      --no-cursor                         Disable drawing of the cursor.
      --no-shared                         Disable usage of MIT-shared memory extension(Not
      --full-shots                        Take full screenshot at every frame(Not recomended!).
      --follow-mouse                      Makes the capture area follow the mouse cursor. Autoenables
      --quick-subsampling                 Do subsampling of the chroma planes by discarding, not
      --fps=N(number>0.0)                 A positive number denoting desired framerate.
Sound Options
      --channels=N                        A positive number denoting desired sound channels in
      --freq=N                            A positive number denoting desired sound frequency.
      --buffer-size=N                     A positive number denoting the desired sound buffer size (in
                                          frames,when using ALSA or OSS)
      --ring-buffer-size=N                A float number denoting the desired ring buffer size (in
                                          seconds,when using JACK only).
      --device=SOUND_DEVICE               Sound device(default hw:0,0).
      --use-jack=port1 port2... portn     Record audio from the specified list of space-separated jack
      --no-sound                          Do not record sound.
Encoding Options
      --on-the-fly-encoding               Encode the audio-video data, while recording.
      --v_quality=n                       A number from 0 to 63 for desired encoded video
                                          quality(default 63).
      --v_bitrate=n                       A number from 0 to 2000000 for desired encoded video
                                          bitrate(default 0).
      --s_quality=n                       Desired audio quality(-1 to 10).
Misc Options
      --rescue=path_to_data               Encode data from a previous, crashed, session.
      --no-wm-check                       Do not try to detect the window manager(and set options
                                          according to it)
      --no-frame                          Don not show the frame that visualizes the recorded area.
      --pause-shortcut=MOD+KEY            Shortcut that will be used for (un)pausing (default
      --stop-shortcut=MOD+KEY             Shortcut that will be used to stop the recording (default
      --compress-cache                    Image data are cached with light compression.
      --workdir=DIR                       Location where a temporary directory will be created to hold
                                          project files(default $HOME).
      --delay=n[H|h|M|m]                  Number of secs(default),minutes or hours before capture
                                          starts(number can be float)
      --overwrite                         If there is already a file with the same name, delete it
                                          (default is to add a number postfix to the new one).
  -o, --output=filename                   Name of recorded video(default out.ogv).
	If no other options are specified, filename can be given without the -o switch.

avconv options

usage: avconv [options] [[infile options] -i infile]... {[outfile options] outfile}...
Getting help:
    -h      -- print basic options
    -h long -- print more options
    -h full -- print all options (including all format and codec specific options, very long)
    See man avconv for detailed description of the options.
Print help / information / capabilities:
-L                  show license
-h topic            show help
-? topic            show help
-help topic         show help
--help topic        show help
-version            show version
-formats            show available formats
-codecs             show available codecs
-decoders           show available decoders
-encoders           show available encoders
-bsfs               show available bit stream filters
-protocols          show available protocols
-filters            show available filters
-pix_fmts           show available pixel formats
-sample_fmts        show available audio sample formats
Global options (affect whole program instead of just one file:
-loglevel loglevel  set libav* logging level
-v loglevel         set libav* logging level
-y                  overwrite output files
-n                  never overwrite output files
-stats              print progress report during encoding
-vol volume         change audio volume (256=normal)
Per-file main options:
-f fmt              force format
-c codec            codec name
-codec codec        codec name
-pre preset         preset name
-map_metadata outfile[,metadata]:infile[,metadata]  set metadata information of outfile from infile
-t duration         record or transcode "duration" seconds of audio/video
-fs limit_size      set the limit file size in bytes
-ss time_off        set the start time offset
-metadata string=string  add metadata
-target type        specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)
-frames number      set the number of frames to record
-filter filter_list  set stream filterchain
-filter_script filename  read stream filtergraph description from a file
Video options:
-vframes number     set the number of video frames to record
-r rate             set frame rate (Hz value, fraction or abbreviation)
-s size             set frame size (WxH or abbreviation)
-aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-vn                 disable video
-vcodec codec       force video codec ('copy' to copy stream)
-pass n             select the pass number (1 or 2)
-vf filter list     video filters
Audio options:
-aframes number     set the number of audio frames to record
-aq quality         set audio quality (codec-specific)
-ar rate            set audio sampling rate (in Hz)
-ac channels        set number of audio channels
-an                 disable audio
-acodec codec       force audio codec ('copy' to copy stream)
-vol volume         change audio volume (256=normal)
-af filter list     audio filters
Subtitle options:
-sn                 disable subtitle
-scodec codec       force subtitle codec ('copy' to copy stream)
-stag fourcc/tag    force subtitle tag/fourcc