summaryrefslogtreecommitdiff
path: root/dot/local/bin/soundy
diff options
context:
space:
mode:
Diffstat (limited to 'dot/local/bin/soundy')
-rwxr-xr-xdot/local/bin/soundy32
1 files changed, 32 insertions, 0 deletions
diff --git a/dot/local/bin/soundy b/dot/local/bin/soundy
new file mode 100755
index 0000000..5ec812b
--- /dev/null
+++ b/dot/local/bin/soundy
@@ -0,0 +1,32 @@
1#!/bin/bash
2die() { printf '%s: Error: %s\n' "$0" "$*" >&2; exit 1; }
3[ "$DISPLAY" ] || die 'no $DISPLAY set. Try launching from a new xterm.'
4
5AUDIO_DEVICE=pulse
6AUDIO_INPUT=jack_out.monitor
7
8NOW=$(date -Iseconds)
9
10OUTPUT=screen-capture.${NOW//[:T]/.}.avi
11OUTPUT_LINK=screen-capture.latest.avi
12
13# ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
14
15record()
16{
17 local timeout="${MAX_RECORDING_TIME+-t $MAX_RECORDING_TIME}"
18 ffmpeg -hide_banner -loglevel error -stats \
19 $timeout -f x11grab -framerate 25 -video_size 1280x800 -i "$DISPLAY" \
20 $timeout -f "$AUDIO_DEVICE" -i "$AUDIO_INPUT" \
21 -c:a mp3 \
22 -c:v libxvid -qscale:v 3 \
23 "$1"
24}
25
26silently() { "$@" >/dev/null 2>&1; }
27
28silently amixer-enable-mic
29banish
30record "$OUTPUT"
31
32[ -h "$OUTPUT_LINK" -o ! -e "$OUTPUT_LINK" ] && ln -sf "$OUTPUT" "$OUTPUT_LINK"