|
|
|
|
@@ -233,9 +233,9 @@ int parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t
|
|
|
|
|
}
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# define OPT_PARSE(_name, _dest, _func, _invalid) { \
|
|
|
|
|
# define OPT_PARSE(_name, _dest, _func, _invalid, _available) { \
|
|
|
|
|
if ((_dest = _func(optarg)) == _invalid) { \
|
|
|
|
|
printf("Unknown " _name ": %s\n", optarg); \
|
|
|
|
|
printf("Unknown " _name ": %s; available: %s\n", optarg, _available); \
|
|
|
|
|
return -1; \
|
|
|
|
|
} \
|
|
|
|
|
break; \
|
|
|
|
|
@@ -263,10 +263,10 @@ int parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t
|
|
|
|
|
if (isalpha(_LONG_OPTS[opt_index].val)) {
|
|
|
|
|
short_opts[short_index] = _LONG_OPTS[opt_index].val;
|
|
|
|
|
++short_index;
|
|
|
|
|
}
|
|
|
|
|
if (_LONG_OPTS[opt_index].has_arg == required_argument) {
|
|
|
|
|
short_opts[short_index] = ':';
|
|
|
|
|
++short_index;
|
|
|
|
|
if (_LONG_OPTS[opt_index].has_arg == required_argument) {
|
|
|
|
|
short_opts[short_index] = ':';
|
|
|
|
|
++short_index;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -277,9 +277,9 @@ int parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t
|
|
|
|
|
case _O_RESOLUTION: OPT_RESOLUTION("--resolution", dev->width, dev->height, true);
|
|
|
|
|
# pragma GCC diagnostic ignored "-Wsign-compare"
|
|
|
|
|
# pragma GCC diagnostic push
|
|
|
|
|
case _O_FORMAT: OPT_PARSE("pixel format", dev->format, device_parse_format, FORMAT_UNKNOWN);
|
|
|
|
|
case _O_FORMAT: OPT_PARSE("pixel format", dev->format, device_parse_format, FORMAT_UNKNOWN, FORMATS_STR);
|
|
|
|
|
# pragma GCC diagnostic pop
|
|
|
|
|
case _O_TV_STANDARD: OPT_PARSE("TV standard", dev->standard, device_parse_standard, STANDARD_UNKNOWN);
|
|
|
|
|
case _O_TV_STANDARD: OPT_PARSE("TV standard", dev->standard, device_parse_standard, STANDARD_UNKNOWN, STANDARDS_STR);
|
|
|
|
|
case _O_DESIRED_FPS: OPT_NUMBER("--desired-fps", dev->desired_fps, 0, VIDEO_MAX_FPS, 0);
|
|
|
|
|
case _O_MIN_FRAME_SIZE: OPT_NUMBER("--min-frame-size", dev->min_frame_size, 0, 8192, 0);
|
|
|
|
|
case _O_PERSISTENT: OPT_SET(dev->persistent, true);
|
|
|
|
|
@@ -287,7 +287,7 @@ int parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t
|
|
|
|
|
case _O_BUFFERS: OPT_NUMBER("--buffers", dev->n_buffers, 1, 32, 0);
|
|
|
|
|
case _O_WORKERS: OPT_NUMBER("--workers", dev->n_workers, 1, 32, 0);
|
|
|
|
|
case _O_QUALITY: OPT_NUMBER("--quality", encoder->quality, 1, 100, 0);
|
|
|
|
|
case _O_ENCODER: OPT_PARSE("encoder type", encoder->type, encoder_parse_type, ENCODER_TYPE_UNKNOWN);
|
|
|
|
|
case _O_ENCODER: OPT_PARSE("encoder type", encoder->type, encoder_parse_type, ENCODER_TYPE_UNKNOWN, ENCODER_TYPES_STR);
|
|
|
|
|
# ifdef WITH_OMX
|
|
|
|
|
case _O_GLITCHED_RESOLUTIONS: OPT_GLITCHED_RESOLUTIONS;
|
|
|
|
|
# endif
|
|
|
|
|
@@ -466,13 +466,23 @@ static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_s
|
|
|
|
|
printf(" Default: %u (the number of CPU cores (but not more than 4) + 1).\n\n", dev->n_buffers);
|
|
|
|
|
printf(" -w|--workers <N> ──────────────────── The number of worker threads but not more than buffers.\n");
|
|
|
|
|
printf(" Default: %u (the number of CPU cores (but not more than 4)).\n\n", dev->n_workers);
|
|
|
|
|
printf(" -q|--quality <N> ──────────────────── Set quality of JPEG encoding from 1 to 100 (best). Default: %u.\n\n", encoder->quality);
|
|
|
|
|
printf(" -c|--encoder <type> ───────────────── Use specified encoder. It may affect the number of workers.\n\n");
|
|
|
|
|
printf(" -q|--quality <N> ──────────────────── Set quality of JPEG encoding from 1 to 100 (best). Default: %u.\n", encoder->quality);
|
|
|
|
|
printf(" Note: If HW encoding is used (JPEG source format selected),\n");
|
|
|
|
|
printf(" this parameter attempts to configure the camera\n");
|
|
|
|
|
printf(" or capture device hardware's internal encoder.\n");
|
|
|
|
|
printf(" It does not re-encode MJPG to MJPG to change the quality level\n");
|
|
|
|
|
printf(" for sources that already output MJPG.\n\n");
|
|
|
|
|
printf(" -c|--encoder <type> ───────────────── Use specified encoder. It may affect the number of workers.\n");
|
|
|
|
|
printf(" Available:\n");
|
|
|
|
|
printf(" * CPU ─ Software MJPG encoding (default);\n");
|
|
|
|
|
# ifdef WITH_OMX
|
|
|
|
|
printf(" * OMX ─ GPU hardware accelerated MJPG encoding with OpenMax;\n");
|
|
|
|
|
# endif
|
|
|
|
|
printf(" * HW ── Use pre-encoded MJPG frames directly from camera hardware.\n\n");
|
|
|
|
|
# ifdef WITH_OMX
|
|
|
|
|
printf(" -g|--glitched-resolutions <WxH,...> ─ Comma-separated list of resolutions that require forced\n");
|
|
|
|
|
printf(" encoding on CPU instead of OMX. Default: disabled.\n\n");
|
|
|
|
|
# endif
|
|
|
|
|
printf(" encoding on CPU instead of OMX. Default: disabled.\n");
|
|
|
|
|
printf(" Available: %s; default: CPU.\n\n", ENCODER_TYPES_STR);
|
|
|
|
|
printf(" --device-timeout <seconds> ────────── Timeout for device querying. Default: %u.\n\n", dev->timeout);
|
|
|
|
|
printf(" --device-error-delay <seconds> ────── Delay before trying to connect to the device again\n");
|
|
|
|
|
printf(" after an error (timeout for example). Default: %u.\n\n", dev->error_delay);
|
|
|
|
|
|