-
Notifications
You must be signed in to change notification settings - Fork 0
/
footage
executable file
·53 lines (47 loc) · 1.58 KB
/
footage
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash -euo pipefail
#
# Generate files from the raw captures (mkv) which is usable in Davinci
# Resolve (mp4).
#
# For each new piece of footage, create a text file for capturing the
# contents of the footage for later reference, and a Things task to
# track whether or not this has been done.
for mkv in raw/*mkv; do
[ ! -f "$mkv" ] && break
mp4="$( echo "$mkv" | sed -e 's/^raw/footage/' -e 's/.mkv/.mp4/')"
notes="$( echo "$mkv" | sed -e 's/^raw/footage/' -e 's/.mkv/.txt/')"
if [ ! -f "$mp4" ]; then
status "++ {green}$mp4 [$(duration "$mkv")]"
[ -n "${DRY_RUN:-}" ] && continue
# convert to mp4, boosting the volume
ffmpeg \
-loglevel error \
-stats \
-i "$mkv" \
-vcodec copy \
"$mp4"
# create annotation files for each video, and open
# the video and text as a prompt to fill it out
[ ! -f "$notes" ] && cat footage/template.txt > "$notes"
subl "$notes"
play "$mp4"
chose=0
while [ $chose = 0 ]; do
status -cnr "Keep: y/n? "
read -N1 -s keeper
echo -n $keeper
case $keeper in
n|N) chose=1
rm "$mp4" "$notes" "$mkv"
;;
y|Y) chose=1
add_to_things "Properly annotate $(basename "$mp4")"
git add "$notes"
;;
*) sleep 1
;;
esac
done
echo ''
fi
done