Buffer error when using mjpg streamer with Yun

Hi guys,

I am trying to stream a video with my Microsoft LifeCam HD 3000 and Arduino Yun by following this tutorial:https://learn.adafruit.com/wireless-security-camera-arduino-yun/stream-video-to-youtube

I can successfully take still pictures, however when I try to use the mjpg_streamer to get the video stream with the command:

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

the webcam will shut down immediately with the following error displayed on the terminal console:

 o: www-folder-path...: /www/webcam/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled
Unable to requeue buffer: No such device
 i: Error grabbing frames

The same problem was also observed when I repetitively take photos. So I am assuming that when the webcam is constantly grabbing frames it will cause some errors in the buffer.

Has anyone seen this problem before or know where the problem might be? I have been stucked here for quite a long time, any help is greatly appreciated!

P.S. The Microsoft LifeCam HD 3000 is UVC compatible.

@forseqn, This appears to be a USB issue. Which is to say, it may NOT be related to YUN. It's hard to say. A quick look at the video2linux reference matix says some MS cameras have "race conditions". It's hard to say if this the issue in this case. USB is fairly stable, so I doubt it is the kernel. In any case, I have no clues - at this moment.

The only thing that comes to mind is that maybe MS changed the chip it uses now (for the camera), versus previous versions and this is causing the problem.

Jesse

jessemonroy650: @forseqn, This appears to be a USB issue. Which is to say, it may NOT be related to YUN. It's hard to say. A quick look at the video2linux reference matix says some MS cameras have "race conditions". It's hard to say if this the issue in this case. USB is fairly stable, so I doubt it is the kernel. In any case, I have no clues - at this moment.

The only thing that comes to mind is that maybe MS changed the chip it uses now (for the camera), versus previous versions and this is causing the problem.

Jesse

Hi Jesse,

Thanks for the reply! I also suspected that the camera might be the problem however I saw some posts say that ppl have been using this webcam to get successful output, so I just kind of ignored this potential cause. Since I have tried several different micro SD card and it is very unlikely that the problem is with the Yun or the software, maybe I will buy another camera and see how it goes. Do you have any suggestions for the webcam?

Since Yun's USB only has 4.5 V, put powered USB hub between Yun and webcam.

http://forum.arduino.cc/index.php?topic=305773.msg2124311#msg2124311

Use config file:

nano /etc/config/mjpg-streamer
config mjpg-streamer core
        option enabled          "1"
        option device           "/dev/video0"
        option resolution       "640x480"
        option fps              "30"
        option www              "/www/webcam"
        option port             "8080"

View static/stream/java/javascipt/videolan/control sample:

http://arduino.local:8080/

Microsoft LifeCam HD 3000 support 720p HD video.

after testing "640x480" working, change resolution.

...
option resolution       "1280x720"
option fps              "5"
...

forseqn: ::::SNIP:::: Do you have any suggestions for the webcam?

@forseqn, actually, the suggestion from Sonny Yu makes the most sense. It appears you do NOT have enough power available for the Camera. So, Sonny suggests you use a "powered" USB hub.

Sonny also suggests you create and use a config file - which makes good sense.

Jesse

sonnyyu: Since Yun's USB only has 4.5 V, put powered USB hub between Yun and webcam.

http://forum.arduino.cc/index.php?topic=305773.msg2124311#msg2124311

Use config file:

nano /etc/config/mjpg-streamer
config mjpg-streamer core
        option enabled          "1"
        option device           "/dev/video0"
        option resolution       "640x480"
        option fps              "30"
        option www              "/www/webcam"
        option port             "8080"

View static/stream/java/javascipt/videolan/control sample:

http://arduino.local:8080/

Thanks so much for your advice, now I can finally load the stream! However the video is very lagging (the images are tearing apart) and when the object in the video is moving too fast it will stop displaying in the preview window but the camera is still running. Refresh the page will bring back the video again but still lags. Am I missing some configuration parameters? I set the config file as you posted and tried various resolutions/frame rate/quality parameters but nothing changes. Do you have any idea what might be the problem here?

option fps              "30"

to

option fps              "10"
/etc/init.d/mjpg-streamer stop
/etc/init.d/mjpg-streamer start