diff options
Diffstat (limited to 'dot/local/bin/soundy')
-rwxr-xr-x | dot/local/bin/soundy | 32 |
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 | ||
2 | die() { printf '%s: Error: %s\n' "$0" "$*" >&2; exit 1; } | ||
3 | [ "$DISPLAY" ] || die 'no $DISPLAY set. Try launching from a new xterm.' | ||
4 | |||
5 | AUDIO_DEVICE=pulse | ||
6 | AUDIO_INPUT=jack_out.monitor | ||
7 | |||
8 | NOW=$(date -Iseconds) | ||
9 | |||
10 | OUTPUT=screen-capture.${NOW//[:T]/.}.avi | ||
11 | OUTPUT_LINK=screen-capture.latest.avi | ||
12 | |||
13 | # ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg | ||
14 | |||
15 | record() | ||
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 | |||
26 | silently() { "$@" >/dev/null 2>&1; } | ||
27 | |||
28 | silently amixer-enable-mic | ||
29 | banish | ||
30 | record "$OUTPUT" | ||
31 | |||
32 | [ -h "$OUTPUT_LINK" -o ! -e "$OUTPUT_LINK" ] && ln -sf "$OUTPUT" "$OUTPUT_LINK" | ||