first commit

This commit is contained in:
2026-05-26 19:25:02 +09:00
commit 972392a192
5 changed files with 131 additions and 0 deletions

34
scrv Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
QUALITY=28
if ! command -v slop &> /dev/null
then
echo "slop command not found. Please install slop."
exit 1
fi
if [ -z "$1" ]; then
echo "Usage: $0 <output.mp4>"
exit 1
fi
filename="$1"
echo "Select the desktop area to record."
coords=$(slop -f "%x %y %w %h" 2>/dev/null)
x=$(echo $coords | awk '{print $1}')
y=$(echo $coords | awk '{print $2}')
width=$(echo $coords | awk '{print $3}')
height=$(echo $coords | awk '{print $4}')
width=$((width / 2 * 2))
height=$((height / 2 * 2))
echo "Recording started. Press 'q' to stop recording."
ffmpeg -f x11grab -loglevel quiet -s ${width}x${height} -i ${DISPLAY}+$x,$y \
-c:v libx264 -pix_fmt yuv420p -crf ${QUALITY} -preset ultrafast -f mp4 $filename
echo "Recording stopped."