Skip to content

Instantly share code, notes, and snippets.

@ansballard
Created March 7, 2017 04:59
Show Gist options
  • Save ansballard/e2b874bf0fadab9fba1c780bcb90dd14 to your computer and use it in GitHub Desktop.
Save ansballard/e2b874bf0fadab9fba1c780bcb90dd14 to your computer and use it in GitHub Desktop.
A script to record a portion of your screen with ffmpeg
#!/bin/sh
FILENAME=${1:-"screencast.mp4"}
FPS=${2:-"30"}
DIMENSIONS=${3:-"1366x768"}
printf "\n\033[0;35mRecording to $FILENAME, $FPS fps, $DIMENSIONS...\033[0m\n\n"
ffmpeg -v error -framerate $FPS -video_size $DIMENSIONS -f x11grab -i :0.0+0,0 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le $FILENAME
printf "\n\033[0;35m$FILENAME saved!\033[0m\n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment