Skip to content

Instantly share code, notes, and snippets.

@mathieujobin
Last active May 19, 2020 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathieujobin/83214f737263f2b38be5009bc4099ab6 to your computer and use it in GitHub Desktop.
Save mathieujobin/83214f737263f2b38be5009bc4099ab6 to your computer and use it in GitHub Desktop.
function ScreenRecord() {
mkdir -p $HOME/Videos/
resolution=`xrandr | fgrep '*' | awk '{print $1}'` # "2560x1440"
filename="$HOME/Videos/Screencast_$(date +%Y%m%d_%H%M%S).mkv"
ffmpeg -video_size $resolution -framerate 25 -f x11grab -i $DISPLAY -f pulse -ac 2 -i default "$filename"
#-vpre lossless_ultrafast
#ffmpeg -f x11grab -r 25 -s $resolution -i $DISPLAY -f pulse -ac 2 -i default -acodec pcm_s16le -vcodec libx264 -threads 0 "$filename"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment