FFmpeg: Recursive video capture


#!/bin/bash
# Rudimentary script for recording X11 desktop looping through FFplay
# For other platforms see: https://trac.ffmpeg.org/wiki/Capture/Desktop

ffmpeg \
   -video_size 1024x768 \
   -framerate 25 \
   -f x11grab \
   -i :0+100,200 \
   -c libx264 \
   -preset ultrafast \
   -crf 6 \
   recordscreen543.mkv \
   -y & pid="$!"
   
trap "kill $pid" EXIT
   
ffplay \
   -video_size 1024x768 \
   -framerate 25 \
   -f x11grab \
   -i :0+100,200
   
exit
Longer video demonstrating the effect.