Skip to content

Instantly share code, notes, and snippets.

@loomsen
Created February 3, 2015 15:13
Show Gist options
  • Save loomsen/d02ae93b355792bfb9bb to your computer and use it in GitHub Desktop.
Save loomsen/d02ae93b355792bfb9bb to your computer and use it in GitHub Desktop.
#!/bin/bash
dir="$HOME/screencasts"
[[ ! -d "$dir" ]] && mkdir -p "$dir"
size=$( xdpyinfo | awk '/dimensions:/ {print $2}' )
name=$( date +'%b.%d_%I:%M%#p' )
video="$dir"/"$name".webm
snd_all() {
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -s "$size" -r 30 -qscale 1 -i :0.0 "$video"
}
all() {
ffmpeg -f x11grab -s "$size" -r 30 -qscale 1 -i :0.0 "$video"
}
snd_dsp1() {
local size=2560x1440
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -s "$size" -r 30 -qscale 1 -i :0.0+1920 "$video"
}
dsp1() {
local size=2560x1440
ffmpeg -f x11grab -s "$size" -r 30 -qscale 1 -i :0.0+1920 "$video"
}
case "$1" in
snd_all) snd_all
;;
all) all
;;
snd_dsp1) snd_dsp1
;;
dsp1) dsp1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment