Last active
June 8, 2025 14:06
-
-
Save kinjouj/5d9aed1ca7d6bda5899c81d3714ee349 to your computer and use it in GitHub Desktop.
ffmpegで矩形範囲を録画・録音する方法
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 | |
SLOP=$(slop -q -f "%x %y %w %h") || exit 1 | |
read -r X Y W H G ID < <(echo $SLOP) | |
ffmpeg -threads 0 -y -f x11grab \ | |
-s "$W"x"$H" \ | |
-i :0.0+$X,$Y \ | |
-f alsa \ | |
-i default \ | |
-c:v libx264 \ | |
-c:a aac \ | |
-ac 2 \ | |
-r 60 \ | |
-qp 15 \ | |
-crf 23 \ | |
-preset ultrafast \ | |
-fs 128M \ | |
out.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment