1
0
Fork 0
This commit is contained in:
Luca Bilke 2024-04-14 03:04:37 +02:00
parent 72f3c6d785
commit 950c644892
1 changed files with 21 additions and 19 deletions

View File

@ -28,6 +28,7 @@ killrecording() {
}
screencast() {
mkdir -p "$XDG_VIDEOS_DIR/Captures"
ffmpeg -y \
-f x11grab \
-framerate 60 \
@ -36,20 +37,21 @@ screencast() {
-f alsa -i default \
-r 30 \
-c:v h264 -crf 0 -preset ultrafast -c:a aac \
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
"$XDG_VIDEOS_DIR/Captures/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
echo $! >/tmp/recordingpid
updateicon ""
updateicon "󰍹 󰍬"
}
video() {
mkdir -p "$XDG_VIDEOS_DIR/Captures"
ffmpeg \
-f x11grab \
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
-i "$DISPLAY" \
-c:v libx264 -qp 0 -r 30 \
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
"$XDG_VIDEOS_DIR/Captures/video-$(date '+%y%m%d-%H%M-%S').mp4" &
echo $! >/tmp/recordingpid
updateicon ""
updateicon "󰍹"
}
webcamhidef() {
@ -59,7 +61,7 @@ webcamhidef() {
-video_size 1920x1080 \
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! >/tmp/recordingpid
updateicon ""
updateicon "󰄀"
}
webcam() {
@ -69,7 +71,7 @@ webcam() {
-video_size 640x480 \
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! >/tmp/recordingpid
updateicon ""
updateicon "󰖠"
}
audio() {
@ -78,18 +80,18 @@ audio() {
-c:a flac \
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
echo $! >/tmp/recordingpid
updateicon ""
updateicon "󰍬"
}
askrecording() {
choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
case "$choice" in
screencast) screencast ;;
audio) audio ;;
video) video ;;
*selected) videoselected ;;
webcam) webcam ;;
"webcam (hi-def)") webcamhidef ;;
screencast) screencast ;;
audio) audio ;;
video) video ;;
*selected) videoselected ;;
webcam) webcam ;;
"webcam (hi-def)") webcamhidef ;;
esac
}
@ -115,10 +117,10 @@ videoselected() {
}
case "$1" in
screencast) screencast ;;
audio) audio ;;
video) video ;;
*selected) videoselected ;;
kill) killrecording ;;
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording ;;
screencast) screencast ;;
audio) audio ;;
video) video ;;
*selected) videoselected ;;
kill) killrecording ;;
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording ;;
esac