summaryrefslogtreecommitdiff
path: root/toggle-screencast.sh
diff options
context:
space:
mode:
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
}