jacksonliam / mjpg-streamer

Fork of http://sourceforge.net/projects/mjpg-streamer/
3.01k stars 1.22k forks source link

select timeout #182

Closed cgpeter96 closed 2 years ago

cgpeter96 commented 5 years ago

hello,all. I install mjpg-streamer in Raspberry 3B+。 I want to drive three cameras to capture images, but I have encountered such a problem.

If I open tow cam,one of them will occur this problem ,maybe both:

image if I open three cam,two of them will occur this problem ,maybe one:

image

the command

nohup ./mjpg_streamer -i "./input_uvc.so -d /dev/video0  -r 3264x2448 -f 0.1 " -o "./output_http.so -w www -p 9000"&
nohup ./mjpg_streamer -i "./input_uvc.so -d /dev/video1  -r 3264x2448 -f 0.1 " -o "./output_http.so -w www -p 9001"&

# or
nohup ./mjpg_streamer -i "./input_uvc.so -d /dev/video0  -r 3264x2448 -f 0.1 " -o "./output_http.so -w www -p 9000"&
nohup ./mjpg_streamer -i "./input_uvc.so -d /dev/video1  -r 3264x2448 -f 0.1 " -o "./output_http.so -w www -p 9001"&
nohup ./mjpg_streamer -i "./input_uvc.so -d /dev/video2  -r 3264x2448 -f 0.1 " -o "./output_http.so -w www -p 9002"&
jacksonliam commented 5 years ago

@mdevaev multiple cams definitely used to work before the new select() stuff, any idea what the issue might be?

jacksonliam commented 5 years ago

Actually I can see you are using an invalid frame rate, I think it has to be a whole number and will parse that as 0, doing whatever your camera does when asked to do 0. If the framerate is below one every 5 seconds, you'll want to give the -timeout arg in seconds.

For future enhancements, I think we could automatically increase the timeout if we have a low framerate, as 5 sec will be too slow. It would probably also be useful if we could accept fractional framerates.

mdevaev commented 5 years ago

@jacksonliam With such a high resolution, I recommend increased timeout. In addition, the FPS is indeed incorrect, it must be an integer.

@cgpeter96 Try option -timeout 15 and -fps 1

cgpeter96 commented 5 years ago

@mdevaev thanks ,I will try it

flixman commented 5 years ago

Hi. I'm having exactly the same issue: when starting

/usr/local/bin/mjpg_streamer -i input_uvc.so -y -d /dev/video0 -q 80 -n -f 5 -r 640x480 -timeout 15 -o output_http.so -p 8080
/usr/local/bin/mjpg_streamer -i input_uvc.so -y -d /dev/video2 -q 80 -n -f 5 -r 640x480 -timeout 15 -o output_http.so -p 8082

at the same time, after some seconds/minutes I always get the timeout (Note: by "some seconds" I mean something as short as 2 secs). If I start the one for /dev/video2 I runs fine until I start the other: then both get the timeout.

This makes me think it might be a problem not related to mjpg_streamer, but to linux itself? (I'm running rev 501f6362c, on Linux archlinux 5.2.1-1-ARCH #1 SMP Sun Jul 14 19:29:00 UTC 2019 aarch64 GNU/Linux)

mdevaev commented 5 years ago

It's on Raspberry Pi?

flixman commented 5 years ago

sorry, my bad: Yes, on an RPi 3B+.

mdevaev commented 5 years ago

Maybe you're right and the problem somewhere in the kernel. Try to use other mjpg program with your cameras, for example my https://github.com/pi-kvm/ustreamer. If the problem persists, then it is probably in the kernel.

flixman commented 5 years ago

It definitely seems to be a system problem, rather than app-related. I have coded a simple mjpeg streamer variant, using restbed to serve the images, and I'm experiencing exactly the same issue: At some point in time, a select starts to timeout, and from that moment all selects will fail. As soon as I kill and restart the app, everything gets fixed.

lbr38 commented 5 years ago

Hi,

Same issue here :

 i: select() timeout
 i: cleaning up resources allocated by input thread

Running on Raspbian 10 (kernel 4.19.66-v7+) on RPI3

Can someone help us find what is the problem please ?

mdevaev commented 5 years ago

Have you tried increasing the timeout? -timeout 15

cgpeter96 commented 5 years ago

Have you tried increasing the timeout? -timeout 15

no, I just reduce the number of camera

lbr38 commented 5 years ago

Tried with -timeout 15 with no success, still the same issue. Also tried to change the settings of the uvcvideo driver as suggested here : https://www.raspberrypi.org/forums/viewtopic.php?t=35689

modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80

but no success either :(

mdevaev commented 5 years ago

Does your camera work with another program?

cgpeter96 commented 5 years ago

Just collect photos,so I use another strategy that we use fswebcam, because I just wanna take some photos every an hour. It's not required real-time

# execute this command every an hour
fswebcam --no-banner -d /dev/video0 -r 1920x1080 -F 15  --save {1..15}.jpg 
cgpeter96 commented 5 years ago

Does your camera work with another program

no, but it's work well on PC(x86-64)

mdevaev commented 5 years ago

@cgpeter96, @lbr38 - Sorry, I'm a little confused. Do you solve your common problem? :)

Be that as it may, more diagnostics are needed. It is necessary to rebuild mjpg-streamer in debug mode and post here the entire log of the program.

Or there is an easier way. Try to use my https://github.com/pikvm/ustreamer, it's very similar to mjpg-streamer but contains many debug hints out of box: ustreamer --debug --device /dev/video0. Run it and show me the log. This is not advertising - I suffered from debugging of v4l2 and made my own tool to simplify this task.

lbr38 commented 5 years ago

@cgpeter96, @lbr38 - Sorry, I'm a little confused. Do you solve your common problem? :)

Be that as it may, more diagnostics are needed. It is necessary to rebuild mjpg-streamer in debug mode and post here the entire log of the program.

Or there is an easier way. Try to use my https://github.com/pikvm/ustreamer, it's very similar to mjpg-streamer but contains many debug hints out of box: ustreamer --debug --device /dev/video0. Run it and show me the log. This is not advertising - I suffered from debugging of v4l2 and made my own tool to simplify this task.

Thank you for your help, in my case the problem is not solved (still got timeout error) and I'd like to try ustreamer to get more logs but I have issues while building it (i'm on Raspberry Pi3) :

$ make
-- CC src/http/mime.c
src/http/mime.c:27:10: fatal error: event2/util.h: Aucun fichier ou dossier de ce type (traduction : no file found)
 #include <event2/util.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:72: src/http/mime.o] Error 1
mdevaev commented 5 years ago

Install libevent, libjpeg and libuuid

lbr38 commented 5 years ago

Can you tell me the equivalent packages names for RPi (debian) ? I tried with libevent-dev libjpeg-dev and uuid-dev but still got error while building ustreamer. I may have installed the wrong packages ?

sudo make
-- LINKING ustreamer
===== Build complete =====
== CC      = cc
== LIBS    = -lm -ljpeg -pthread -levent -levent_pthreads -luuid
== CFLAGS  = -O3 -c -std=c11 -Wall -Wextra -D_GNU_SOURCE
== LDFLAGS = 
/usr/bin/ld: src/encoder.o: in function `encoder_destroy':
encoder.c:(.text+0xec): undefined reference to `omx_encoder_destroy'
/usr/bin/ld: src/encoder.o: in function `encoder_prepare':
encoder.c:(.text+0x4d8): undefined reference to `omx_encoder_init'
/usr/bin/ld: encoder.c:(.text+0x86c): undefined reference to `omx_encoder_prepare'
/usr/bin/ld: src/encoder.o: in function `encoder_compress_buffer':
encoder.c:(.text+0xde4): undefined reference to `omx_encoder_compress_buffer'
collect2: error: ld returned 1 exit status
make: *** [Makefile:62: ustreamer] Error 1

Thank you

mdevaev commented 5 years ago

Should be fine. run make clean and make again

lbr38 commented 5 years ago

Thanks, so here are some logs from ustreamer after 5sec of execution. I don't know if this will help. The thing is, timeout occurs randomly with mjpg_streamer, it can be after minutes or after 1hour of execution.. ustreamer will produce so much logs if I run it for so long. Do you need all the logs to debug ?

./ustreamer --device=/dev/video0  -r 1920x1080 -f 30 -m JPEG --debug
-- INFO  [293500.212 tid=419] -- Installing SIGINT handler ...
-- INFO  [293500.212 tid=419] -- Installing SIGTERM handler ...
-- INFO  [293500.212 tid=419] -- Ignoring SIGPIPE ...
-- INFO  [293500.213 tid=419] -- Using internal blank placeholder
-- DEBUG [293500.213 tid=419] -- Binding HTTP to [127.0.0.1]:8080 ...
-- INFO  [293500.213 tid=419] -- Listening HTTP on [127.0.0.1]:8080
-- INFO  [293500.214 tid=420] -- Using V4L2 device: /dev/video0
-- INFO  [293500.214 tid=421] -- Starting HTTP eventloop ...
-- INFO  [293500.214 tid=420] -- Using desired FPS: 30
-- DEBUG [293500.214 tid=420] -- _stream_init_loop: stream->proc->stop=0
================================================================================
-- DEBUG [293500.231 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.231 tid=421] -- HTTP: dropped same frame (BLANK) number 0
-- DEBUG [293500.249 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.250 tid=421] -- HTTP: dropped same frame (BLANK) number 1
-- DEBUG [293500.260 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.260 tid=421] -- HTTP: dropped same frame (BLANK) number 2
-- DEBUG [293500.277 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.277 tid=421] -- HTTP: dropped same frame (BLANK) number 3
-- INFO  [293500.297 tid=420] -- Device fd=8 opened
-- DEBUG [293500.298 tid=420] -- Calling ioctl(VIDIOC_QUERYCAP) ...
-- INFO  [293500.298 tid=420] -- Using input channel: 0
-- INFO  [293500.298 tid=420] -- Using TV standard: DEFAULT
-- DEBUG [293500.298 tid=420] -- Calling ioctl(VIDIOC_S_FMT) ...
-- DEBUG [293500.299 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.299 tid=421] -- HTTP: dropped same frame (BLANK) number 4
-- DEBUG [293500.309 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.309 tid=421] -- HTTP: dropped same frame (BLANK) number 5
-- DEBUG [293500.327 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.327 tid=421] -- HTTP: dropped same frame (BLANK) number 6
-- DEBUG [293500.349 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.349 tid=421] -- HTTP: dropped same frame (BLANK) number 7
-- INFO  [293500.352 tid=420] -- Using resolution: 1920x1080
-- INFO  [293500.352 tid=420] -- Using pixelformat: JPEG
-- DEBUG [293500.352 tid=420] -- Calling ioctl(VIDIOC_G_PARM) ...
-- DEBUG [293500.359 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.359 tid=421] -- HTTP: dropped same frame (BLANK) number 8
-- DEBUG [293500.376 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.376 tid=421] -- HTTP: dropped same frame (BLANK) number 9
-- DEBUG [293500.399 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- DEBUG [293500.409 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.409 tid=421] -- HTTP: dropped same frame (BLANK) number 0
-- DEBUG [293500.433 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.433 tid=421] -- HTTP: dropped same frame (BLANK) number 1
-- DEBUG [293500.447 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.447 tid=421] -- HTTP: dropped same frame (BLANK) number 2
-- DEBUG [293500.457 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.457 tid=421] -- HTTP: dropped same frame (BLANK) number 3
-- DEBUG [293500.481 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.481 tid=421] -- HTTP: dropped same frame (BLANK) number 4
-- DEBUG [293500.500 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.500 tid=421] -- HTTP: dropped same frame (BLANK) number 5
-- DEBUG [293500.510 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.510 tid=421] -- HTTP: dropped same frame (BLANK) number 6
-- DEBUG [293500.527 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.527 tid=421] -- HTTP: dropped same frame (BLANK) number 7
-- DEBUG [293500.549 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.549 tid=421] -- HTTP: dropped same frame (BLANK) number 8
-- DEBUG [293500.560 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.560 tid=421] -- HTTP: dropped same frame (BLANK) number 9
-- DEBUG [293500.577 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- DEBUG [293500.599 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.599 tid=421] -- HTTP: dropped same frame (BLANK) number 0
-- DEBUG [293500.609 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.609 tid=421] -- HTTP: dropped same frame (BLANK) number 1
-- DEBUG [293500.626 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.626 tid=421] -- HTTP: dropped same frame (BLANK) number 2
-- DEBUG [293500.649 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.649 tid=421] -- HTTP: dropped same frame (BLANK) number 3
-- DEBUG [293500.659 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.659 tid=421] -- HTTP: dropped same frame (BLANK) number 4
-- DEBUG [293500.683 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.683 tid=421] -- HTTP: dropped same frame (BLANK) number 5
-- DEBUG [293500.697 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.697 tid=421] -- HTTP: dropped same frame (BLANK) number 6
-- DEBUG [293500.707 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.707 tid=421] -- HTTP: dropped same frame (BLANK) number 7
-- DEBUG [293500.732 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.732 tid=421] -- HTTP: dropped same frame (BLANK) number 8
-- DEBUG [293500.750 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.750 tid=421] -- HTTP: dropped same frame (BLANK) number 9
-- DEBUG [293500.760 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- DEBUG [293500.777 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.777 tid=421] -- HTTP: dropped same frame (BLANK) number 0
-- DEBUG [293500.800 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.800 tid=421] -- HTTP: dropped same frame (BLANK) number 1
-- DEBUG [293500.810 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.810 tid=421] -- HTTP: dropped same frame (BLANK) number 2
-- DEBUG [293500.827 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.827 tid=421] -- HTTP: dropped same frame (BLANK) number 3
-- DEBUG [293500.849 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.849 tid=421] -- HTTP: dropped same frame (BLANK) number 4
-- DEBUG [293500.859 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.859 tid=421] -- HTTP: dropped same frame (BLANK) number 5
-- DEBUG [293500.876 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.877 tid=421] -- HTTP: dropped same frame (BLANK) number 6
-- DEBUG [293500.899 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.899 tid=421] -- HTTP: dropped same frame (BLANK) number 7
-- DEBUG [293500.909 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.909 tid=421] -- HTTP: dropped same frame (BLANK) number 8
-- DEBUG [293500.926 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.926 tid=421] -- HTTP: dropped same frame (BLANK) number 9
-- DEBUG [293500.949 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- DEBUG [293500.959 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.959 tid=421] -- HTTP: dropped same frame (BLANK) number 0
-- DEBUG [293500.983 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.983 tid=421] -- HTTP: dropped same frame (BLANK) number 1
-- DEBUG [293500.997 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293500.997 tid=421] -- HTTP: dropped same frame (BLANK) number 2
-- DEBUG [293501.007 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.007 tid=421] -- HTTP: dropped same frame (BLANK) number 3
-- DEBUG [293501.031 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.031 tid=421] -- HTTP: dropped same frame (BLANK) number 4
-- DEBUG [293501.050 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.050 tid=421] -- HTTP: dropped same frame (BLANK) number 5
-- DEBUG [293501.060 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.060 tid=421] -- HTTP: dropped same frame (BLANK) number 6
-- INFO  [293501.064 tid=420] -- Using HW FPS: 30
-- DEBUG [293501.064 tid=420] -- Calling ioctl(VIDIOC_REQBUFS) ...
-- DEBUG [293501.077 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.077 tid=421] -- HTTP: dropped same frame (BLANK) number 7
-- INFO  [293501.087 tid=420] -- Requested 5 HW buffers, got 5
-- DEBUG [293501.087 tid=420] -- Allocating HW buffers ...
-- DEBUG [293501.087 tid=420] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 0 ...
-- DEBUG [293501.087 tid=420] -- Mapping device buffer 0 ...
-- DEBUG [293501.089 tid=420] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 1 ...
-- DEBUG [293501.089 tid=420] -- Mapping device buffer 1 ...
-- DEBUG [293501.090 tid=420] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 2 ...
-- DEBUG [293501.090 tid=420] -- Mapping device buffer 2 ...
-- DEBUG [293501.091 tid=420] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 3 ...
-- DEBUG [293501.092 tid=420] -- Mapping device buffer 3 ...
-- DEBUG [293501.093 tid=420] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 4 ...
-- DEBUG [293501.093 tid=420] -- Mapping device buffer 4 ...
-- DEBUG [293501.094 tid=420] -- Calling ioctl(VIDIOC_QBUF) for buffer 0 ...
-- DEBUG [293501.094 tid=420] -- Calling ioctl(VIDIOC_QBUF) for buffer 1 ...
-- DEBUG [293501.094 tid=420] -- Calling ioctl(VIDIOC_QBUF) for buffer 2 ...
-- DEBUG [293501.094 tid=420] -- Calling ioctl(VIDIOC_QBUF) for buffer 3 ...
-- DEBUG [293501.094 tid=420] -- Calling ioctl(VIDIOC_QBUF) for buffer 4 ...
-- DEBUG [293501.095 tid=420] -- Allocating picture buffers ...
-- DEBUG [293501.095 tid=420] -- Allocating picture buffer 0 sized 8294400 bytes... 
-- DEBUG [293501.095 tid=420] -- Allocating picture buffer 1 sized 8294400 bytes... 
-- DEBUG [293501.095 tid=420] -- Allocating picture buffer 2 sized 8294400 bytes... 
-- DEBUG [293501.095 tid=420] -- Allocating picture buffer 3 sized 8294400 bytes... 
-- DEBUG [293501.095 tid=420] -- Allocating picture buffer 4 sized 8294400 bytes... 
-- DEBUG [293501.095 tid=420] -- Device fd=8 initialized
-- DEBUG [293501.095 tid=420] -- Calling ioctl(VIDIOC_STREAMON) ...
-- DEBUG [293501.100 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.100 tid=421] -- HTTP: dropped same frame (BLANK) number 8
-- DEBUG [293501.110 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.110 tid=421] -- HTTP: dropped same frame (BLANK) number 9
-- DEBUG [293501.127 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- DEBUG [293501.149 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.149 tid=421] -- HTTP: dropped same frame (BLANK) number 0
-- DEBUG [293501.160 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.160 tid=421] -- HTTP: dropped same frame (BLANK) number 1
-- INFO  [293501.169 tid=420] -- Capturing started
-- INFO  [293501.169 tid=420] -- Switching to HW encoder because the input format is (M)JPEG
-- ERROR [293501.169 tid=420] -- Can't query HW encoder params and set quality (unsupported)
-- INFO  [293501.169 tid=420] -- Using JPEG quality: encoder default
-- INFO  [293501.169 tid=420] -- Creating pool with 1 workers ...
-- DEBUG [293501.170 tid=420] -- Allocation memory for stream picture ...
-- DEBUG [293501.170 tid=422] -- Hello! I am a worker #0 ^_^
-- DEBUG [293501.170 tid=422] -- Worker 0 waiting for a new job ...
-- INFO  [293501.170 tid=420] -- Capturing ...
--------------------------------------------------------------------------------
-- DEBUG [293501.170 tid=420] -- Waiting for worker ...
-- PERF  [293501.170 tid=420] -- ----- Encoded picture dropped; worker=0
-- DEBUG [293501.170 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.177 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.177 tid=421] -- HTTP: dropped same frame (BLANK) number 2
-- DEBUG [293501.199 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.199 tid=421] -- HTTP: dropped same frame (BLANK) number 3
-- DEBUG [293501.209 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.209 tid=421] -- HTTP: dropped same frame (BLANK) number 4
-- DEBUG [293501.227 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.227 tid=421] -- HTTP: dropped same frame (BLANK) number 5
-- DEBUG [293501.249 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.249 tid=421] -- HTTP: dropped same frame (BLANK) number 6
-- DEBUG [293501.259 tid=421] -- Refreshing HTTP exposed (BLANK) ...
-- PERF  [293501.259 tid=421] -- HTTP: dropped same frame (BLANK) number 7
-- DEBUG [293501.265 tid=420] -- Device select() --> 1
-- DEBUG [293501.266 tid=420] -- Frame is ready
-- DEBUG [293501.266 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.266 tid=420] -- Got a new frame in buffer: index=0, bytesused=45984
-- PERF  [293501.266 tid=420] -- A new second has come; captured_fps=0
-- VERB  [293501.266 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.000)
-- VERB  [293501.266 tid=420] -- Fluency: delay=0.000, grab_after=293501.266
-- DEBUG [293501.266 tid=420] -- Assigned new frame in buffer 0 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.266 tid=420] -- Waiting for worker ...
-- DEBUG [293501.266 tid=422] -- Worker 0 compressing JPEG from buffer 0 ...
-- DEBUG [293501.267 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.267 tid=422] -- Compressed new JPEG: size=45984, time=0.001, worker=0, buffer=0
-- DEBUG [293501.267 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.267 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.267 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.276 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.277 tid=421] -- HTTP: exposed new frame; full exposition time =  0.001000
-- DEBUG [293501.297 tid=420] -- Device select() --> 1
-- DEBUG [293501.298 tid=420] -- Frame is ready
-- DEBUG [293501.298 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.298 tid=420] -- Got a new frame in buffer: index=1, bytesused=50472
-- VERB  [293501.298 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.298 tid=420] -- Fluency: delay=0.033, grab_after=293501.331
-- DEBUG [293501.298 tid=420] -- Assigned new frame in buffer 1 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.298 tid=420] -- Waiting for worker ...
-- DEBUG [293501.298 tid=422] -- Worker 0 compressing JPEG from buffer 1 ...
-- DEBUG [293501.299 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.299 tid=422] -- Compressed new JPEG: size=50472, time=0.001, worker=0, buffer=1
-- DEBUG [293501.299 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.299 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.299 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.299 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.299 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.330 tid=420] -- Device select() --> 1
-- DEBUG [293501.330 tid=420] -- Frame is ready
-- DEBUG [293501.330 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.330 tid=420] -- Got a new frame in buffer: index=2, bytesused=50680
-- VERB  [293501.330 tid=420] -- Passed 1 frames for fluency: now=293501.330, grab_after=293501.331
-- DEBUG [293501.330 tid=420] -- Calling ioctl(VIDIOC_QBUF) ...
--------------------------------------------------------------------------------
-- DEBUG [293501.330 tid=420] -- Waiting for worker ...
-- PERF  [293501.330 tid=420] -- ----- Encoded picture dropped; worker=0
-- DEBUG [293501.330 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.365 tid=420] -- Device select() --> 1
-- DEBUG [293501.366 tid=420] -- Frame is ready
-- DEBUG [293501.366 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.366 tid=420] -- Got a new frame in buffer: index=3, bytesused=46504
-- VERB  [293501.366 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.366 tid=420] -- Fluency: delay=0.033, grab_after=293501.399
-- DEBUG [293501.366 tid=420] -- Assigned new frame in buffer 3 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.366 tid=420] -- Waiting for worker ...
-- DEBUG [293501.366 tid=422] -- Worker 0 compressing JPEG from buffer 3 ...
-- DEBUG [293501.367 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.367 tid=422] -- Compressed new JPEG: size=46504, time=0.001, worker=0, buffer=3
-- DEBUG [293501.367 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.367 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.367 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.383 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.383 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.397 tid=420] -- Device select() --> 1
-- DEBUG [293501.398 tid=420] -- Frame is ready
-- DEBUG [293501.398 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.398 tid=420] -- Got a new frame in buffer: index=4, bytesused=46608
-- VERB  [293501.398 tid=420] -- Passed 1 frames for fluency: now=293501.398, grab_after=293501.399
-- DEBUG [293501.398 tid=420] -- Calling ioctl(VIDIOC_QBUF) ...
--------------------------------------------------------------------------------
-- DEBUG [293501.398 tid=420] -- Waiting for worker ...
-- PERF  [293501.398 tid=420] -- ----- Encoded picture dropped; worker=0
-- DEBUG [293501.398 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.433 tid=420] -- Device select() --> 1
-- DEBUG [293501.434 tid=420] -- Frame is ready
-- DEBUG [293501.434 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.434 tid=420] -- Got a new frame in buffer: index=0, bytesused=131984
-- VERB  [293501.434 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.434 tid=420] -- Fluency: delay=0.033, grab_after=293501.467
-- DEBUG [293501.434 tid=420] -- Assigned new frame in buffer 0 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.434 tid=420] -- Waiting for worker ...
-- DEBUG [293501.434 tid=422] -- Worker 0 compressing JPEG from buffer 0 ...
-- DEBUG [293501.435 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.435 tid=422] -- Compressed new JPEG: size=131984, time=0.001, worker=0, buffer=0
-- DEBUG [293501.435 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.435 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.435 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.450 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.450 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.466 tid=420] -- Device select() --> 1
-- DEBUG [293501.466 tid=420] -- Frame is ready
-- DEBUG [293501.466 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.466 tid=420] -- Got a new frame in buffer: index=1, bytesused=162208
-- VERB  [293501.466 tid=420] -- Passed 1 frames for fluency: now=293501.466, grab_after=293501.467
-- DEBUG [293501.466 tid=420] -- Calling ioctl(VIDIOC_QBUF) ...
--------------------------------------------------------------------------------
-- DEBUG [293501.466 tid=420] -- Waiting for worker ...
-- PERF  [293501.466 tid=420] -- ----- Encoded picture dropped; worker=0
-- DEBUG [293501.466 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.498 tid=420] -- Device select() --> 1
-- DEBUG [293501.498 tid=420] -- Frame is ready
-- DEBUG [293501.498 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.498 tid=420] -- Got a new frame in buffer: index=2, bytesused=161744
-- VERB  [293501.498 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.498 tid=420] -- Fluency: delay=0.033, grab_after=293501.531
-- DEBUG [293501.498 tid=420] -- Assigned new frame in buffer 2 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.498 tid=420] -- Waiting for worker ...
-- DEBUG [293501.499 tid=422] -- Worker 0 compressing JPEG from buffer 2 ...
-- DEBUG [293501.499 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.499 tid=422] -- Compressed new JPEG: size=161744, time=0.000, worker=0, buffer=2
-- DEBUG [293501.499 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.500 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.500 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.500 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.500 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.533 tid=420] -- Device select() --> 1
-- DEBUG [293501.534 tid=420] -- Frame is ready
-- DEBUG [293501.534 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.534 tid=420] -- Got a new frame in buffer: index=3, bytesused=162808
-- VERB  [293501.534 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.000)
-- VERB  [293501.534 tid=420] -- Fluency: delay=0.033, grab_after=293501.567
-- DEBUG [293501.534 tid=420] -- Assigned new frame in buffer 3 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.534 tid=420] -- Waiting for worker ...
-- DEBUG [293501.534 tid=422] -- Worker 0 compressing JPEG from buffer 3 ...
-- DEBUG [293501.535 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.535 tid=422] -- Compressed new JPEG: size=162808, time=0.001, worker=0, buffer=3
-- DEBUG [293501.535 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.535 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.535 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.550 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.550 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.573 tid=420] -- Device select() --> 1
-- DEBUG [293501.574 tid=420] -- Frame is ready
-- DEBUG [293501.574 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.574 tid=420] -- Got a new frame in buffer: index=4, bytesused=205424
-- VERB  [293501.574 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.574 tid=420] -- Fluency: delay=0.033, grab_after=293501.607
-- DEBUG [293501.574 tid=420] -- Assigned new frame in buffer 4 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.574 tid=420] -- Waiting for worker ...
-- DEBUG [293501.574 tid=422] -- Worker 0 compressing JPEG from buffer 4 ...
-- DEBUG [293501.575 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.575 tid=422] -- Compressed new JPEG: size=205424, time=0.001, worker=0, buffer=4
-- DEBUG [293501.575 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.576 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.576 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.577 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.578 tid=421] -- HTTP: exposed new frame; full exposition time =  0.001000
-- DEBUG [293501.613 tid=420] -- Device select() --> 1
-- DEBUG [293501.614 tid=420] -- Frame is ready
-- DEBUG [293501.614 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.614 tid=420] -- Got a new frame in buffer: index=0, bytesused=206000
-- VERB  [293501.614 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.614 tid=420] -- Fluency: delay=0.033, grab_after=293501.647
-- DEBUG [293501.614 tid=420] -- Assigned new frame in buffer 0 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.614 tid=420] -- Waiting for worker ...
-- DEBUG [293501.614 tid=422] -- Worker 0 compressing JPEG from buffer 0 ...
-- DEBUG [293501.615 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.615 tid=422] -- Compressed new JPEG: size=206000, time=0.001, worker=0, buffer=0
-- DEBUG [293501.615 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.615 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.615 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.627 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.628 tid=421] -- HTTP: exposed new frame; full exposition time =  0.001000
-- DEBUG [293501.653 tid=420] -- Device select() --> 1
-- DEBUG [293501.654 tid=420] -- Frame is ready
-- DEBUG [293501.654 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.654 tid=420] -- Got a new frame in buffer: index=1, bytesused=212688
-- VERB  [293501.654 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.001)
-- VERB  [293501.654 tid=420] -- Fluency: delay=0.033, grab_after=293501.687
-- DEBUG [293501.654 tid=420] -- Assigned new frame in buffer 1 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.654 tid=420] -- Waiting for worker ...
-- DEBUG [293501.654 tid=422] -- Worker 0 compressing JPEG from buffer 1 ...
-- DEBUG [293501.655 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.655 tid=422] -- Compressed new JPEG: size=212688, time=0.001, worker=0, buffer=1
-- DEBUG [293501.655 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.656 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.656 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.660 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.660 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.702 tid=420] -- Device select() --> 1
-- DEBUG [293501.702 tid=420] -- Frame is ready
-- DEBUG [293501.702 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.702 tid=420] -- Got a new frame in buffer: index=2, bytesused=223768
-- VERB  [293501.702 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.001 (last_comp_time=0.001)
-- VERB  [293501.702 tid=420] -- Fluency: delay=0.033, grab_after=293501.735
-- DEBUG [293501.702 tid=420] -- Assigned new frame in buffer 2 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.702 tid=420] -- Waiting for worker ...
-- DEBUG [293501.703 tid=422] -- Worker 0 compressing JPEG from buffer 2 ...
-- DEBUG [293501.703 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.703 tid=422] -- Compressed new JPEG: size=223768, time=0.000, worker=0, buffer=2
-- DEBUG [293501.703 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.704 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.704 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.710 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.710 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.754 tid=420] -- Device select() --> 1
-- DEBUG [293501.754 tid=420] -- Frame is ready
-- DEBUG [293501.754 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.754 tid=420] -- Got a new frame in buffer: index=3, bytesused=223776
-- VERB  [293501.754 tid=420] -- Correcting approx_comp_time: 0.001 -> 0.000 (last_comp_time=0.000)
-- VERB  [293501.754 tid=420] -- Fluency: delay=0.033, grab_after=293501.787
-- DEBUG [293501.754 tid=420] -- Assigned new frame in buffer 3 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.754 tid=420] -- Waiting for worker ...
-- DEBUG [293501.754 tid=422] -- Worker 0 compressing JPEG from buffer 3 ...
-- DEBUG [293501.755 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.755 tid=422] -- Compressed new JPEG: size=223776, time=0.001, worker=0, buffer=3
-- DEBUG [293501.755 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.755 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.756 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.760 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.760 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.802 tid=420] -- Device select() --> 1
-- DEBUG [293501.802 tid=420] -- Frame is ready
-- DEBUG [293501.802 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.802 tid=420] -- Got a new frame in buffer: index=4, bytesused=223744
-- VERB  [293501.802 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.001 (last_comp_time=0.001)
-- VERB  [293501.802 tid=420] -- Fluency: delay=0.033, grab_after=293501.835
-- DEBUG [293501.802 tid=420] -- Assigned new frame in buffer 4 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.803 tid=420] -- Waiting for worker ...
-- DEBUG [293501.803 tid=422] -- Worker 0 compressing JPEG from buffer 4 ...
-- DEBUG [293501.803 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.803 tid=422] -- Compressed new JPEG: size=223744, time=0.000, worker=0, buffer=4
-- DEBUG [293501.803 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.803 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.804 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.810 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.810 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.854 tid=420] -- Device select() --> 1
-- DEBUG [293501.854 tid=420] -- Frame is ready
-- DEBUG [293501.854 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.854 tid=420] -- Got a new frame in buffer: index=0, bytesused=224232
-- VERB  [293501.854 tid=420] -- Correcting approx_comp_time: 0.001 -> 0.000 (last_comp_time=0.000)
-- VERB  [293501.854 tid=420] -- Fluency: delay=0.033, grab_after=293501.887
-- DEBUG [293501.854 tid=420] -- Assigned new frame in buffer 0 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.854 tid=420] -- Waiting for worker ...
-- DEBUG [293501.854 tid=422] -- Worker 0 compressing JPEG from buffer 0 ...
-- DEBUG [293501.855 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.855 tid=422] -- Compressed new JPEG: size=224232, time=0.001, worker=0, buffer=0
-- DEBUG [293501.855 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.855 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.855 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.860 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.860 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293501.902 tid=420] -- Device select() --> 1
-- DEBUG [293501.902 tid=420] -- Frame is ready
-- DEBUG [293501.902 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.902 tid=420] -- Got a new frame in buffer: index=1, bytesused=224744
-- VERB  [293501.902 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.001 (last_comp_time=0.001)
-- VERB  [293501.902 tid=420] -- Fluency: delay=0.033, grab_after=293501.935
-- DEBUG [293501.902 tid=420] -- Assigned new frame in buffer 1 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.903 tid=420] -- Waiting for worker ...
-- DEBUG [293501.903 tid=422] -- Worker 0 compressing JPEG from buffer 1 ...
-- DEBUG [293501.903 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.903 tid=422] -- Compressed new JPEG: size=224744, time=0.000, worker=0, buffer=1
-- DEBUG [293501.903 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.903 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.904 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.909 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.910 tid=421] -- HTTP: exposed new frame; full exposition time =  0.001000
-- DEBUG [293501.954 tid=420] -- Device select() --> 1
-- DEBUG [293501.954 tid=420] -- Frame is ready
-- DEBUG [293501.954 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293501.954 tid=420] -- Got a new frame in buffer: index=2, bytesused=224152
-- VERB  [293501.954 tid=420] -- Correcting approx_comp_time: 0.001 -> 0.000 (last_comp_time=0.000)
-- VERB  [293501.954 tid=420] -- Fluency: delay=0.033, grab_after=293501.987
-- DEBUG [293501.954 tid=420] -- Assigned new frame in buffer 2 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293501.954 tid=420] -- Waiting for worker ...
-- DEBUG [293501.954 tid=422] -- Worker 0 compressing JPEG from buffer 2 ...
-- DEBUG [293501.955 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293501.955 tid=422] -- Compressed new JPEG: size=224152, time=0.000, worker=0, buffer=2
-- DEBUG [293501.955 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293501.955 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293501.955 tid=420] -- Calling select() on video device ...
-- DEBUG [293501.959 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293501.960 tid=421] -- HTTP: exposed new frame; full exposition time =  0.001000
-- DEBUG [293502.002 tid=420] -- Device select() --> 1
-- DEBUG [293502.002 tid=420] -- Frame is ready
-- DEBUG [293502.002 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293502.002 tid=420] -- Got a new frame in buffer: index=3, bytesused=225160
-- PERF  [293502.002 tid=420] -- A new second has come; captured_fps=15
-- VERB  [293502.002 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.000)
-- VERB  [293502.002 tid=420] -- Fluency: delay=0.033, grab_after=293502.035
-- DEBUG [293502.002 tid=420] -- Assigned new frame in buffer 3 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293502.003 tid=420] -- Waiting for worker ...
-- DEBUG [293502.003 tid=422] -- Worker 0 compressing JPEG from buffer 3 ...
-- DEBUG [293502.003 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293502.003 tid=422] -- Compressed new JPEG: size=225160, time=0.000, worker=0, buffer=3
-- DEBUG [293502.003 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293502.004 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293502.004 tid=420] -- Calling select() on video device ...
-- DEBUG [293502.009 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293502.009 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293502.054 tid=420] -- Device select() --> 1
-- DEBUG [293502.054 tid=420] -- Frame is ready
-- DEBUG [293502.054 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293502.054 tid=420] -- Got a new frame in buffer: index=4, bytesused=223608
-- VERB  [293502.054 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.000)
-- VERB  [293502.054 tid=420] -- Fluency: delay=0.033, grab_after=293502.087
-- DEBUG [293502.054 tid=420] -- Assigned new frame in buffer 4 to worker 0
--------------------------------------------------------------------------------
-- DEBUG [293502.054 tid=420] -- Waiting for worker ...
-- DEBUG [293502.054 tid=422] -- Worker 0 compressing JPEG from buffer 4 ...
-- DEBUG [293502.055 tid=422] -- Calling ioctl(VIDIOC_QBUF) ...
-- VERB  [293502.055 tid=422] -- Compressed new JPEG: size=223608, time=0.000, worker=0, buffer=4
-- DEBUG [293502.055 tid=422] -- Worker 0 waiting for a new job ...
-- PERF  [293502.055 tid=420] -- ##### Encoded picture exposed; worker=0
-- DEBUG [293502.055 tid=420] -- Calling select() on video device ...
-- DEBUG [293502.059 tid=421] -- Refreshing HTTP exposed ...
-- VERB  [293502.059 tid=421] -- HTTP: exposed new frame; full exposition time =  0.000000
-- DEBUG [293502.105 tid=420] -- Device select() --> 1
-- DEBUG [293502.106 tid=420] -- Frame is ready
-- DEBUG [293502.106 tid=420] -- Calling ioctl(VIDIOC_DQBUF) ...
-- DEBUG [293502.106 tid=420] -- Got a new frame in buffer: index=0, bytesused=224832
-- VERB  [293502.106 tid=420] -- Correcting approx_comp_time: 0.000 -> 0.000 (last_comp_time=0.000)
-- VERB  [293502.106 tid=420] -- Fluency: delay=0.033, grab_after=293502.139
-- DEBUG [293502.106 tid=420] -- Assigned new frame in buffer 0 to worker 0
-- DEBUG [293502.106 tid=422] -- Worker 0 compressing JPEG from buffer 0 ...
--------------------------------------------------------------------------------

Also here are informations of my camera device :

v4l-info /dev/video0

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
    driver                  : "uvcvideo"
    card                    : "USB 2.0 Camera: HD USB Camera"
    bus_info                : "usb-3f980000.usb-1.1.3"
    version                 : 4.19.66
    capabilities            : 0x84a00001 [VIDEO_CAPTURE,?,?,STREAMING,(null)]

standards

inputs
    VIDIOC_ENUMINPUT(0)
    index                   : 0
    name                    : "Camera 1"
    type                    : CAMERA
    audioset                : 0
    tuner                   : 0
    std                     : 0x0 []
    status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
    index                   : 0
    type                    : VIDEO_CAPTURE
    flags                   : 1
    description             : "Motion-JPEG"
    pixelformat             : 0x47504a4d [MJPG]
    VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
    index                   : 1
    type                    : VIDEO_CAPTURE
    flags                   : 0
    description             : "YUYV 4:2:2"
    pixelformat             : 0x56595559 [YUYV]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
    type                    : VIDEO_CAPTURE
    fmt.pix.width           : 1920
    fmt.pix.height          : 1080
    fmt.pix.pixelformat     : 0x47504a4d [MJPG]
    fmt.pix.field           : NONE
    fmt.pix.bytesperline    : 0
    fmt.pix.sizeimage       : 4147789
    fmt.pix.colorspace      : SRGB
    fmt.pix.priv            : 4276996862
mdevaev commented 5 years ago

timeout occurs randomly

It changes everything!

@jacksonliam I have an idea. In some cases, a timeout is not a fatal failure. You could add an option that would enable behavior in which the device will be reinitialized during a timeout or other error. This is not the fault of my patch. I investigated this question - without my patch mjpg_streamer simplye hangs in this case.

@lbr38 ustreamer correctly handles such situations and automatically restarts the stream on error or timeout. You can use it for your purposes if you want. If you have problems or questions, you can create an issue in my repository.

lbr38 commented 5 years ago

Okay I guess I will use ustreamer as you suggested, but will need some help to set up the http server. I'll open a new issue in your repository.

Thank you for all

jacksonliam commented 5 years ago

timeout occurs randomly

It changes everything!

@jacksonliam I have an idea. In some cases, a timeout is not a fatal failure. You could add an option that would enable behavior in which the device will be reinitialized during a timeout or other error. This is not the fault of my patch. I investigated this question - without my patch mjpg_streamer simplye hangs in this case.

Thanks, a ll think about making a change in this area, do you have to re-init everything or just carry on with more selects?

mdevaev commented 5 years ago

I think you can re-init only v4l2 code. I.e. close device, open again and etc.

https://github.com/pikvm/ustreamer/blob/master/src/stream.c#L128

dstulken commented 5 years ago

Thanks, a ll think about making a change in this area

@jacksonliam, in a general sense, you might also consider a second parallel option to have mjpg-streamer terminate on errors like this. From a user perspective, this select() timeout is a frustrating issue, as the server side happily continues running... so camera systems silently fail, yet the host doesn't have the ability to recover. If mjpg-streamer had exited on the failure, it would have been possible to wrap the command in a script to auto-restart, providing an additional layer of fault recovery possibility.

That's not to say that this issue shouldn't be patched by restarting the input component within mjpg-streamer, as that is clearly the better solution. But for general runtime faults with the camera inputs, continuing to run isn't necessarily always helpful, even if it is possible to continue.

Thanks for looking into this!

madscientist159 commented 4 years ago

@mdevaev Thanks for the pointer to ustreamer! So far it's completely stopped our constant random streamer lockups on multi-camera systems.

koba1995 commented 4 years ago

I also have similar problem. I'm using raspberrypi 2B+ and two same type cameras. I added systemd script for executing on boot and restart on failure. Every time, 1 of 2 fails("select() timeout" message and no stream output), but the program keep running, so it's not restarted. Manual restart always succeeds. The root cause doesn't seem to be in mjpg_streamer.

However, there is a problem that mjpg_streamer keeps running after some error occured in input_uvc. I tryed fixing only this point. b68606bfdd10fcdbcc05d9aa65b0b6101c900f18

ddacunha commented 3 years ago

I had a select() timeout on my Raspberry Pi 4 until I increased the gpu_mem from gpu_mem=128 to gpu_mem=256 in /boot/config.txt.

reversefold commented 2 years ago

Having the same problem. I have two webcams (one Logitech, one Razer). If I have both plugged into the same Raspberry Pi then either one will work fine if mjpg-streamer is started first for that camera. When mjpg-streamer is started for the second camera I never get an image and it ends up in select() timeout.

I have tried increasing gpu_mem to 256 with no effect. I have tried increasing the timeout with no effect. I have tried decreasing the frame rate and resolution with no effect. The first started always works and the second started always times out, with the first still working fine.

jacksonliam commented 2 years ago

Definitely got enough power for the pi and both cameras?

Assume this is running multiple instances of mjpg-streamer? Is the issue the same if you run two input plugins under one mjpg steamer?

Select timeouts is usually the OS / v4l2 not returning a frame, it's not usually an mjpg-streamer issue.

James4Ever0 commented 5 days ago

https://github.com/pikvm/ustreamer/issues/284

James4Ever0 commented 5 days ago

Running dmesg | egrep 'tc35|1-1.4|uvc' I get:

uvcvideo 1-1.5:1.1: Non-zero status (-71) in video completion handler.
James4Ever0 commented 5 days ago

Maybe you're right and the problem somewhere in the kernel. Try to use other mjpg program with your cameras, for example my https://github.com/pi-kvm/ustreamer. If the problem persists, then it is probably in the kernel.

This is not true. I use OBS and everything is fine. After switching to ustreamer or mjpeg-streamer everything is a mess. All I can say is that OBS handles some magic while all other libraries are just doing way wrong.

I would think of v4l2 loopback in OBS, to workaround this issue.

James4Ever0 commented 5 days ago

I am afraid I have found the solution. Turned out pretty simple. It is to reset the USB HDMI capture device every time the line CAP: Device select() timeout shows up (timing is important). One can write a script to achieve this if running under Docker.

First, locate your USB device by lsusb:

Bus xxx Device xxx: ID <idVendor>:<idProduct> xxx (capture card name)

Next, use the above information to fill in the following Python code:

On Ubuntu, this usb library is installable via apt install python3-usb

import usb.core

from usb.core import find as finddev

dev = finddev(idVendor=0x<idVendor> idProduct=0x<idProduct>)
dev.reset()

Finally, initiate the streamer. When any error shows up, execute this script exactly once, manually. You will see the issue has been fixed immediately.

I believe there is a lot more to do in PiKVM for fixing this issue. But it could be rather simple. I would recommend setting a back-off period at 1 minute for running this Python script, to avoid frequently resetting the USB device.