#!/bin/sh # # Example of screen recording (to a specific window) # Reference: http://www.reddit.com/r/linux/comments/1nioax/til_that_you_can_record_your_desktop_with_vlc/ INFO=$(xwininfo -frame) WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+') WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' ) ffmpeg -f x11grab -r 15 -s $WIN_GEO -i :0.0+$WIN_XY -vcodec h264 -preset ultrafast -y $OUTFILE