OpenWrt Forum Archive

Topic: White screen with mjpg-streamer

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Heey all,

I've been working a few days now on getting my webcam to work, and it should be working, but I just get a white screen.

My info.

Webcam(s):     Different basic cams, being installed in windows as: USB 2.0 Camera
Router:            Netgear wndr3700 with OpenWrt Barrier Breaker 14.07
Steps done:      http://wiki.openwrt.org/doc/howto/webcam & http://wiki.openwrt.org/doc/howto/usb.video
                        Also installed more opkg drivers to be sure.


What happens:

- Plug in the webcam and gets recognized:

Fri Mar 20 22:22:12 2015 kern.info kernel: [ 3314.960000] usb 1-1: new high-speed USB device number 8 using ehci-platform
Fri Mar 20 22:22:13 2015 kern.info kernel: [ 3315.120000] uvcvideo: Found UVC 1.00 device USB 2.0 PC Cam (090c:71b3)
Fri Mar 20 22:22:13 2015 kern.info kernel: [ 3315.130000] input: USB 2.0 PC Cam as /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/input/input5

-  /dev/video0 is being created

- I give the command:

mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480" -o "output_http.so -p 8080 -w /www/webcam"&

- In processes It's verified:

2562  root   mjpg_streamer -i input_uvc.so -d /dev/video0 -r 640x480 -o output_http.so -p 8080 -w /www/webcam  25%  16%

- I go to my routers ip: http://192.168.0.3:8080 with google chrome

The page changes to: MJPG-Streamer - Stream Example and is loaded but completly white
When I open it in IE I get a small icon where the image should be.

I also killed the streamer and the website doesn't work anymore, so mjpeg_streamer works.
The drivers work, because it gets recognized.
The command is typed in correctly, no mistakes
Only thing is that I don't see any images placed in www/webcam folder

What is the problem here???

(Last edited by trnase on 21 Mar 2015, 21:49)

Sounds like it's working for the most part. Are you able up try out another Webcam to see if it's perhaps an issue of the Webcam itself?

You can try http://192.168.0.3:8080/?action=snapshot to get just a still JPG image with no web page or frames around it.  This should be compatible with any browser.

If you cover the lens, does it go to all black?  This may be that the exposure is not set correctly.  I have one camera that goes all white when the light is too bright, such as pointing it out a window while the sun is out.

(Last edited by mk24 on 22 Mar 2015, 00:30)

I also tried that a few times but without effect. Should you see any webcam frames in the mainlink?

The Webcam itseld shows a normal image when connected to pc. Also there is no image on the side to right click on. it seems like there isn't an image captured.

Does your webcam work with fswebcam?

I installed it.
then typed:
fswebcam -d /dev/video0 /tmp/output.jpeg
and I DO get a picture clearly, so it is capturing.. big_smile

But how to get it to work with mjpeg player, I did install it all over again and without any extras

reset router
loged in
opkg update
opkg install kmod-video-uvc mjpg-streamer
reboot

plugged in cam.
checked if it was recognized

mjpg_streamer -i "input_uvc.so -d /dev/video0" -o "output_http.so -p 8080 -w /www/webcam"

When going to: http://IPADRESS:8080/webcam    it says: 400: Not Found! No file extension found
When going to: http://IPADRESS:8080/                the page gets the name MJPG-Streamer, but is still completly white.

Is it possible it saves the images on a different location and that's why I don't see nothing?

I've installed an older version of openwrt and tested it out, now I got the Unable to set format: invalid argument  error.
I put the -Y in the input mode to change it to yuv format and it works suddenly.

To bad I can't use mjpeg because my cpu load is high.

My goals is actually to just use the router for connecting webcam's and taking a still image, then having a server getting these files and stream them. So the server can do the converting. Is there a way to do that, for example with fswebcam?



Was looking around and I think that usbip is more the thing that I need to have. Working on that now.

(Last edited by trnase on 24 Mar 2015, 15:34)

trnase wrote:

My goals is actually to just use the router for connecting webcam's and taking a still image

I'm doing just that with 15 webcams attached to a DIR-505, taking one picture every 10mins with fswebcam (15webcams need time...). With only one cam attached, you can take a picture every minute.

What intervall do you have in mind?

I am planning to hang cameras outside and about 2-3 inside, i tried extending the usb wires with cat cables. problem is that the distance is to much and they aren't recognized anymore.

I don't need like 20fps but at least 3-4fps will be enough, and even 3-4fps with 4 cams will be to much cpuload

So I was looking for a usb extender, and a router is the easiest option. So I'm going to hang a router where I want the cams, use a cat cable to give ethernet signal and power (share the cable wires, so I don't need to be blose to a powersocket)

And I found a second wndr3700 router for just 5 euro secondhand big_smile, so I can also connect it wireless with my internal network for more flexibility.

Then using a hub I will plug in 4 cams and then use usbib-protocol to forward these to a server to stream it.

mjpg-streamer was already doing that, and would be a fun option if the cams ware mjpeg supported. but with 1 cam on yuv it went to 80% straight away.

Be aware: Even with webcams that support mjpeg, you might run out of USB bandwidth when connecting multiple cams to your router, e.g. Logitech C270 -> impossible to stream two C270 simultaneously on the same USB. Some webcams behave nice in regards to bandwidth, others behave nasty.

I tried it yesterday and when I used webcamxp to get the second stream from a uspip camera it disonnected in the command interface. When i switch there is not a problem. So i think you're right with the maximum bandwith issue.

Perhaps forcing them to use a 1.1 usb method so they will use less bandwith? Is it possible to lower the bandwith of the connected devices to get it work.

I really think it's a weird issue that nowadays there is no such thing as a extended usb device that works normally. Especially because usb stuff is easy to control/setup/change/add to routers.

Some more detailed info on bandwidth from my own notes:

==== USB bandwidth ====

When streaming multiple webcams simultaneously (e.g. with mjpg_streamer), you have to keep in mind, that the bandwidth of your USB is limited to 480mbit/s (or more strict: 80% of 480 = 384mbit/s). This can become a problem, if you exceed the bandwidth-limit
  * by too high resolution of your streams -> lower the resolution of at least one cam
  * by nasty cams that even at comparably low resolutions like 800x600 request the max bandwith (e.g. C270) -> take at least one different (=not "nasty") cam

When this happens, you will most likely get an error message from mjpg_streamer like "no space left on device".

To get the bandwidth the camera requires, search ''lsusb -v'' for

   wWidth                  640
   wHeight                 480
   dwMinBitRate       24576000
   dwMaxBitRate      147456000

   wWidth                  800
   wHeight                 600
   dwMinBitRate       38400000
   dwMaxBitRate      230400000

Note: Same values for C270 and Pro 9000!

Alternatively, look at ''/sys/kernel/debug/usb/devices'' and search for something like ''B:  Alloc=485/800 us (61%)'' while the camera is connected and transmitting video.

Example:

  * Pro 9000 = not nasty = requests less than max. bandwidth of 230,4mbit/s @ 800x600
  * C270 = nasty = always requests max. bandwidth of 230,4mbit/s @ 800x600

  * 2x Pro 9000 + 1x C270 @ 800x600 -> works
  * 0x Pro 9000 + 2x C270 @ 800x600 -> doesn't work; Error: **no space left on device**, since 2x 230,4mbit/s > 384mbit/s
  * 0x Pro 9000 + 2x C270 @ 640x480 -> works

trnase wrote:

Perhaps forcing them to use a 1.1 usb method so they will use less bandwith?

Streaming pictures @$yourchosenresolution results in a certain bandwidth requirement (see my previous posting).

If you want to lessen bandwidth requirements, then lessen your requirements to the resolution of the streamed pictures.

EDIT: Disregard my post below. I got my webcam working. It was just an issue that I had to actually set the FPS config to 30, where the default was 5. Funny thing is that I probably get 5 now that it's set to 30!

--

I suspect I may be having a similar problem, and I've found at least one reported bug against mjpg-streamer which is similar.

My webcam can capture images with fswebcam just fine, but mjpg-streamer isn't giving any snapshot or stream output. I have no errors. Everything looks like it's working okay.

Note that I'm not getting a white screen. I'm getting no screen, no stream, no image, no nothing. The network port opens and then no data appears to be sent.

I suspect there may be a problem with recent mjpg-streamer builds?

(Last edited by jmomo on 21 May 2015, 06:22)

I have same problem only for me it wasn't fixed with fps, on 12.09 everything is working fine ... Is there any solution to fix it ?

Contrary to your experience, mjpg-streamer r182-1 is runnung under 14.07 here on a DIR-505.

The discussion might have continued from here.