Fix recording script to terminate properly. (#399)
* Fix recording script * Remove static framerate flag
This commit is contained in:
@@ -27,9 +27,15 @@ startRecording() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GPU_TYPE=$(lspci | grep -E 'VGA|3D' | grep -Ev '00:02.0|Integrated' > /dev/null && echo "" || echo "-encoder cpu")
|
GPU_TYPE=$(lspci | grep -E 'VGA|3D' | grep -Ev '00:02.0|Integrated' >/dev/null && echo "" || echo "-encoder cpu")
|
||||||
|
|
||||||
gpu-screen-recorder -w "$target" -f 60 -a "$(pactl get-default-sink).monitor" -o "$outputPath" $GPU_TYPE &
|
gpu-screen-recorder \
|
||||||
|
-w "$target" \
|
||||||
|
-f 60 \
|
||||||
|
-k h264 \
|
||||||
|
-a "$(pactl get-default-sink).monitor" \
|
||||||
|
-o "$outputPath" \
|
||||||
|
$GPU_TYPE &
|
||||||
|
|
||||||
echo "Recording started. Output will be saved to $outputPath"
|
echo "Recording started. Output will be saved to $outputPath"
|
||||||
}
|
}
|
||||||
@@ -40,8 +46,10 @@ stopRecording() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pkill -f gpu-screen-recorder
|
pkill -SIGINT -f gpu-screen-recorder
|
||||||
|
|
||||||
recentFile=$(ls -t "$outputDir"/recording_*.mp4 | head -n 1)
|
recentFile=$(ls -t "$outputDir"/recording_*.mp4 | head -n 1)
|
||||||
|
|
||||||
notify-send "Recording stopped" "Your recording has been saved." \
|
notify-send "Recording stopped" "Your recording has been saved." \
|
||||||
-i video-x-generic \
|
-i video-x-generic \
|
||||||
-a "Screen Recorder" \
|
-a "Screen Recorder" \
|
||||||
|
|||||||
Reference in New Issue
Block a user