electric_eye 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33c71e7271287c8eefaed7c21b11e5dbfa8f2e8e
4
- data.tar.gz: d95da73de1f27d44012389bc7d6b18516ef0f15a
3
+ metadata.gz: 4ecf642c699ff3a4a565dad774c7ceec948bae69
4
+ data.tar.gz: 57c68395cb6e192f8c379cb3cd0e2a8bb27eae60
5
5
  SHA512:
6
- metadata.gz: da2bfd5d2e5366b3e8a3929613207aa2ae489577baea1d99abc85a2626e6843b2b4ee4d8e85f69ba53a36e2147c1649f1ccde2054fed9ecad4c851d80c86dc86
7
- data.tar.gz: 7c9e5f484dfc4e6dd4d179fa2982a2c2dced25645bc2e51a418ffebcd08415bb0c94aff473e4ca92702550fabd47d62f9b6cb1f71120ad795c7c161efcf1aba3
6
+ metadata.gz: 44593cfa1f41f8ab98880d83ea1608ea181adc07e3d5860701df37a4795a26d6860fa0ad0bd2c354ea12840404bdc65658a973dbb2cce2234064e931ccd28eeb
7
+ data.tar.gz: df339343fee4e10616918e16eb6e433ec49f487d2cd7754233fcc6bfcfd736100412b91dec98ca3e9267d1d0315726ca1edba976a8c8526f1133e274e51474c4
@@ -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}.mjpeg..."
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.mjpeg"
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
- puts "before thread: #{path}"
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}*.mjpeg")
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}.mjpeg (no motion)"
79
+ debug "REMOVE #{path}.mpeg (no motion)"
85
80
  File.delete("#{path}.log")
86
- File.delete("#{path}.mjpeg")
81
+ File.delete("#{path}.mpeg")
87
82
  end
88
83
 
89
84
  def stop
@@ -1,3 +1,3 @@
1
1
  module ElectricEye
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: electric_eye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Pope