Funny and useful scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
754 B

#!/bin/sh
REC="$( which ffmpeg )"
[ -z ${REC} ] && {
echo "ERR: ffmpeg not found in \$PATH"
exit 1
}
OPT="${HOME}/.local/tmp"
FIFO="${OPT}/scrn-rec.pipe"
DATE="$( date +%Y%m%d_%H%M%S )"
DIR="${HOME}/media/screencasts"
FILE="$( hostname | cut -d\. -f1 )-${DATE}.mp4"
mkdir -p "${DIR}" || {
echo "ERR: can not create ${DIR} dir"
exit 1
}
mkfifo "${FIFO}"
${REC} -y -f x11grab -video_size 1920x1080 \
-i :0.0 -r 30 -codec:v libx264 \
-pix_fmt yuv420p \
-preset ultrafast \
-crf 22 -threads 0 \
"${DIR}/${FILE}" <"${FIFO}" &
exec 3> "${FIFO}"
( yad \
--geometry="-340-32" \
--title="STOP" \
--window-icon="" \
--undecorated \
--skip-taskbar \
--sticky \
--on-top \
--button='!gtk-stop:1'; echo "q" >&3; sleep 2; rm -f "${FIFO}" ) &