Last active
November 2, 2022 11:25
-
-
Save sepastian/613b1eedee0a5ba4f2e853b8da6851d3 to your computer and use it in GitHub Desktop.
Record left monitor from CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Oh-My-ZSH custom function to record left monitor from CLI. | |
# | |
# Place in $ZSH/.oh-my-zsh/custom. | |
# | |
# Two monitors at screen 0, the left one connected at DP-1: | |
# | |
# xrandr | |
# Screen 0: minimum 320 x 200, current 3840 x 1200, maximum 16384 x 16384 | |
# DP-1 connected primary 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm | |
# 1920x1200 59.95*+ | |
# | |
# You may have to adjust "-s 1920x1200", depending on your setup. | |
record_left_monitor() { | |
o=/tmp/screen_recording_$(date +"%Y%m%dH%H%M%S").mp4 | |
echo "Recording to ${o}." | |
echo "Press CTRL+c to quit." | |
ffmpeg \ | |
-f x11grab \ | |
-s 1920x1200 \ | |
-r 25 \ | |
-i :0.0 \ | |
-qscale 0 \ | |
"${o}" | |
echo "Wrote ${o}, bye." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment