tlapse 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/lib/tlapse/capture.rb +10 -5
- data/lib/tlapse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 095c172778da6f3d7aaf66156127eeac47d0413bbcf888b8288ed2d670024676
|
4
|
+
data.tar.gz: 268453b146950a3bd23935fd1f5f777fb0f3934ea8b1893139f5146de2fca496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f83789b0cd13f58a8be385a8d10d920e5912154d13b699dc1902ba80e5e4e44ea800936b4ccc09e075d785f8f5bee5bf6985afc0b32233503617766f47a26fe7
|
7
|
+
data.tar.gz: 97586ce4a34be667779a17333df117139575ed557c591de9d3f9528f01e73cb3cc26826fa18e88908c31ea0d25932e2460375714606c6b1d92c075d787981b95
|
data/README.md
CHANGED
@@ -9,13 +9,22 @@ Automated time lapse photography using gphoto2.
|
|
9
9
|
* macOS: `brew install gphoto2`
|
10
10
|
* Debian/Ubuntu: `sudo apt install gphoto2`
|
11
11
|
|
12
|
-
2. `gem install tlapse`
|
12
|
+
2. `gem install tlapse`
|
13
|
+
|
14
|
+
## Example: Integrate with cron
|
15
|
+
|
16
|
+
* From 9 AM to sunset, capture one image every 10 minutes
|
17
|
+
|
18
|
+
```
|
19
|
+
0 9 * * * cd $HOME && eval "$(tlapse until_sunset --interval 10)" >> capture.log
|
20
|
+
```
|
13
21
|
|
14
22
|
## CLI
|
15
23
|
|
16
24
|
Find better documentation by running `tlapse help` or `tlapse help SUBCOMMAND`
|
17
25
|
|
18
26
|
* `tlapse capture` - Capture an image using the tethered camera
|
27
|
+
* `tlapse until_sunset` - Generate a gphoto2 command which captures images until sunset
|
19
28
|
|
20
29
|
## API
|
21
30
|
|
@@ -27,13 +36,13 @@ Mostly useful for cronjobs and the like.
|
|
27
36
|
from: Time.now,
|
28
37
|
to: Time.now + 6.hours,
|
29
38
|
interval: 30.minutes
|
30
|
-
}) # => "gphoto2 --capture-image-and-download -I 1800 -F 12 --filename
|
39
|
+
}) # => "gphoto2 --capture-image-and-download -I 1800 -F 12 --filename '%Y-%m-%d_%H-%M-%S.jpg'"
|
31
40
|
```
|
32
41
|
|
33
42
|
* Capture images from sunset to sunrise
|
34
43
|
```ruby
|
35
44
|
Tlapse::Capture.timelapse_command_while_sun_is_up(interval: 30.minutes)
|
36
|
-
# => "gphoto2 --capture-image-and-download -I 1800 -F
|
45
|
+
# => "gphoto2 --capture-image-and-download -I 1800 -F 11 --filename '%Y-%m-%d_%H-%M-%S.jpg'"
|
37
46
|
```
|
38
47
|
|
39
48
|
## License
|
data/lib/tlapse/capture.rb
CHANGED
@@ -2,10 +2,15 @@ require "active_support/core_ext/numeric/time.rb"
|
|
2
2
|
|
3
3
|
module Tlapse
|
4
4
|
module Capture
|
5
|
-
def self.capture_single(format: nil)
|
6
|
-
puts "The format key is not yet supported" if format
|
7
5
|
|
8
|
-
|
6
|
+
CAPTURE_FILENAME = "%Y-%m-%d_%H-%M-%S.jpg"
|
7
|
+
|
8
|
+
def self.capture_filename
|
9
|
+
CAPTURE_FILENAME
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.capture_single
|
13
|
+
`gphoto2 --capture-image-and-download --filename '#{capture_filename}'`
|
9
14
|
end
|
10
15
|
|
11
16
|
##
|
@@ -50,7 +55,7 @@ module Tlapse
|
|
50
55
|
command = "gphoto2 --capture-image-and-download"
|
51
56
|
command += " -I #{interval}"
|
52
57
|
command += " -F #{captures}"
|
53
|
-
command +=
|
58
|
+
command += " --filename '#{capture_filename}'"
|
54
59
|
end
|
55
60
|
|
56
61
|
##
|
@@ -71,7 +76,7 @@ module Tlapse
|
|
71
76
|
end_time: sunset,
|
72
77
|
interval: interval
|
73
78
|
)
|
74
|
-
"gphoto2 --capture-image-and-download -I #{interval} -F #{captures}"
|
79
|
+
"gphoto2 --capture-image-and-download -I #{interval} -F #{captures} --filename '#{capture_filename}'"
|
75
80
|
end
|
76
81
|
end # Capture
|
77
82
|
end # Tlapse
|
data/lib/tlapse/version.rb
CHANGED