diff --git a/pikrellcam b/pikrellcam index f054224..df45950 100755 Binary files a/pikrellcam and b/pikrellcam differ diff --git a/src/config.c b/src/config.c index 0bbb7b8..041c573 100644 --- a/src/config.c +++ b/src/config.c @@ -571,10 +571,10 @@ static Config config[] = "#", "on_startup", "$C/startup $I $m $G", TRUE, {.string = &pikrellcam.on_startup_cmd}, config_string_set }, - { "# Set to on to enable pikrellcam to accept halt and reboot commands\n" - "# from the FIFO. This enables halt and reboot from the web page.\n" + { "# Set to off to disable accepting halt and reboot commands\n" + "# from the FIFO and the web page.\n" "#", - "halt_enable", "off", FALSE, {.value = &pikrellcam.halt_enable}, config_value_bool_set}, + "halt_enable", "on", FALSE, {.value = &pikrellcam.halt_enable}, config_value_bool_set}, @@ -787,10 +787,11 @@ static Config config[] = "#", "video_bitrate", "6000000", TRUE, {.value = &pikrellcam.camera_adjust.video_bitrate}, config_value_int_set }, - { "# Pixel width of the stream jpeg file. Aspect ratio is determined by the video.\n" - "# This value will be rounded off to be a multiple of 16. If you want\n" - "# a larger image but not increase bandwith usage, try a mjpeg_width of\n" - "# 1024 with a mjpeg_quality 10.\n" + { "# Pixel width of the streamed jpeg file /run/pikrellcam/mjpeg.jpg.\n" + "# Aspect ratio is determined by the video resolution setting.\n" + "# This value will be rounded off to be a multiple of 16.\n" + "# If bandwith is a problem you can reduce mjpeg_quality to 5 without\n" + "# much loss of quality.\n" "#", "mjpeg_width", "800", TRUE, {.value = &pikrellcam.mjpeg_width}, config_value_int_set }, @@ -799,7 +800,7 @@ static Config config[] = "# is not the same as quality factors in other jpeg programs and should\n" "# be set lower than those programs.\n" "#", - "mjpeg_quality", "10", TRUE, {.value = &pikrellcam.mjpeg_quality}, config_value_int_set }, + "mjpeg_quality", "8", TRUE, {.value = &pikrellcam.mjpeg_quality}, config_value_int_set }, { "# Divide the video_fps by this to get the stream jpeg file update rate.\n" "# This will also be the motion frame check rate for motion detection.\n" diff --git a/src/pikrellcam.c b/src/pikrellcam.c index e48cbf2..33077e6 100644 --- a/src/pikrellcam.c +++ b/src/pikrellcam.c @@ -1337,7 +1337,7 @@ int main(int argc, char *argv[]) { int fifo; - int i, n; + int i, j, n; char *opt, *arg, *equal_arg, *user; char *line, *eol, buf[4096]; int t_usleep; @@ -1395,7 +1395,7 @@ main(int argc, char *argv[]) i = snprintf(buf, sizeof(buf), "sudo -P %s -user%d -group%d -home%s ", *argv++, (int) getuid(), (int) getgid(), homedir); while (--argc && i < sizeof(buf) - 64 - strlen(*argv)) - i = sprintf(buf + i, "%s ", *argv++); + i += sprintf(buf + i, "%s ", *argv++); set_exec_with_session(FALSE); exec_wait(buf, NULL); /* restart as root so can mmap() gpios*/ @@ -1432,7 +1432,7 @@ main(int argc, char *argv[]) /* Accept: --opt arg -opt arg opt=arg --opt=arg -opt=arg */ - for (i = 0; i < 2; ++i) + for (j = 0; j < 2; ++j) if (*opt == '-') ++opt; if ((equal_arg = strchr(opt, '=')) != NULL) @@ -1442,7 +1442,10 @@ main(int argc, char *argv[]) ++i; } else + { arg = argv[i + 1]; + ++i; + } /* For camera parameters, do not set the camera, only replace | values in the parameter table. @@ -1454,6 +1457,8 @@ main(int argc, char *argv[]) log_printf_no_timestamp("Bad arg: %s\n", opt); exit(1); } + else + pikrellcam.config_modified = TRUE; } if (pikrellcam.debug) @@ -1491,8 +1496,8 @@ main(int argc, char *argv[]) asprintf(&pikrellcam.still_dir, "%s/%s", pikrellcam.media_dir, PIKRELLCAM_STILL_SUBDIR); asprintf(&pikrellcam.timelapse_dir, "%s/%s", pikrellcam.media_dir, PIKRELLCAM_TIMELAPSE_SUBDIR); - if ( !make_dir(pikrellcam.media_dir) - || !make_dir(pikrellcam.archive_dir) + if ( !make_dir(pikrellcam.media_dir) // after startup script, will make + || !make_dir(pikrellcam.archive_dir) // dirs again in case of mount ) exit(1); @@ -1509,6 +1514,7 @@ main(int argc, char *argv[]) check_modes(pikrellcam.log_file, 0664); if ( !make_dir(pikrellcam.tmpfs_dir) + || !make_dir(pikrellcam.archive_dir) || !make_dir(pikrellcam.video_dir) || !make_dir(pikrellcam.thumb_dir) || !make_dir(pikrellcam.still_dir) diff --git a/src/pikrellcam.h b/src/pikrellcam.h index 04d38c4..542b865 100644 --- a/src/pikrellcam.h +++ b/src/pikrellcam.h @@ -50,7 +50,7 @@ #include "utils.h" -#define PIKRELLCAM_VERSION "3.0.5" +#define PIKRELLCAM_VERSION "3.0.6" //TCP Stream Server diff --git a/www/media-archive.php b/www/media-archive.php index f0a5511..76ac996 100644 --- a/www/media-archive.php +++ b/www/media-archive.php @@ -693,8 +693,17 @@ class='btn-control' style='margin-left:8px;'>Videos"; echo "Stills"; } - $disk_total = disk_total_space($archive_root); - $disk_free = disk_free_space($archive_root); + if ("$media_mode" == "archive") + { + $disk_total = disk_total_space($archive_root); + $disk_free = disk_free_space($archive_root); + } + else + { + $disk_total = disk_total_space($media_dir); + $disk_free = disk_free_space($media_dir); + } + $free_percent = sprintf('%.1f',($disk_free / $disk_total) * 100); $total = eng_filesize($disk_total);