Skip to content

Commit a055ad3

Browse files
committed
Add functionality for movie_all_frames
1 parent 8710787 commit a055ad3

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

doc/motion_config.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,15 @@ <h2><a name="Configuration_OptionsTopic"></a> Configuration Options-Listed by T
388388
<td bgcolor="#edf4f9" ><a href="#movie_filename" >movie_filename</a> </td>
389389
<td bgcolor="#edf4f9" ><a href="#movie_extpipe_use" >movie_extpipe_use</a> </td>
390390
<td bgcolor="#edf4f9" ><a href="#movie_extpipe" >movie_extpipe</a> </td>
391-
<td bgcolor="#edf4f9" ><a href="#timelapse_filename" >timelapse_filename</a> </td>
391+
<td bgcolor="#edf4f9" ><a href="#movie_all_frames" >movie_all_frames</a> </td>
392392
</tr>
393393
<tr>
394+
<td bgcolor="#edf4f9" ><a href="#timelapse_filename" >timelapse_filename</a> </td>
394395
<td bgcolor="#edf4f9" ><a href="#timelapse_interval" >timelapse_interval</a> </td>
395396
<td bgcolor="#edf4f9" ><a href="#timelapse_mode" >timelapse_mode</a> </td>
396397
<td bgcolor="#edf4f9" ><a href="#timelapse_container" >timelapse_container</a> </td>
398+
</tr>
399+
<tr>
397400
<td bgcolor="#edf4f9" ><a href="#timelapse_fps" >timelapse_fps</a> </td>
398401
</tr>
399402
</tbody>
@@ -2260,6 +2263,14 @@ <h3><a name="movie_extpipe"></a> movie_extpipe </h3>
22602263
</ul>
22612264
<p></p>
22622265

2266+
<h3><a name="movie_all_frames"></a> movie_all_frames </h3>
2267+
<ul>
2268+
<li> Values: on, off | Default: on</li>
2269+
Specifies whether to send all frames for encoding during an event instead of just
2270+
those associated with motion or pre/post capture.
2271+
</ul>
2272+
<p></p>
2273+
22632274
<h3><a name="timelapse_interval"></a> timelapse_interval </h3>
22642275
<ul>
22652276
<li> Values: Integer | Default: 0</li>

src/camera.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,8 @@ void cls_camera::actions_emulate()
15621562
imgs.image_ring[indx].save_movie = true;
15631563
}
15641564

1565+
lasttime = current_image->monots.tv_sec;
1566+
15651567
detected();
15661568
}
15671569

@@ -1609,10 +1611,14 @@ void cls_camera::actions_motion()
16091611
current_image->save_pic = true;
16101612
current_image->save_movie = true;
16111613
postcap--;
1614+
} else if ((cfg->movie_all_frames) && (event_curr_nbr == event_prev_nbr)) {
1615+
current_image->save_movie = true;
16121616
} else {
16131617
current_image->precap = true;
16141618
}
16151619

1620+
lasttime = current_image->monots.tv_sec;
1621+
16161622
detected();
16171623
}
16181624

@@ -1712,6 +1718,8 @@ void cls_camera::actions()
17121718
current_image->save_pic = true;
17131719
current_image->save_movie = true;
17141720
postcap--;
1721+
} else if ((cfg->movie_all_frames) && (event_curr_nbr == event_prev_nbr)) {
1722+
current_image->save_movie = true;
17151723
} else {
17161724
current_image->precap = true;
17171725
if ((cfg->event_gap == 0) && detecting_motion) {
@@ -1720,10 +1728,6 @@ void cls_camera::actions()
17201728
detecting_motion = false;
17211729
}
17221730

1723-
if ((current_image->save_pic) || (current_image->save_movie )) {
1724-
lasttime = current_image->monots.tv_sec;
1725-
}
1726-
17271731
if (detecting_motion) {
17281732
algsec->detect();
17291733
}

src/conf.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ ctx_parm config_parms[] = {
140140
{"movie_passthrough", PARM_TYP_BOOL, PARM_CAT_10, PARM_LEVEL_LIMITED },
141141
{"movie_filename", PARM_TYP_STRING, PARM_CAT_10, PARM_LEVEL_LIMITED },
142142
{"movie_retain", PARM_TYP_LIST, PARM_CAT_10, PARM_LEVEL_LIMITED },
143+
{"movie_all_frames", PARM_TYP_BOOL, PARM_CAT_10, PARM_LEVEL_LIMITED },
143144
{"movie_extpipe_use", PARM_TYP_BOOL, PARM_CAT_10, PARM_LEVEL_RESTRICTED },
144145
{"movie_extpipe", PARM_TYP_STRING, PARM_CAT_10, PARM_LEVEL_RESTRICTED },
145146

@@ -2110,6 +2111,19 @@ void cls_config::edit_movie_retain(std::string &parm, enum PARM_ACT pact)
21102111
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_retain",_("movie_retain"));
21112112
}
21122113

2114+
void cls_config::edit_movie_all_frames(std::string &parm, enum PARM_ACT pact)
2115+
{
2116+
if (pact == PARM_ACT_DFLT) {
2117+
movie_all_frames = true;
2118+
} else if (pact == PARM_ACT_SET) {
2119+
edit_set_bool(movie_all_frames, parm);
2120+
} else if (pact == PARM_ACT_GET) {
2121+
edit_get_bool(parm, movie_all_frames);
2122+
}
2123+
return;
2124+
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_all_frames",_("movie_all_frames"));
2125+
}
2126+
21132127
void cls_config::edit_movie_extpipe_use(std::string &parm, enum PARM_ACT pact)
21142128
{
21152129
if (pact == PARM_ACT_DFLT) {
@@ -3311,6 +3325,7 @@ void cls_config::edit_cat10(std::string parm_nm, std::string &parm_val, enum PAR
33113325
} else if (parm_nm == "movie_passthrough") { edit_movie_passthrough(parm_val, pact);
33123326
} else if (parm_nm == "movie_filename") { edit_movie_filename(parm_val, pact);
33133327
} else if (parm_nm == "movie_retain") { edit_movie_retain(parm_val, pact);
3328+
} else if (parm_nm == "movie_all_frames") { edit_movie_all_frames(parm_val, pact);
33143329
} else if (parm_nm == "movie_extpipe_use") { edit_movie_extpipe_use(parm_val, pact);
33153330
} else if (parm_nm == "movie_extpipe") { edit_movie_extpipe(parm_val, pact);
33163331
}

src/conf.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
bool movie_passthrough;
205205
std::string movie_filename;
206206
std::string movie_retain;
207+
bool movie_all_frames;
207208
bool movie_extpipe_use;
208209
std::string movie_extpipe;
209210

@@ -441,6 +442,7 @@
441442
void edit_snapshot_filename(std::string &parm, enum PARM_ACT pact);
442443
void edit_snapshot_interval(std::string &parm, enum PARM_ACT pact);
443444

445+
void edit_movie_all_frames(std::string &parm, enum PARM_ACT pact);
444446
void edit_movie_bps(std::string &parm, enum PARM_ACT pact);
445447
void edit_movie_container(std::string &parm, enum PARM_ACT pact);
446448
void edit_movie_extpipe(std::string &parm, enum PARM_ACT pact);

0 commit comments

Comments
 (0)