Open prahjister opened 6 years ago
fyi this is how i start the stream
sudo ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so"
is this supposed to show a date?
Yes; first field
is unix timestamp of local machine when the jpg image was fully downloaded. Second field
is ts_late which is the amount of time between the JPG embedded timestamp and when the image was downloaded (two computer clock offset causes this to break). This relies on mjpg-streamer embedding a valid timestamp on outbound JPGs. Which it doesn't seem to be doing in your case
But we are in luck!
https://github.com/jacksonliam/mjpg-streamer/commit/1b22b2e2e4194d3145628e07659b7c848cd8ae1d
As of Aug 5, 2016, mjpg-streamer added a -timestamp
option to enable this functionality :)
So, your second field is showing an exceptionally high value. This suggests to me that adding -timestamp
to your mjpg_streamer invocation should make this second field go to an appropriate value (<<1 second). The program relies on this to estimate which image is safe to save based on how much time has elapsed since the pattern output was updated.
sudo ./mjpg_streamer -timestamp -i "./input_uvc.so" -o "./output_http.so"
Just for reference, this is how I start it in a shell script:
mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so -quality 100 -x $X_RES -y $Y_RES -fps $FPS -ISO 100 -awb off -ex off --awbgainR $RED_GAIN --awbgainB $BLU_GAIN -timestamp -shutter $EXPOSURE_TIME"
The Software Setup Guide has been amended with two invocation examples.
that is wierd...it is not liking the timestamp switch FYI before i compile i have to
sudo apt autoremove python-opencv libopencv-dev
compile then i install again or else i get
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp: In function ‘int input_init(input_parameter*, int)’:
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:275:23: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope
pctx->capture.set(CAP_PROP_FRAME_WIDTH, width);
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:276:23: error: ‘CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
pctx->capture.set(CAP_PROP_FRAME_HEIGHT, height);
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:279:27: error: ‘CAP_PROP_FPS’ was not declared in this scope
pctx->capture.set(CAP_PROP_FPS, settings->fps);
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp: In function ‘void* worker_thread(void*)’:
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:399:15: error: ‘CAP_PROP_FPS’ was not declared in this scope
CVOPT_SET(CAP_PROP_FPS, fps, "frames per second")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:388:32: note: in definition of macro ‘CVOPT_OPT’
if (!pctx->capture.set(prop, settings->var)) {\
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:399:5: note: in expansion of macro ‘CVOPT_SET’
CVOPT_SET(CAP_PROP_FPS, fps, "frames per second")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:400:15: error: ‘CAP_PROP_BRIGHTNES ’ was not declared in this scope
CVOPT_SET(CAP_PROP_BRIGHTNESS, co, "contrast")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:388:32: note: in definition of macro ‘CVOPT_OPT’
if (!pctx->capture.set(prop, settings->var)) {\
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:400:5: note: in expansion of macro ‘CVOPT_SET’
CVOPT_SET(CAP_PROP_BRIGHTNESS, co, "contrast")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:401:15: error: ‘CAP_PROP_CONTRAST’ was not declared in this scope
CVOPT_SET(CAP_PROP_CONTRAST, br, "brightness")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:388:32: note: in definition of macro ‘CVOPT_OPT’
if (!pctx->capture.set(prop, settings->var)) {\
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:401:5: note: in expansion of macro ‘CVOPT_SET’
CVOPT_SET(CAP_PROP_CONTRAST, br, "brightness")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:402:15: error: ‘CAP_PROP_SATURATIO ’ was not declared in this scope
CVOPT_SET(CAP_PROP_SATURATION, sa, "saturation")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:388:32: note: in definition of macro ‘CVOPT_OPT’
if (!pctx->capture.set(prop, settings->var)) {\
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:402:5: note: in expansion of macro ‘CVOPT_SET’
CVOPT_SET(CAP_PROP_SATURATION, sa, "saturation")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:403:15: error: ‘CAP_PROP_GAIN’ was not declared in this scope
CVOPT_SET(CAP_PROP_GAIN, gain, "gain")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:388:32: note: in definition of macro ‘CVOPT_OPT’
if (!pctx->capture.set(prop, settings->var)) {\
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:403:5: note: in expansion of macro ‘CVOPT_SET’
CVOPT_SET(CAP_PROP_GAIN, gain, "gain")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:404:15: error: ‘CAP_PROP_EXPOSURE’ was not declared in this scope
CVOPT_SET(CAP_PROP_EXPOSURE, ex, "exposure")
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:388:32: note: in definition of macro ‘CVOPT_OPT’
if (!pctx->capture.set(prop, settings->var)) {\
^
/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:404:5: note: in expansion of macro ‘CVOPT_SET’
CVOPT_SET(CAP_PROP_EXPOSURE, ex, "exposure")
^
plugins/input_opencv/CMakeFiles/input_opencv.dir/build.make:62: recipe for target 'plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o' failed
make[3]: *** [plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o] Error 1
make[3]: Leaving directory '/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/_build'
CMakeFiles/Makefile2:237: recipe for target 'plugins/input_opencv/CMakeFiles/input_opencv.dir/all' failed
make[2]: *** [plugins/input_opencv/CMakeFiles/input_opencv.dir/all] Error 2
make[2]: Leaving directory '/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/_build'
Makefile:127: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/prahjister/mjpg-streamer/mjpg-streamer-experimental/_build'
Makefile:17: recipe for target 'all' failed
make: *** [all] Error 2
ugh looks like i need opencv 3.1...trying to compile now following this
Even after compiling 3.1 no timestamp swtich available
after looking...it looks like input_raspicam.so is doing the timestamp and input_uvc.so doesnt support it.
It looks like the correct command is below if it supported it
sudo ./mjpg_streamer -i "./input_uvc.so -timestamp" -o "./output_http.so"
Is the timestamp somehow encoded in the stream? How does it read it?
https://github.com/jacksonliam/mjpg-streamer/issues/124
Can you reply to this...asking Exif or http header?