electric_eye 0.0.2 → 0.0.3
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 +0 -6
- data/Gemfile.lock +12 -2
- data/README.org +160 -0
- data/electric_eye.gemspec +2 -0
- data/lib/electric_eye/version.rb +1 -1
- data/man/electric_eye.1 +85 -0
- data/man/electric_eye.1.html +138 -0
- data/man/electric_eye.1.ronn +59 -0
- metadata +34 -3
- data/README.md +0 -110
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 681ad7ca61fc217562ed5aadb036c3d234518e5a
|
4
|
+
data.tar.gz: 83c70fdbc5eada7fa3fe7ec1492e60fbb2f89625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c9d1e40e8de47dd9b5773d2cee132912a9c71f432c1c15849622d854a2958c0e00528d51371b15788d53ef037b96455783d5d1b5536b4cf18d961f3babada4b
|
7
|
+
data.tar.gz: dec64f404a955f65b6487cc5fcc7c99fc2d44954b3129770e0486474d9ad37dfdec2f43043343c796dcbb6590622cff00dd5cf0598a1980f81ef0e533a6e1724
|
data/Gemfile
CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in electric_eye.gemspec
|
4
4
|
gemspec
|
5
|
-
|
6
|
-
# gem 'construct' # Config manager in YAML format
|
7
|
-
# gem 'table_print' # Print a nice table in stdout
|
8
|
-
# gem 'timecop' # Freeze time for tests
|
9
|
-
# gem 'fakefs', require: "fakefs/safe"
|
10
|
-
# gem 'open4' # Handle shell commands
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
electric_eye (0.0.
|
4
|
+
electric_eye (0.0.2)
|
5
5
|
construct
|
6
6
|
methadone (~> 1.9.0)
|
7
7
|
open4
|
@@ -30,17 +30,25 @@ GEM
|
|
30
30
|
diff-lcs (1.2.5)
|
31
31
|
fakefs (0.6.7)
|
32
32
|
ffi (1.9.8)
|
33
|
+
gem-man (0.3.0)
|
33
34
|
gherkin (2.12.2)
|
34
35
|
multi_json (~> 1.3)
|
36
|
+
hpricot (0.8.6)
|
35
37
|
json (1.8.2)
|
36
|
-
methadone (1.9.
|
38
|
+
methadone (1.9.1)
|
37
39
|
bundler
|
38
40
|
multi_json (1.11.0)
|
39
41
|
multi_test (0.1.2)
|
42
|
+
mustache (1.0.1)
|
40
43
|
open4 (1.3.4)
|
41
44
|
rake (10.4.2)
|
45
|
+
rdiscount (2.1.8)
|
42
46
|
rdoc (4.2.0)
|
43
47
|
json (~> 1.4)
|
48
|
+
ronn (0.7.3)
|
49
|
+
hpricot (>= 0.8.2)
|
50
|
+
mustache (>= 0.7.0)
|
51
|
+
rdiscount (>= 1.5.8)
|
44
52
|
rspec (2.99.0)
|
45
53
|
rspec-core (~> 2.99.0)
|
46
54
|
rspec-expectations (~> 2.99.0)
|
@@ -60,7 +68,9 @@ DEPENDENCIES
|
|
60
68
|
bundler (~> 1.7)
|
61
69
|
electric_eye!
|
62
70
|
fakefs
|
71
|
+
gem-man
|
63
72
|
rake (~> 10.0)
|
64
73
|
rdoc
|
74
|
+
ronn
|
65
75
|
rspec (~> 2.99)
|
66
76
|
timecop
|
data/README.org
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
* ElectricEye
|
2
|
+
|
3
|
+
A network video recorder for multiple IP cameras using VLC.
|
4
|
+
|
5
|
+
** History
|
6
|
+
|
7
|
+
I've been using Zoneminder & motion and these programs are either too large for my requirements (zoneminder) or don't work with the cameras I own (motion). What I did notice is all my cameras work through VLC with high resolution and VLC can record.
|
8
|
+
|
9
|
+
The problem was though VLC doesn't automate the recordings or handle the file structure nicely. This is where I started to think about creating an application which records from VLC and nicely sorts those recordings in directories by date & time.
|
10
|
+
|
11
|
+
** Requirements
|
12
|
+
|
13
|
+
- VLC
|
14
|
+
- ruby
|
15
|
+
- Linux (Tested on Debian 7)
|
16
|
+
|
17
|
+
** Installation
|
18
|
+
|
19
|
+
Add this line to your application's Gemfile:
|
20
|
+
|
21
|
+
: gem 'electric_eye'
|
22
|
+
|
23
|
+
And then execute:
|
24
|
+
|
25
|
+
: $ bundle
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
: $ gem install electric_eye
|
30
|
+
|
31
|
+
** Configuration
|
32
|
+
|
33
|
+
Enter your cameras into the JSON config file like so
|
34
|
+
|
35
|
+
: ---
|
36
|
+
: duration: 60
|
37
|
+
: path: "/media/data/recordings/temp"
|
38
|
+
: cameras:
|
39
|
+
: - :name: Reception
|
40
|
+
: :url: rtsp://<user>:<passwd>@<camera's ip>/live2.sdp
|
41
|
+
: - :name: Kitchen
|
42
|
+
: :url: rtsp://<user>:<passwd>@<camera's ip>/live2.sdp
|
43
|
+
: - :name: Workstations
|
44
|
+
: :url: rtsp://<user>:<passwd>@<camera's ip>/live2.sdp
|
45
|
+
|
46
|
+
You should be able to view the URL through vlc before using this program.
|
47
|
+
|
48
|
+
The recordings directory will end up with these directories
|
49
|
+
|
50
|
+
: /media/data/recordings/reception/20150527
|
51
|
+
: /media/data/recordings/kitchen/20150527
|
52
|
+
|
53
|
+
Notice the date at the end of these paths, there will be one for each day. The contents within will be recordings which are done by default every 10minutes, example;
|
54
|
+
|
55
|
+
: 20150527-1020-reception.mjpeg
|
56
|
+
: 20150527-1030-reception.mjpeg
|
57
|
+
: 20150527-1040-reception.mjpeg
|
58
|
+
|
59
|
+
The default is going to be 10 minute blocks, this can be overridden with the duration variable above in minutes.
|
60
|
+
|
61
|
+
** Usage
|
62
|
+
|
63
|
+
First make sure you add your cameras
|
64
|
+
|
65
|
+
: electric_eye add Reception <url>
|
66
|
+
|
67
|
+
Now start the daemon to start the recording process
|
68
|
+
|
69
|
+
: electric_eye start
|
70
|
+
|
71
|
+
Stop all recordings
|
72
|
+
|
73
|
+
: electric_eye stop
|
74
|
+
|
75
|
+
Usage in development mode
|
76
|
+
|
77
|
+
: bundle exec bin/electric_eye -h
|
78
|
+
|
79
|
+
|
80
|
+
** Start on boot
|
81
|
+
|
82
|
+
To start the service on boot (on a linux machine) add the following
|
83
|
+
|
84
|
+
Add the following to /etc/init/electric_eye
|
85
|
+
|
86
|
+
: #!/usr/bin/env ruby
|
87
|
+
: #
|
88
|
+
: # Electric Eye
|
89
|
+
: #
|
90
|
+
: # chkconfig: 2345 80 20
|
91
|
+
: # description: Network Video Recorder
|
92
|
+
:
|
93
|
+
: RBENV_DIR= '/usr/local/rbenv/shims'
|
94
|
+
: APP_NAME = 'electric_eye'
|
95
|
+
:
|
96
|
+
: case ARGV.first
|
97
|
+
:
|
98
|
+
: when 'start'
|
99
|
+
: system "su johnsmith -c \"#{RBENV_DIR}/electric_eye -s\""
|
100
|
+
:
|
101
|
+
: when 'stop'
|
102
|
+
: system "su johnsmith -c \"#{RBENV_DIR}/electric_eye -k\""
|
103
|
+
:
|
104
|
+
: when 'restart'
|
105
|
+
: system "su johnsmith -c \"#{RBENV_DIR}/electric_eye -k\""
|
106
|
+
: sleep 0.5
|
107
|
+
: system "su johnsmith -c \"#{RBENV_DIR}/electric_eye -s\""
|
108
|
+
:
|
109
|
+
: end
|
110
|
+
:
|
111
|
+
: unless %w{start stop restart}.include? ARGV.first
|
112
|
+
: puts "Usage: #{APP_NAME} {start|stop|restart}"
|
113
|
+
: exit
|
114
|
+
: end
|
115
|
+
|
116
|
+
Make executable & add to startup
|
117
|
+
|
118
|
+
: cd /etc/init.d
|
119
|
+
: chmod +x electric_eye
|
120
|
+
: update-rc.d electric_eye defaults
|
121
|
+
|
122
|
+
|
123
|
+
Replace johnsmith with your user where you have setup your camera profiles. NOTE: I cannot get it working nicely with the root user.
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
** Cleanup
|
128
|
+
|
129
|
+
Cleaning up recordings. Put the following into your /etc/crontab per recording directory.
|
130
|
+
|
131
|
+
: 00 19 * * * root /usr/bin/find <directory to recordings> -type f -mtime +<days> -exec rm {} \;
|
132
|
+
|
133
|
+
Example for cleaning up reception after 60days at 7pm everynight.
|
134
|
+
|
135
|
+
: 00 19 * * * root /usr/bin/find /media/recordings/reception -type f -mtime +60 -exec rm {} \;
|
136
|
+
|
137
|
+
** Contributing
|
138
|
+
|
139
|
+
1. Fork it ( https://github.com/map7/electric_eye/fork )
|
140
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
141
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
142
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
143
|
+
5. Create a new Pull Request
|
144
|
+
|
145
|
+
** TODO
|
146
|
+
|
147
|
+
- [ ] Add more testing
|
148
|
+
|
149
|
+
- [ ] Add post recording motion detection (using [rmotion](https://github.com/rikiji/rmotion))
|
150
|
+
|
151
|
+
- [ ] Add a feature to clean up old recordings using a "period" setting
|
152
|
+
EG: 60 day period which could be set in the config file how many days you want to keep
|
153
|
+
Then just call 'electric_eye --remove-recordings' within crontab
|
154
|
+
This would iterate over all my cameras and remove old recordings to keep a rolling set of days.
|
155
|
+
|
156
|
+
- [ ] Make sure we cannot add blank cameras
|
157
|
+
|
158
|
+
- [ ] Allow different recording programs like raspicam
|
159
|
+
|
160
|
+
- [ ] Do inline motion detection (using activevlc)
|
data/electric_eye.gemspec
CHANGED
@@ -28,6 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency('aruba')
|
29
29
|
spec.add_development_dependency('timecop')
|
30
30
|
spec.add_development_dependency('fakefs')
|
31
|
+
spec.add_development_dependency('gem-man')
|
32
|
+
spec.add_development_dependency('ronn')
|
31
33
|
spec.add_dependency('methadone', '~> 1.9.0')
|
32
34
|
spec.add_development_dependency('rspec', '~> 2.99')
|
33
35
|
end
|
data/lib/electric_eye/version.rb
CHANGED
data/man/electric_eye.1
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "ELECTRIC_EYE" "1" "June 2015" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBelectric_eye\fR \- Record one or more IP cameras
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBelectric_eye\fR \fB\-a camera_name camera_url\fR
|
11
|
+
.
|
12
|
+
.br
|
13
|
+
\fBelectric_eye\fR \fB\-r camera_name\fR
|
14
|
+
.
|
15
|
+
.br
|
16
|
+
\fBelectric_eye\fR \fB\-s\fR
|
17
|
+
.
|
18
|
+
.br
|
19
|
+
\fBelectric_eye\fR \fB\-k\fR
|
20
|
+
.
|
21
|
+
.SH "DESCRIPTION"
|
22
|
+
\fBelectric_eye\fR is a simple program which loops over all your cameras and starts recording into a set directory naming each file by date\. The duration of the recordings is set by the user (default is 10minutes)\.
|
23
|
+
.
|
24
|
+
.SH "FILES"
|
25
|
+
\fB~/\.electric_eye/config\.yml\fR is used for storing the configuration
|
26
|
+
.
|
27
|
+
.SH "OPTIONS"
|
28
|
+
.
|
29
|
+
.TP
|
30
|
+
\fB\-a\fR, \fB\-\-add CAMERA_NAME CAMERA_URL\fR
|
31
|
+
Add a camera
|
32
|
+
.
|
33
|
+
.TP
|
34
|
+
\fB\-r\fR, \fB\-\-remove CAMERA_NAME\fR
|
35
|
+
Remove a camera
|
36
|
+
.
|
37
|
+
.TP
|
38
|
+
\fB\-p\fR, \'\-\-path DIR\'
|
39
|
+
Set the output path
|
40
|
+
.
|
41
|
+
.TP
|
42
|
+
\fB\-d\fR, \fB\-\-duration SECONDS\fR
|
43
|
+
Set the duration of each recording
|
44
|
+
.
|
45
|
+
.TP
|
46
|
+
\fB\-l\fR, \fB\-\-list\fR
|
47
|
+
List the cameras in the config
|
48
|
+
.
|
49
|
+
.TP
|
50
|
+
\fB\-s\fR, \fB\-\-start\fR
|
51
|
+
Start recordings
|
52
|
+
.
|
53
|
+
.TP
|
54
|
+
\fB\-k\fR, \fB\-\-stop\fR
|
55
|
+
Stop all recordings
|
56
|
+
.
|
57
|
+
.SH "EXAMPLES"
|
58
|
+
Add a camera called reception
|
59
|
+
.
|
60
|
+
.br
|
61
|
+
$ electric_eye \-a reception http://192\.168\.0\.2/live2\.sdp
|
62
|
+
.
|
63
|
+
.P
|
64
|
+
Remove a camera
|
65
|
+
.
|
66
|
+
.br
|
67
|
+
$ electric_eye \-a reception
|
68
|
+
.
|
69
|
+
.P
|
70
|
+
Start recordings
|
71
|
+
.
|
72
|
+
.br
|
73
|
+
$ electric_eye \-s
|
74
|
+
.
|
75
|
+
.P
|
76
|
+
Stop recordings
|
77
|
+
.
|
78
|
+
.br
|
79
|
+
$ electric_eye \-k
|
80
|
+
.
|
81
|
+
.SH "AUTHOR"
|
82
|
+
Michael Pope (map7777@gmail\.com)
|
83
|
+
.
|
84
|
+
.SH "SEE ALSO"
|
85
|
+
VLC (https://www\.videolan\.org/vlc/)
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>electric_eye(1) - Record one or more IP cameras</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
58
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
59
|
+
<a href="#FILES">FILES</a>
|
60
|
+
<a href="#OPTIONS">OPTIONS</a>
|
61
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
62
|
+
<a href="#AUTHOR">AUTHOR</a>
|
63
|
+
<a href="#SEE-ALSO">SEE ALSO</a>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<ol class='man-decor man-head man head'>
|
67
|
+
<li class='tl'>electric_eye(1)</li>
|
68
|
+
<li class='tc'></li>
|
69
|
+
<li class='tr'>electric_eye(1)</li>
|
70
|
+
</ol>
|
71
|
+
|
72
|
+
<h2 id="NAME">NAME</h2>
|
73
|
+
<p class="man-name">
|
74
|
+
<code>electric_eye</code> - <span class="man-whatis">Record one or more IP cameras</span>
|
75
|
+
</p>
|
76
|
+
|
77
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
78
|
+
|
79
|
+
<p><code>electric_eye</code> <code>-a camera_name camera_url</code><br />
|
80
|
+
<code>electric_eye</code> <code>-r camera_name</code><br />
|
81
|
+
<code>electric_eye</code> <code>-s</code><br />
|
82
|
+
<code>electric_eye</code> <code>-k</code></p>
|
83
|
+
|
84
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
85
|
+
|
86
|
+
<p><strong>electric_eye</strong> is a simple program which loops over all your cameras
|
87
|
+
and starts recording into a set directory naming each file by date. The
|
88
|
+
duration of the recordings is set by the user (default is 10minutes).</p>
|
89
|
+
|
90
|
+
<h2 id="FILES">FILES</h2>
|
91
|
+
|
92
|
+
<p><code>~/.electric_eye/config.yml</code> is used for storing the configuration</p>
|
93
|
+
|
94
|
+
<h2 id="OPTIONS">OPTIONS</h2>
|
95
|
+
|
96
|
+
<dl>
|
97
|
+
<dt><code>-a</code>, <code>--add CAMERA_NAME CAMERA_URL</code></dt><dd>Add a camera</dd>
|
98
|
+
<dt><code>-r</code>, <code>--remove CAMERA_NAME</code></dt><dd>Remove a camera</dd>
|
99
|
+
<dt><code>-p</code>, '--path DIR'</dt><dd>Set the output path</dd>
|
100
|
+
<dt><code>-d</code>, <code>--duration SECONDS</code></dt><dd>Set the duration of each recording</dd>
|
101
|
+
<dt><code>-l</code>, <code>--list</code></dt><dd>List the cameras in the config</dd>
|
102
|
+
<dt><code>-s</code>, <code>--start</code></dt><dd>Start recordings</dd>
|
103
|
+
<dt><code>-k</code>, <code>--stop</code></dt><dd>Stop all recordings</dd>
|
104
|
+
</dl>
|
105
|
+
|
106
|
+
|
107
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
108
|
+
|
109
|
+
<p>Add a camera called reception<br />
|
110
|
+
$ electric_eye -a reception http://192.168.0.2/live2.sdp</p>
|
111
|
+
|
112
|
+
<p>Remove a camera<br />
|
113
|
+
$ electric_eye -a reception</p>
|
114
|
+
|
115
|
+
<p>Start recordings<br />
|
116
|
+
$ electric_eye -s</p>
|
117
|
+
|
118
|
+
<p>Stop recordings<br />
|
119
|
+
$ electric_eye -k</p>
|
120
|
+
|
121
|
+
<h2 id="AUTHOR">AUTHOR</h2>
|
122
|
+
|
123
|
+
<p>Michael Pope (map7777@gmail.com)</p>
|
124
|
+
|
125
|
+
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
126
|
+
|
127
|
+
<p>VLC (https://www.videolan.org/vlc/)</p>
|
128
|
+
|
129
|
+
|
130
|
+
<ol class='man-decor man-foot man foot'>
|
131
|
+
<li class='tl'></li>
|
132
|
+
<li class='tc'>June 2015</li>
|
133
|
+
<li class='tr'>electric_eye(1)</li>
|
134
|
+
</ol>
|
135
|
+
|
136
|
+
</div>
|
137
|
+
</body>
|
138
|
+
</html>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
electric_eye(1) -- Record one or more IP cameras
|
2
|
+
================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`electric_eye` `-a camera_name camera_url`<br>
|
7
|
+
`electric_eye` `-r camera_name`<br>
|
8
|
+
`electric_eye` `-s`<br>
|
9
|
+
`electric_eye` `-k`
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
**electric_eye** is a simple program which loops over all your cameras
|
14
|
+
and starts recording into a set directory naming each file by date. The
|
15
|
+
duration of the recordings is set by the user (default is 10minutes).
|
16
|
+
|
17
|
+
## FILES
|
18
|
+
|
19
|
+
`~/.electric_eye/config.yml` is used for storing the configuration
|
20
|
+
|
21
|
+
## OPTIONS
|
22
|
+
|
23
|
+
* `-a`, `--add CAMERA_NAME CAMERA_URL`:
|
24
|
+
Add a camera
|
25
|
+
* `-r`, `--remove CAMERA_NAME`:
|
26
|
+
Remove a camera
|
27
|
+
* `-p`, '--path DIR':
|
28
|
+
Set the output path
|
29
|
+
* `-d`, `--duration SECONDS`:
|
30
|
+
Set the duration of each recording
|
31
|
+
* `-l`, `--list`:
|
32
|
+
List the cameras in the config
|
33
|
+
* `-s`, `--start`:
|
34
|
+
Start recordings
|
35
|
+
* `-k`, `--stop`:
|
36
|
+
Stop all recordings
|
37
|
+
|
38
|
+
## EXAMPLES
|
39
|
+
|
40
|
+
Add a camera called reception<br>
|
41
|
+
$ electric_eye -a reception http://192.168.0.2/live2.sdp
|
42
|
+
|
43
|
+
Remove a camera<br>
|
44
|
+
$ electric_eye -a reception
|
45
|
+
|
46
|
+
Start recordings<br>
|
47
|
+
$ electric_eye -s
|
48
|
+
|
49
|
+
Stop recordings<br>
|
50
|
+
$ electric_eye -k
|
51
|
+
|
52
|
+
## AUTHOR
|
53
|
+
|
54
|
+
Michael Pope (map7777@gmail.com)
|
55
|
+
|
56
|
+
## SEE ALSO
|
57
|
+
|
58
|
+
VLC (https://www.videolan.org/vlc/)
|
59
|
+
|
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.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Pope
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: construct
|
@@ -136,6 +136,34 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: gem-man
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: ronn
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: methadone
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,7 +205,7 @@ files:
|
|
177
205
|
- Gemfile
|
178
206
|
- Gemfile.lock
|
179
207
|
- LICENSE.txt
|
180
|
-
- README.
|
208
|
+
- README.org
|
181
209
|
- README.rdoc
|
182
210
|
- Rakefile
|
183
211
|
- bin/electric_eye
|
@@ -193,6 +221,9 @@ files:
|
|
193
221
|
- lib/electric_eye/record.rb
|
194
222
|
- lib/electric_eye/settings.rb
|
195
223
|
- lib/electric_eye/version.rb
|
224
|
+
- man/electric_eye.1
|
225
|
+
- man/electric_eye.1.html
|
226
|
+
- man/electric_eye.1.ronn
|
196
227
|
- spec/config_spec.rb
|
197
228
|
- spec/electric_eye_spec.rb
|
198
229
|
- spec/spec_helper.rb
|
data/README.md
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
# ElectricEye
|
2
|
-
|
3
|
-
A network video recorder for multiple IP cameras using VLC.
|
4
|
-
|
5
|
-
## History
|
6
|
-
|
7
|
-
I've been using Zoneminder & motion and these programs are either too large for my requirements (zoneminder) or don't work with the cameras I own (motion). What I did notice is all my cameras work through VLC with high resolution and VLC can record.
|
8
|
-
|
9
|
-
The problem was though VLC doesn't automate the recordings or handle the file structure nicely. This is where I started to think about creating an application which records from VLC and nicely sorts those recordings in directories by date & time.
|
10
|
-
|
11
|
-
## Requirements
|
12
|
-
|
13
|
-
- VLC
|
14
|
-
- ruby
|
15
|
-
- Linux (Tested on Debian 7)
|
16
|
-
|
17
|
-
## Installation
|
18
|
-
|
19
|
-
Add this line to your application's Gemfile:
|
20
|
-
|
21
|
-
```ruby
|
22
|
-
gem 'electric_eye'
|
23
|
-
```
|
24
|
-
|
25
|
-
And then execute:
|
26
|
-
|
27
|
-
$ bundle
|
28
|
-
|
29
|
-
Or install it yourself as:
|
30
|
-
|
31
|
-
$ gem install electric_eye
|
32
|
-
|
33
|
-
## Configuration
|
34
|
-
|
35
|
-
Enter your cameras into the JSON config file like so
|
36
|
-
|
37
|
-
```yaml
|
38
|
-
---
|
39
|
-
duration: 60
|
40
|
-
path: "/media/data/recordings/temp"
|
41
|
-
cameras:
|
42
|
-
- :name: Reception
|
43
|
-
:url: rtsp://<user>:<passwd>@<camera's ip>/live2.sdp
|
44
|
-
- :name: Kitchen
|
45
|
-
:url: rtsp://<user>:<passwd>@<camera's ip>/live2.sdp
|
46
|
-
- :name: Workstations
|
47
|
-
:url: rtsp://<user>:<passwd>@<camera's ip>/live2.sdp
|
48
|
-
```
|
49
|
-
|
50
|
-
You should be able to view the URL through vlc before using this program.
|
51
|
-
|
52
|
-
The recordings directory will end up with these directories
|
53
|
-
|
54
|
-
/media/data/recordings/reception/20150527
|
55
|
-
/media/data/recordings/kitchen/20150527
|
56
|
-
|
57
|
-
Notice the date at the end of these paths, there will be one for each day. The contents within will be recordings which are done by default every 10minutes, example;
|
58
|
-
|
59
|
-
20150527-1020-reception.mjpeg
|
60
|
-
20150527-1030-reception.mjpeg
|
61
|
-
20150527-1040-reception.mjpeg
|
62
|
-
|
63
|
-
The default is going to be 10 minute blocks, this can be overridden with the duration variable above in minutes.
|
64
|
-
|
65
|
-
## Usage
|
66
|
-
|
67
|
-
First make sure you add your cameras
|
68
|
-
|
69
|
-
electric_eye add Reception <url>
|
70
|
-
|
71
|
-
Now start the daemon to start the recording process
|
72
|
-
|
73
|
-
electric_eye start
|
74
|
-
|
75
|
-
Stop all recordings
|
76
|
-
|
77
|
-
electric_eye stop
|
78
|
-
|
79
|
-
Usage in development mode
|
80
|
-
|
81
|
-
bundle exec bin/electric_eye -h
|
82
|
-
|
83
|
-
|
84
|
-
## Cleanup
|
85
|
-
|
86
|
-
Cleaning up recordings. Put the following into your /etc/crontab per recording directory.
|
87
|
-
|
88
|
-
00 19 * * * root /usr/bin/find <directory to recordings> -type f -mtime +<days> -exec rm {} \;
|
89
|
-
|
90
|
-
Example for cleaning up reception after 60days at 7pm everynight.
|
91
|
-
|
92
|
-
00 19 * * * root /usr/bin/find /media/recordings/reception -type f -mtime +60 -exec rm {} \;
|
93
|
-
|
94
|
-
## Contributing
|
95
|
-
|
96
|
-
1. Fork it ( https://github.com/map7/electric_eye/fork )
|
97
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
98
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
99
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
100
|
-
5. Create a new Pull Request
|
101
|
-
|
102
|
-
## TODO
|
103
|
-
|
104
|
-
- Adjust directory layout
|
105
|
-
- Turn into a gem
|
106
|
-
- Add testing
|
107
|
-
- Add motion detection (using [rmotion](https://github.com/rikiji/rmotion))
|
108
|
-
- Do inline motion detection (using activevlc)
|
109
|
-
- Allow different recording programs like raspicam
|
110
|
-
|