Skip to content

Instantly share code, notes, and snippets.

@facundovictor
Last active May 12, 2017 01:40
Show Gist options
  • Save facundovictor/d4a1355bc7cf0d6f3287424aa4654478 to your computer and use it in GitHub Desktop.
Save facundovictor/d4a1355bc7cf0d6f3287424aa4654478 to your computer and use it in GitHub Desktop.
Recording screen with ffmpeg
#!/usr/bin/env bash
#
# References:
# - https://trac.ffmpeg.org/wiki/Capture/Desktop
###############################################################################
# -s[:stream_specifier] size
# Better option : -video_size size
RESOLUTION="1366x768"
# -r[:stream_specifier] fps
# Better option : -framerate size
FPS=25
# -f fmt (input/output) Force input or output file format
FORMAT=x11grab
# -i url (input)
INPUT=":0.0"
# Save it to:
OUTPUT=~/output-file.mp4
if [ -n "$1" ]; then
OUTPUT="$1"
fi
ffmpeg -f $FORMAT -video_size $RESOLUTION -framerate $FPS -i $INPUT "$OUTPUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment