electric_eye 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c334d34da5e715dafc4bf25b413633745f7ddc81
4
- data.tar.gz: 2e36a9cfcf7292a8bebfba866321f9a4f5ef3508
3
+ metadata.gz: f72d71f5a1cd65e4bae2305fcabf63392841fd22
4
+ data.tar.gz: a852c13f82021c6d23a27601c0b96aea86fe2222
5
5
  SHA512:
6
- metadata.gz: 1ae7373bcd7de070a94709af9d6475b36cabedced738efe18b5b42cf8b84ad28db982099e595dd9df370122dd595067cb65e3e6f73ea9f75f3e1f7c8fa20abbb
7
- data.tar.gz: 7336de5be6c21b4d9e2ac5302571322c80fe9daad713ea2623f7dd3f828f2bd8f30e48e8b8e68a180b36a7011da411f95791452011e6f061434c0b44fa1f29b5
6
+ metadata.gz: d2daa1ae5506a584fb9acb3fe76d49bb0e7e41b34c01138786c728d8492bc861f36f2056d11740a6b6a6757553d3ae5bded356d7a7a3f936614d41a818f1049c
7
+ data.tar.gz: 36aa25d254ca887428e8bf715b2148841e7c6037fe5b86ad062c926a47ac885e6823200518a2b8a781c140d0e6935d76aef522b98ce421e776f6397953be0566
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- electric_eye (0.1.1)
4
+ electric_eye (0.1.3)
5
5
  construct
6
6
  filewatcher
7
7
  methadone (~> 1.9.0)
@@ -80,4 +80,4 @@ DEPENDENCIES
80
80
  timecop
81
81
 
82
82
  BUNDLED WITH
83
- 1.11.2
83
+ 1.12.5
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.
@@ -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="ffmpeg -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"
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="ffmpeg -i #{dir}/#{file} #{loglevel} -y -vf \"select=gt(scene\\,0.003),setpts=N/(25*TB)\" #{dir}/#{date_filename(camera)}.mpeg"
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)
@@ -1,3 +1,3 @@
1
1
  module ElectricEye
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
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-06-24 00:00:00.000000000 Z
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: