summaryrefslogtreecommitdiff
path: root/toggle-screencast.sh
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-09-10 12:19:06 -0400
committerAdam T. Carpenter <atc@53hor.net>2020-09-10 12:19:06 -0400
commit74f909fedcbe354055a7f5a492735e09ba6d15da (patch)
treeeb209f321bee3240d2a8e83c47c5e187ecde8ff8 /toggle-screencast.sh
parent8633c82378ab9b3a88b956def1a05cb76b4c11fd (diff)
downloadscripts-74f909fedcbe354055a7f5a492735e09ba6d15da.tar.xz
scripts-74f909fedcbe354055a7f5a492735e09ba6d15da.zip
Moved i3 commands into scripts, fixed screencast and added webcam toggles
Diffstat (limited to 'toggle-screencast.sh')
-rwxr-xr-xtoggle-screencast.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/toggle-screencast.sh b/toggle-screencast.sh
index 0a23d41..b8050da 100755
--- a/toggle-screencast.sh
+++ b/toggle-screencast.sh
@@ -2,7 +2,8 @@
## Config
output_dir=~/videos/screencasts
-sound_device=/dev/dsp5
+#sound_device=/dev/dsp4.0
+#-thread_queue_size 512 -f oss -i "$sound_device" \
## Start recording
@@ -14,7 +15,6 @@ start_recording() {
ffmpeg -video_size 1920x1080 \
-framerate 50 \
-thread_queue_size 512 -f x11grab -i :0.0+0,0 \
- -thread_queue_size 512 -f oss -i "$sound_device" \
-vcodec libx264rgb -crf 0 -preset:v ultrafast \
-acodec pcm_s16le \
-af aresample=async=1:first_pts=0 \
@@ -26,10 +26,11 @@ start_recording() {
## Stop recording
stop_recording() {
pkill -2 ffmpeg
- output_file="$output_dir"/cast_"$(date '+%F-%H-%M-%S')".mkv
- mv /tmp/cast.mkv "$output_file"
- notify-send "Screencast saved" "$output_file"
+ output_file="$output_dir"/cast_"$(date '+%F-%H-%M-%S')".mp4
+ notify-send "Screencast stopped, transcoding..." "$output_file"
+ ffmpeg -i /tmp/cast.mkv "$output_file" && rm /tmp/cast.mkv
pkill -76 i3blocks
+ notify-send "Transcode done!" "$output_file"
exit
}