#!/usr/bin/env bash # # Screencast recorder # # See https://links.fluxo.info/bookmarks/rhatto/screencast # https://askubuntu.com/questions/4428/how-can-i-record-my-screen # https://github.com/dilawar/Scripts/blob/master/record_my_desktop.sh # https://trac.ffmpeg.org/wiki/Capture/Desktop # https://andreafortuna.org/2019/09/20/how-to-record-screen-on-linux-from-command-line/ # https://superuser.com/questions/510985/how-can-i-crop-a-video-to-a-part-of-the-view # # Parameters BASENAME="`basename $0`" OUT="$1" # Syntax check if [ -z "$OUT" ]; then echo "usage: $BASENAME " echo "example: $BASENAME out.mkv" exit 1 fi # Calculate Xaxis=$(xrandr -q | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1) Yaxis=$(xrandr -q | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2) # Dispatch with vertical offset #ffmpeg -f x11grab -r 25 -s 1366x752 -i :0.0+0,16 -vcodec libx264 -vpre lossless_ultrafast -threads 0 $OUT # Dispatch #ffmpeg -f x11grab -r 25 -s 1366x752 -i :0.0 -vcodec libx264 -vpre lossless_ultrafast -threads 0 $OUT # Run ffmpeg -f x11grab -s $(($Xaxis))x$(($Yaxis)) -r 25 -i :0.0 -qscale 0 $OUT