electric_eye 0.1.3 → 0.1.4
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/Gemfile.lock +2 -2
- data/README.org +11 -1
- data/lib/electric_eye/record.rb +9 -2
- data/lib/electric_eye/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f72d71f5a1cd65e4bae2305fcabf63392841fd22
|
4
|
+
data.tar.gz: a852c13f82021c6d23a27601c0b96aea86fe2222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2daa1ae5506a584fb9acb3fe76d49bb0e7e41b34c01138786c728d8492bc861f36f2056d11740a6b6a6757553d3ae5bded356d7a7a3f936614d41a818f1049c
|
7
|
+
data.tar.gz: 36aa25d254ca887428e8bf715b2148841e7c6037fe5b86ad062c926a47ac885e6823200518a2b8a781c140d0e6935d76aef522b98ce421e776f6397953be0566
|
data/Gemfile.lock
CHANGED
data/README.org
CHANGED
@@ -34,7 +34,6 @@ And then execute:
|
|
34
34
|
Or install it yourself as:
|
35
35
|
|
36
36
|
: $ gem install electric_eye
|
37
|
-
|
38
37
|
** Configuration
|
39
38
|
|
40
39
|
Enter your cameras into the JSON config file like so
|
@@ -67,6 +66,17 @@ Files will be numbered up to your wrap figure. The wrap figure determines when t
|
|
67
66
|
|
68
67
|
The default is going to be 10 minute blocks, this can be overridden with the duration variable above in minutes.
|
69
68
|
|
69
|
+
** Configure ffmpeg location
|
70
|
+
|
71
|
+
Add the following to your ~/.bashrc file pointing it to your ffmpeg location
|
72
|
+
: export FFMPEG_BIN="/opt/ffmpeg3/bin/ffmpeg"
|
73
|
+
|
74
|
+
To compile ffmpeg 3 into there do the following
|
75
|
+
: ./configure --prefix=/opt/ffmpeg3
|
76
|
+
: make -j4
|
77
|
+
: sudo make install
|
78
|
+
|
79
|
+
|
70
80
|
** Rebooting cameras
|
71
81
|
|
72
82
|
Some people reboot their cameras everynight. This does not work well with electric eye at the moment. As a work around you have to stop and start electric eye in your crontab.
|
data/lib/electric_eye/record.rb
CHANGED
@@ -7,6 +7,13 @@ module ElectricEye
|
|
7
7
|
class Record
|
8
8
|
|
9
9
|
include Methadone::CLILogging
|
10
|
+
|
11
|
+
def ffmpeg_bin
|
12
|
+
# Allow overriding the location of the ffmpeg bin if you require.
|
13
|
+
# We use special features of ffmpeg 3.0 so you might want to compile this in a separate directory
|
14
|
+
# for instance /opt/ffmpeg_3.0 would be a nice location.
|
15
|
+
ENV['FFMPEG_BIN'] || 'ffmpeg'
|
16
|
+
end
|
10
17
|
|
11
18
|
def store_pids(pids = [])
|
12
19
|
File.open(PID_FILE, "w") { |file| file.write pids.join(" ") }
|
@@ -31,7 +38,7 @@ module ElectricEye
|
|
31
38
|
loglevel = "-loglevel panic" if logger.level >= 1
|
32
39
|
|
33
40
|
# ffmpeg 3.0.1 used
|
34
|
-
cmd="
|
41
|
+
cmd="#{ffmpeg_bin} -i #{camera[:url]} #{loglevel} -c copy -f segment -segment_list #{listfile} -segment_time #{@configEye.config.duration} -segment_wrap #{@configEye.config.wrap} -y -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 300 #{path}%03d.mjpeg"
|
35
42
|
|
36
43
|
# Run command and add to our pids to make it easy for electric_eye to clean up.
|
37
44
|
info "Starting to record #{camera[:name]}"
|
@@ -62,7 +69,7 @@ module ElectricEye
|
|
62
69
|
|
63
70
|
# Run motion detection on the file, make sure that we output to a different file.
|
64
71
|
loglevel = "-loglevel panic" if logger.level >= 1
|
65
|
-
cmd="
|
72
|
+
cmd="#{ffmpeg_bin} -i #{dir}/#{file} #{loglevel} -y -vf \"select=gt(scene\\,0.003),setpts=N/(25*TB)\" #{dir}/#{date_filename(camera)}.mpeg"
|
66
73
|
|
67
74
|
# Run command and add to our pids to make it easy for electric_eye to clean up.
|
68
75
|
Process.spawn(cmd)
|
data/lib/electric_eye/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: electric_eye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Pope
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: construct
|
@@ -283,4 +283,3 @@ test_files:
|
|
283
283
|
- spec/motion_spec.rb
|
284
284
|
- spec/record_spec.rb
|
285
285
|
- spec/spec_helper.rb
|
286
|
-
has_rdoc:
|