mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-28 20:56:33 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0afbf02451 | ||
|
|
dd79efd6f5 | ||
|
|
97ac19a2fe | ||
|
|
755e0c2a2a |
@@ -1,7 +1,7 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
current_version = 0.38
|
current_version = 0.40
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?)?
|
||||||
serialize =
|
serialize =
|
||||||
{major}.{minor}
|
{major}.{minor}
|
||||||
|
|||||||
2
PKGBUILD
2
PKGBUILD
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
pkgname=ustreamer
|
pkgname=ustreamer
|
||||||
pkgver=0.38
|
pkgver=0.40
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
||||||
url="https://github.com/pi-kvm/ustreamer"
|
url="https://github.com/pi-kvm/ustreamer"
|
||||||
|
|||||||
@@ -21,4 +21,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION "0.38"
|
#define VERSION "0.40"
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ struct device_t {
|
|||||||
unsigned n_buffers;
|
unsigned n_buffers;
|
||||||
unsigned n_workers;
|
unsigned n_workers;
|
||||||
unsigned desired_fps;
|
unsigned desired_fps;
|
||||||
unsigned every_frame;
|
|
||||||
unsigned min_frame_size;
|
unsigned min_frame_size;
|
||||||
bool persistent;
|
bool persistent;
|
||||||
unsigned timeout;
|
unsigned timeout;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#include "http.h"
|
#include "http.h"
|
||||||
|
|
||||||
|
|
||||||
static const char _short_opts[] = "d:i:x:y:f:a:e:z:tn:w:q:c:s:p:r:h";
|
static const char _short_opts[] = "d:i:x:y:f:a:z:tn:w:q:c:s:p:r:h";
|
||||||
static const struct option _long_opts[] = {
|
static const struct option _long_opts[] = {
|
||||||
{"device", required_argument, NULL, 'd'},
|
{"device", required_argument, NULL, 'd'},
|
||||||
{"input", required_argument, NULL, 'i'},
|
{"input", required_argument, NULL, 'i'},
|
||||||
@@ -48,8 +48,7 @@ static const struct option _long_opts[] = {
|
|||||||
{"height", required_argument, NULL, 'y'},
|
{"height", required_argument, NULL, 'y'},
|
||||||
{"format", required_argument, NULL, 'm'},
|
{"format", required_argument, NULL, 'm'},
|
||||||
{"tv-standard", required_argument, NULL, 'a'},
|
{"tv-standard", required_argument, NULL, 'a'},
|
||||||
{"fps", required_argument, NULL, 'f'},
|
{"desired-fps", required_argument, NULL, 'f'},
|
||||||
{"every-frame", required_argument, NULL, 'e'},
|
|
||||||
{"min-frame-size", required_argument, NULL, 'z'},
|
{"min-frame-size", required_argument, NULL, 'z'},
|
||||||
{"dv-timings", no_argument, NULL, 't'},
|
{"dv-timings", no_argument, NULL, 't'},
|
||||||
{"buffers", required_argument, NULL, 'b'},
|
{"buffers", required_argument, NULL, 'b'},
|
||||||
@@ -107,7 +106,6 @@ static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_s
|
|||||||
printf(" -a|--tv-standard <std> -- Force TV standard.\n");
|
printf(" -a|--tv-standard <std> -- Force TV standard.\n");
|
||||||
printf(" Available: %s; default: disabled.\n\n", STANDARDS_STR);
|
printf(" Available: %s; default: disabled.\n\n", STANDARDS_STR);
|
||||||
printf(" -f|--desired-fps <N> -- Desired FPS; default: maximum as possible.\n\n");
|
printf(" -f|--desired-fps <N> -- Desired FPS; default: maximum as possible.\n\n");
|
||||||
printf(" -e|--every-frame <N> -- Drop all input frames except specified. Default: disabled.\n\n");
|
|
||||||
printf(" -z|--min-frame-size <N> -- Drop frames smaller then this limit.\n");
|
printf(" -z|--min-frame-size <N> -- Drop frames smaller then this limit.\n");
|
||||||
printf(" Useful if the device produces small-sized garbage frames.\n\n");
|
printf(" Useful if the device produces small-sized garbage frames.\n\n");
|
||||||
printf(" -t|--dv-timings -- Enable DV timings queriyng and events processing.\n");
|
printf(" -t|--dv-timings -- Enable DV timings queriyng and events processing.\n");
|
||||||
@@ -181,7 +179,6 @@ static int _parse_options(int argc, char *argv[], struct device_t *dev, struct e
|
|||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
case 'a': OPT_PARSE(dev->standard, device_parse_standard, STANDARD_UNKNOWN, "TV standard");
|
case 'a': OPT_PARSE(dev->standard, device_parse_standard, STANDARD_UNKNOWN, "TV standard");
|
||||||
case 'f': OPT_UNSIGNED(dev->desired_fps, "--desired-fps", 0, 30);
|
case 'f': OPT_UNSIGNED(dev->desired_fps, "--desired-fps", 0, 30);
|
||||||
case 'e': OPT_UNSIGNED(dev->every_frame, "--every-frame", 1, 30);
|
|
||||||
case 'z': OPT_UNSIGNED(dev->min_frame_size, "--min-frame-size", 0, 8192);
|
case 'z': OPT_UNSIGNED(dev->min_frame_size, "--min-frame-size", 0, 8192);
|
||||||
case 't': OPT_SET(dev->dv_timings, true);
|
case 't': OPT_SET(dev->dv_timings, true);
|
||||||
case 'b': OPT_UNSIGNED(dev->n_buffers, "--buffers", 1, 32);
|
case 'b': OPT_UNSIGNED(dev->n_buffers, "--buffers", 1, 32);
|
||||||
|
|||||||
11
src/stream.c
11
src/stream.c
@@ -78,11 +78,11 @@ void stream_loop(struct stream_t *stream) {
|
|||||||
pool.workers_stop = &workers_stop;
|
pool.workers_stop = &workers_stop;
|
||||||
|
|
||||||
LOG_INFO("Using V4L2 device: %s", stream->dev->path);
|
LOG_INFO("Using V4L2 device: %s", stream->dev->path);
|
||||||
|
LOG_INFO("Using desired FPS: %u", stream->dev->desired_fps);
|
||||||
|
|
||||||
while (_stream_init_loop(stream->dev, &pool) == 0) {
|
while (_stream_init_loop(stream->dev, &pool) == 0) {
|
||||||
struct worker_t *oldest_worker = NULL;
|
struct worker_t *oldest_worker = NULL;
|
||||||
struct worker_t *last_worker = NULL;
|
struct worker_t *last_worker = NULL;
|
||||||
unsigned frames_count = 0;
|
|
||||||
long double grab_after = 0;
|
long double grab_after = 0;
|
||||||
unsigned fluency_passed = 0;
|
unsigned fluency_passed = 0;
|
||||||
unsigned captured_fps_accum = 0;
|
unsigned captured_fps_accum = 0;
|
||||||
@@ -183,15 +183,6 @@ void stream_loop(struct stream_t *stream) {
|
|||||||
}
|
}
|
||||||
stream->dev->run->pictures[buf_info.index].grab_time = now;
|
stream->dev->run->pictures[buf_info.index].grab_time = now;
|
||||||
|
|
||||||
if (stream->dev->every_frame) {
|
|
||||||
if (frames_count < stream->dev->every_frame - 1) {
|
|
||||||
frames_count += 1;
|
|
||||||
LOG_DEBUG("Dropping frame %d for option --every-frame=%d", frames_count, stream->dev->every_frame);
|
|
||||||
goto pass_frame;
|
|
||||||
}
|
|
||||||
frames_count = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Workaround for broken, corrupted frames:
|
// Workaround for broken, corrupted frames:
|
||||||
// Under low light conditions corrupted frames may get captured.
|
// Under low light conditions corrupted frames may get captured.
|
||||||
// The good thing is such frames are quite small compared to the regular pictures.
|
// The good thing is such frames are quite small compared to the regular pictures.
|
||||||
|
|||||||
Reference in New Issue
Block a user