Skip to content

Instantly share code, notes, and snippets.

@dilawar
Created February 17, 2013 13:58
Show Gist options
  • Save dilawar/4971597 to your computer and use it in GitHub Desktop.
Save dilawar/4971597 to your computer and use it in GitHub Desktop.
Record your desktop (no stinking gui). It automatically calculates the screen resolution and saves the video in mkv format.
#!/bin/bash
# This script record your desktop. It calculates your screen resoltion and saves
# the video in ~/Video/output.mkv file.
# [email protected]
Xaxis=$(xrandr -q | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)
Yaxis=$(xrandr -q | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)
ffmpeg -f x11grab -s $(($Xaxis))x$(($Yaxis)) -r 25 -i :0.0 -sameq ~/Video/output.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment