electric_eye 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/electric_eye/record.rb +7 -12
- data/lib/electric_eye/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ecf642c699ff3a4a565dad774c7ceec948bae69
|
4
|
+
data.tar.gz: 57c68395cb6e192f8c379cb3cd0e2a8bb27eae60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44593cfa1f41f8ab98880d83ea1608ea181adc07e3d5860701df37a4795a26d6860fa0ad0bd2c354ea12840404bdc65658a973dbb2cce2234064e931ccd28eeb
|
7
|
+
data.tar.gz: df339343fee4e10616918e16eb6e433ec49f487d2cd7754233fcc6bfcfd736100412b91dec98ca3e9267d1d0315726ca1edba976a8c8526f1133e274e51474c4
|
data/lib/electric_eye/record.rb
CHANGED
@@ -23,25 +23,20 @@ module ElectricEye
|
|
23
23
|
# until stop_recording
|
24
24
|
path = "#{path(camera)}"
|
25
25
|
listfile = "#{path}.list"
|
26
|
-
debug "Recording #{camera[:name]} to #{path}.
|
26
|
+
debug "Recording #{camera[:name]} to #{path}.mpeg..."
|
27
27
|
|
28
28
|
# Set a recording going using vlc, hold onto the process till it's finished.
|
29
29
|
# segment_time = how much time to record in each segment in seconds, ie: 3600 = 1hr
|
30
30
|
# sgement_wrap = how many copies
|
31
31
|
loglevel = "-loglevel panic" if logger.level >= 1
|
32
|
-
cmd="ffmpeg -f mjpeg -i #{camera[:url]} #{loglevel} -acodec copy -vcodec copy -y -f segment -segment_list #{listfile} -segment_time #{@configEye.config.duration} -segment_wrap #{@configEye.config.wrap} #{path}%03d.
|
32
|
+
cmd="ffmpeg -f mjpeg -i #{camera[:url]} #{loglevel} -acodec copy -vcodec copy -y -f segment -segment_list #{listfile} -segment_time #{@configEye.config.duration} -segment_wrap #{@configEye.config.wrap} #{path}%03d.mpeg"
|
33
33
|
|
34
34
|
# Run command and add to our pids to make it easy for electric_eye to clean up.
|
35
35
|
info "Starting to record #{camera[:name]}"
|
36
36
|
pids << Process.spawn(cmd)
|
37
37
|
|
38
38
|
# Start the motion detection for this camera
|
39
|
-
|
40
|
-
|
41
|
-
pids << fork do
|
42
|
-
`echo "path: #{dir(camera)}" >> #{listfile}.log`
|
43
|
-
start_motion_detection(camera)
|
44
|
-
end
|
39
|
+
pids << fork {start_motion_detection(camera)}
|
45
40
|
end
|
46
41
|
|
47
42
|
store_pids(pids)
|
@@ -57,14 +52,14 @@ module ElectricEye
|
|
57
52
|
path = path(camera)
|
58
53
|
|
59
54
|
# Watch the directory & read from the list file
|
60
|
-
filewatcher = FileWatcher.new("#{path}*.
|
55
|
+
filewatcher = FileWatcher.new("#{path}*.mpeg")
|
61
56
|
filewatcher.watch do |f|
|
62
57
|
file = read_listfile("#{path}.list")
|
63
58
|
if file
|
64
59
|
debug "Processing #{file}"
|
65
|
-
loglevel = "-loglevel panic" if logger.level >= 1
|
66
60
|
|
67
61
|
# Run motion detection on the file, make sure that we output to a different file.
|
62
|
+
loglevel = "-loglevel panic" if logger.level >= 1
|
68
63
|
cmd="ffmpeg -i #{dir}/#{file} #{loglevel} -y -vf \"select=gt(scene\\,0.003),setpts=N/(25*TB)\" #{dir}/motion-#{file}"
|
69
64
|
|
70
65
|
# Run command and add to our pids to make it easy for electric_eye to clean up.
|
@@ -81,9 +76,9 @@ module ElectricEye
|
|
81
76
|
|
82
77
|
# Remove a recording
|
83
78
|
def remove(path)
|
84
|
-
debug "REMOVE #{path}.
|
79
|
+
debug "REMOVE #{path}.mpeg (no motion)"
|
85
80
|
File.delete("#{path}.log")
|
86
|
-
File.delete("#{path}.
|
81
|
+
File.delete("#{path}.mpeg")
|
87
82
|
end
|
88
83
|
|
89
84
|
def stop
|
data/lib/electric_eye/version.rb
CHANGED