mirror of
https://github.com/Motion-Project/motion.git
synced 2026-02-07 13:31:38 -05:00
Adjust timelapse_codec to timelapse_container
This commit is contained in:
22
src/conf.cpp
22
src/conf.cpp
@@ -144,7 +144,7 @@ struct ctx_parm config_parms[] = {
|
||||
{"timelapse_interval", PARM_TYP_INT, PARM_CAT_11, WEBUI_LEVEL_LIMITED },
|
||||
{"timelapse_mode", PARM_TYP_LIST, PARM_CAT_11, WEBUI_LEVEL_LIMITED },
|
||||
{"timelapse_fps", PARM_TYP_INT, PARM_CAT_11, WEBUI_LEVEL_LIMITED },
|
||||
{"timelapse_codec", PARM_TYP_LIST, PARM_CAT_11, WEBUI_LEVEL_LIMITED },
|
||||
{"timelapse_container", PARM_TYP_LIST, PARM_CAT_11, WEBUI_LEVEL_LIMITED },
|
||||
{"timelapse_filename", PARM_TYP_STRING, PARM_CAT_11, WEBUI_LEVEL_LIMITED },
|
||||
|
||||
{"video_pipe", PARM_TYP_STRING, PARM_CAT_12, WEBUI_LEVEL_LIMITED },
|
||||
@@ -2028,27 +2028,27 @@ static void conf_edit_timelapse_fps(struct ctx_cam *cam, std::string &parm, enum
|
||||
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_fps",_("timelapse_fps"));
|
||||
}
|
||||
|
||||
static void conf_edit_timelapse_codec(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact)
|
||||
static void conf_edit_timelapse_container(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact)
|
||||
{
|
||||
if (pact == PARM_ACT_DFLT) {
|
||||
cam->conf->timelapse_codec = "mpg";
|
||||
cam->conf->timelapse_container = "mpg";
|
||||
} else if (pact == PARM_ACT_SET) {
|
||||
if ((parm == "mpg") || (parm == "mpeg4")) {
|
||||
cam->conf->timelapse_codec = parm;
|
||||
if ((parm == "mpg") || (parm == "mkv")) {
|
||||
cam->conf->timelapse_container = parm;
|
||||
} else if (parm == "") {
|
||||
cam->conf->timelapse_codec = "mpg";
|
||||
cam->conf->timelapse_container = "mpg";
|
||||
} else {
|
||||
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Invalid timelapse_codec %s"), parm.c_str());
|
||||
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Invalid timelapse_container %s"), parm.c_str());
|
||||
}
|
||||
} else if (pact == PARM_ACT_GET) {
|
||||
parm = cam->conf->timelapse_codec;
|
||||
parm = cam->conf->timelapse_container;
|
||||
} else if (pact == PARM_ACT_LIST) {
|
||||
parm = "[";
|
||||
parm = parm + "\"mpg\",\"mpeg4\"";
|
||||
parm = parm + "\"mpg\",\"mkv\"";
|
||||
parm = parm + "]";
|
||||
}
|
||||
return;
|
||||
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_codec",_("timelapse_codec"));
|
||||
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_container",_("timelapse_container"));
|
||||
}
|
||||
|
||||
static void conf_edit_timelapse_filename(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact)
|
||||
@@ -2956,7 +2956,7 @@ static void conf_edit_cat11(struct ctx_cam *cam, std::string parm_nm
|
||||
if (parm_nm == "timelapse_interval") { conf_edit_timelapse_interval(cam, parm_val, pact);
|
||||
} else if (parm_nm == "timelapse_mode") { conf_edit_timelapse_mode(cam, parm_val, pact);
|
||||
} else if (parm_nm == "timelapse_fps") { conf_edit_timelapse_fps(cam, parm_val, pact);
|
||||
} else if (parm_nm == "timelapse_codec") { conf_edit_timelapse_codec(cam, parm_val, pact);
|
||||
} else if (parm_nm == "timelapse_container") { conf_edit_timelapse_container(cam, parm_val, pact);
|
||||
} else if (parm_nm == "timelapse_filename") { conf_edit_timelapse_filename(cam, parm_val, pact);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
int timelapse_interval;
|
||||
std::string timelapse_mode;
|
||||
int timelapse_fps;
|
||||
std::string timelapse_codec;
|
||||
std::string timelapse_container;
|
||||
std::string timelapse_filename;
|
||||
|
||||
/* Loopback device configuration parameters */
|
||||
|
||||
@@ -1861,15 +1861,15 @@ int movie_init_timelapse(struct ctx_cam *cam, struct timespec *ts1)
|
||||
cam->movie_timelapse->passthrough = false;
|
||||
cam->movie_timelapse->netcam_data = NULL;
|
||||
|
||||
if (cam->conf->timelapse_codec == "mpg") {
|
||||
MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, _("Timelapse using mpg codec."));
|
||||
if (cam->conf->timelapse_container == "mpg") {
|
||||
MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, _("Timelapse using mpg container."));
|
||||
MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, _("Events will be appended to file"));
|
||||
|
||||
cam->movie_timelapse->tlapse = TIMELAPSE_APPEND;
|
||||
cam->movie_timelapse->codec_name = codec_mpg;
|
||||
retcd = movie_open(cam->movie_timelapse);
|
||||
} else {
|
||||
MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, _("Timelapse using mpeg4 codec."));
|
||||
MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, _("Timelapse using mkv container."));
|
||||
MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, _("Events will be trigger new files"));
|
||||
|
||||
cam->movie_timelapse->tlapse = TIMELAPSE_NEW;
|
||||
|
||||
Reference in New Issue
Block a user