first commit

This commit is contained in:
2026-05-26 19:21:54 +09:00
commit 20c0cfa111
5 changed files with 144 additions and 0 deletions

41
scrv Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Video Quality
# The range of the CRF scale is 051, where 0 is lossless, 23 is the default,
# and 51 is worst quality possible. A lower value generally leads to higher
# quality, and a subjectively sane range is 1728
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."
#\#-f alsa -i pulse -c:v libx264 -preset ultrafast -crf ${QUALITY} \
#-c:v libx264 -preset ultrafast -crf ${QUALITY} \
#-tune zerolatency -pix_fmt yuv420p -f mp4 $filename
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."