52 lines
1.6 KiB
Bash
Executable File
52 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
PID=$(pidof ffmpeg)
|
|
if [ -n "$PID" ]; then
|
|
pkill -SIGINT ffmpeg
|
|
pkill -SIGRTMIN+2 dwmblocks
|
|
notify-send "recording saved" -i :
|
|
exit
|
|
fi
|
|
|
|
SCREEN="ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -s 3440x1440 -f x11grab -r 60 -i :0.0+0,0 "
|
|
SYSTEM_AUDIO="-f pulse -i alsa_output.pci-0000_00_1f.3.iec958-stereo.monitor"
|
|
MICROPHONE="-f pulse -i default:monitor"
|
|
COMPRESSION="-c:a flac -vf format=nv12,hwupload -c:v av1_vaapi"
|
|
FILENAME="$HOME/wdraidz/media/game-videos/$(date +%m-%d-%Y_%R:%S).mkv"
|
|
SIGSEND="pkill -SIGRTMIN+2 dwmblocks"
|
|
|
|
if [ $1 = 1 ]; then
|
|
$SCREEN $SYSTEM_AUDIO $COMPRESSION $FILENAME&
|
|
notify-send "recording started with no mic" -i :
|
|
else
|
|
$SCREEN $SYSTEM_AUDIO $MICROPHONE -filter_complex "[1:0][2:0]amerge=inputs=2[a]" -map 0:v -map "[a]" $COMPRESSION $FILENAME&
|
|
notify-send "recording started" -i :
|
|
fi
|
|
|
|
$SIGSEND
|
|
|
|
# gpu-screen-recorder
|
|
#GSRPID=$(pidof gpu-screen-recorder)
|
|
#DWMBLOCKSPID=$(pidof dwmblocks)
|
|
#AUDIO="-ac opus -a default_output|default_input"
|
|
#AUDIONOMIC="-ac opus -a default_output"
|
|
#VIDEO="-w DisplayPort-1 -k av1 -c mkv -fm content -bm vbr"
|
|
#OUTPUT="-o $HOME/wdraidz/media/game-videos/$(date +%m-%d-%Y_%R:%S).mkv"
|
|
#
|
|
#if [ -n "$GSRPID" ]; then
|
|
# kill -SIGINT $GSRPID
|
|
# kill -RTMIN+2 $DWMBLOCKSPID
|
|
# notify-send "recording saved" -i :
|
|
# exit
|
|
#fi
|
|
#
|
|
#if [ $1 = 1 ]; then
|
|
# gpu-screen-recorder $VIDEO $AUDIONOMIC $OUTPUT&
|
|
# kill -RTMIN+2 $DWMBLOCKSPID
|
|
# notify-send "recording started with no mic" -i :
|
|
#else
|
|
# gpu-screen-recorder $VIDEO $AUDIO $OUTPUT&
|
|
# kill -RTMIN+2 $DWMBLOCKSPID
|
|
# notify-send "recording started" -i :
|
|
#fi
|