Created
September 20, 2020 07:53
-
-
Save ver-1000000/331989711d6237b229fb8404c12b9357 to your computer and use it in GitHub Desktop.
Linuxでffmpeg/slopを使って矩形選択スクリーンキャプチャするやつ
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
#!/bin/bash | |
PID=`pgrep -f "ffmpeg -f x11grab -s"` | |
if [ `echo $PID | wc -w` = 1 ]; | |
then | |
tput bel | |
SLOP=$(slop -f "%x %y %w %h %g %i") || exit 1 | |
read -r X Y W H G ID < <(echo $SLOP) | |
ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse -fs 128M ~/Downloads/`date +%4Y-%m-%d_%I-%m-%S`.mp4 | |
else | |
tput bel; sleep 0.1; tput bel; | |
kill $PID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment