Skip to content

Commit 8bc2260

Browse files
committed
Add movie number specifier
1 parent 65d5c39 commit 8bc2260

File tree

8 files changed

+14
-5
lines changed

8 files changed

+14
-5
lines changed

data/camera1-dist.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ text_left CAMERA 1
3131
;*************************************************
3232
;***** Movie
3333
;*************************************************
34-
movie_filename CAM01_%t-%v-%Y%m%d%H%M%S
34+
movie_filename CAM01_%t-%v-%{movienbr}-%Y%m%d%H%M%S
3535

3636

data/camera2-dist.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ text_right Patio\n%Y-%m-%d\n%T-%q
3232
;*************************************************
3333
;***** Movie
3434
;*************************************************
35-
movie_filename CAM02_%t-%v-%Y%m%d%H%M%S
35+
movie_filename CAM02_%t-%v-%{movienbr}-%Y%m%d%H%M%S
3636

data/camera3-dist.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ text_scale 4
3434
;*************************************************
3535
;***** Movie
3636
;*************************************************
37-
movie_filename CAM03_%t-%v-%Y%m%d%H%M%S
37+
movie_filename CAM03_%t-%v-%{movienbr}-%Y%m%d%H%M%S
3838

data/motion-dist.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ movie_output on
7878
movie_max_time 120
7979
movie_quality 60
8080
movie_container mkv
81-
movie_filename %v-%Y%m%d%H%M%S
81+
movie_filename %v-%{movienbr}-%Y%m%d%H%M%S
8282

8383
;*************************************************
8484
;***** Web Control

doc/motion_config.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,9 @@ <h3><a name="conversion_specifiers"></a>Conversion Specifiers</h3>
711711
<tr>
712712
<td bgcolor="#edf4f9" >%{trig_freq}</a> </td>
713713
<td bgcolor="#edf4f9" >frequency that triggered the sound alert</a> </td>
714-
</tr>
714+
<td bgcolor="#edf4f9" >%{movienbr}</a> </td>
715+
<td bgcolor="#edf4f9" >id number for the movie within the event</a> </td>
716+
</tr>
715717

716718
</tbody>
717719
</table>

src/camera.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ void cls_camera::movie_start()
209209
} else {
210210
movie_fps = lastrate;
211211
}
212+
movie_nbr++;
212213
movie_norm->start();
213214
movie_motion->start();
214215
movie_extpipe->start();
@@ -231,6 +232,7 @@ void cls_camera::detected_trigger()
231232
if (event_curr_nbr != event_prev_nbr) {
232233
info_reset();
233234
event_prev_nbr = event_curr_nbr;
235+
movie_nbr = 0;
234236

235237
algsec->detected = false;
236238

src/camera.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class cls_camera {
167167
bool detecting_motion;
168168
int event_curr_nbr;
169169
int event_prev_nbr;
170+
int movie_nbr;
170171
int threshold;
171172
int lastrate;
172173
int frame_skip;

src/util.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ void mystrftime_base(cls_camera *cam
409409
sprintf(tmp, "%0*d", wd, cam->movie_fps);
410410
user_fmt.append(tmp);
411411
indx += (strlen("{fps}")-1);
412+
} else if (fmt.substr(indx,strlen("{movienbr}")) == "{movienbr}") {
413+
sprintf(tmp, "%0*d", wd, cam->movie_nbr);
414+
user_fmt.append(tmp);
415+
indx += (strlen("{movienbr}")-1);
412416
} else if (fmt.substr(indx,strlen("{eventid}")) == "{eventid}") {
413417
tst = cam->eventid;
414418
if (wd > 0) {

0 commit comments

Comments
 (0)