-
Notifications
You must be signed in to change notification settings - Fork 0
/
gource_auto.sh
executable file
·61 lines (60 loc) · 1.33 KB
/
gource_auto.sh
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
54
55
56
57
58
59
60
61
#!/bin/sh
printf "Loading all git enabled Folders form current Folder...\n"
gitDir=($(gfind -name '*.git' -printf '%h\n' | sed 's/ /_/g' | sort -u))
if [ -x $gitDir ]
then
echo "No git enabled directory found here, try command in upper directory."
exit
fi
printf "Please select folder(Please wait until search for the folder end):\n"
read -p "$(
f=0
for dirname in "${gitDir[@]}" ; do
echo "$((++f)) ${dirname##*/}"
done
echo 'Please select a directory > '
)" selection
while true
do
if [ $selection -le ${#gitDir[@]} ]
then
d="${gitDir[$((selection-1))]}"
break
else
read -p "$(echo '>>> Invalid Selection\nPlease Select a valid directory > ')" selection
fi
done
read -p "$(echo 'Second Per Day(0.01-0.2 recommended > ')" SPD
name=${d//[^[:alnum:]]/}
dir=$(cd $d; pwd)
gource \
--path $dir \
--seconds-per-day $SPD \
--title "$name" \
-1280x720 \
--file-idle-time 0 \
--auto-skip-seconds 0.75 \
--multi-sampling \
--stop-at-end \
--highlight-users \
--hide filenames,mouse,progress \
--max-files 0 \
--background-colour 000000 \
--disable-bloom \
--font-size 24 \
--output-ppm-stream - \
--output-framerate 30 \
-o - \
| ffmpeg \
-y \
-r 60 \
-f image2pipe \
-vcodec ppm \
-i - \
-vcodec libx264 \
-preset ultrafast \
-pix_fmt yuv420p \
-crf 1 \
-threads 0 \
-bf 0 \
~/gitPreviews/$name.mp4