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