-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcamera_bash
60 lines (48 loc) · 2.59 KB
/
camera_bash
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
#!/bin/bash
# $$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$$\ $$\ $$\
# $$$\ $$$ |$$ __$$\ $$ __$$\ \_$$ _|$$ _____|\$$\ $$ |
# $$$$\ $$$$ |$$ / $$ |$$ | $$ | $$ | $$ | \$$\ $$ /
# $$\$$\$$ $$ |$$ | $$ |$$ | $$ | $$ | $$$$$\ \$$$$ /
# $$ \$$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ __| \$$ /
# $$ |\$ /$$ |$$ | $$ |$$ | $$ | $$ | $$ | $$ |
# $$ | \_/ $$ | $$$$$$ |$$$$$$$ |$$$$$$\ $$ | $$ |
# \__| \__| \______/ \_______/ \______|\__| \__|
#base TIMELAPSE repo - no trailing /
TIMELAPSE=/Users/iphipp/sites/timelapse-pi
TEMP_LOCATION=/Users/iphipp/sites/timelapse-pi/temp
# $$$$$$$\ $$$$$$\ $$\ $$\ $$\ $$$$$$$$\
# $$ __$$\ $$ __$$\ $$$\ $$ |$ |\__$$ __|
# $$ | $$ |$$ / $$ |$$$$\ $$ |\_/ $$ |
# $$ | $$ |$$ | $$ |$$ $$\$$ | $$ |
# $$ | $$ |$$ | $$ |$$ \$$$$ | $$ |
# $$ | $$ |$$ | $$ |$$ |\$$$ | $$ |
# $$$$$$$ | $$$$$$ |$$ | \$$ | $$ |
# \_______/ \______/ \__| \__| \__|
#
#
#
# $$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$$\ $$\ $$\
# $$$\ $$$ |$$ __$$\ $$ __$$\ \_$$ _|$$ _____|\$$\ $$ |
# $$$$\ $$$$ |$$ / $$ |$$ | $$ | $$ | $$ | \$$\ $$ /
# $$\$$\$$ $$ |$$ | $$ |$$ | $$ | $$ | $$$$$\ \$$$$ /
# $$ \$$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ __| \$$ /
# $$ |\$ /$$ |$$ | $$ |$$ | $$ | $$ | $$ | $$ |
# $$ | \_/ $$ | $$$$$$ |$$$$$$$ |$$$$$$\ $$ | $$ |
# \__| \__| \______/ \_______/ \______|\__| \__|
#
echo "starting"
if [ $1 = "download" ]; then
echo "downloading images first"
dropbox_uploader.sh download images $TIMELAPSE/images
fi
echo "Moving to dir"
cd $TIMELAPSE
echo "Making Counted Dir"
mkdir $TIMELAPSE/images/counted
echo "Symlinking counted in order"
ls $TIMELAPSE/images/*jpg | awk 'BEGIN {count=0} {print "ln -s " $0 " '$TIMELAPSE'/images/counted/" count++ ".jpg"}' > $TIMELAPSE/images/a
bash $TIMELAPSE/images/a
echo "Making the video"
cd $TIMELAPSE/images/counted
ffmpeg -r 15 -start_number 0 -i %d.jpg -s 1280x720 -vcodec libx264 $TIMELAPSE/website/mobx/src/assets/video/testing.mp4 && echo 'Cleaning Up your Mess' && cd $TIMELAPSE && rm -r $TIMELAPSE/images
echo "DONE"