motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

USB cameras (webcams) on Raspberry Pi

Mon Sep 16, 2013 8:03 pm

(EDIT: Updated post now that low light bug has been fixed)

I started this thread to let people know that some USB webcams do work with the Raspberry Pi, and in some cases may be a fit for your requirements. The camera board is a great product, and no doubt will get even better as the software matures, but based on your requirements, may or not be the best choice.

Camera Board Pros:
  • Software utilizes RPi GPU, so for example encoding h.264 video has low impact on CPU usage.
  • Excellent resolution (higher than most USB webcams) and excellent daytime image quality.
  • You are supporting an open source hardware project, and potentially encouraging future improvements.
Camera Board Cons:
  • Short, fragile, and inflexible ribbon cable. Camera board is best when camera will be mounted in the same box as the Raspberry Pi (or close by), ideally with everything but the lens internal to the box.
    No mounting hardware - you need to come up with something there (AdaFruit does sell a simple, fixed mounting bracket).
USB WebCam Board Pros:
  • Most have some sort of ball-head type mounting, which allows you to re-position the camera as needed.
  • Longer, flexible USB cable.
  • Many are supported by Video4Linux, which lets you use it with nice software like Motion and GStreamer (Note: RPi Camera Board reportedly now has some Video4Linux support under development).
USB WebCam Board Cons:
  • Typically slow, low frame rate video.
  • CPU usage can be quite high.
  • RPi does not have enough CPU horsepower to do higher frame rates, resolution, or advanced video compression. The Logitech C920 supports high frame rate hardware (in-camera) H.264 video encoding, but I experienced issues using this on the Raspberry Pi (may have been power related, though).
Last edited by motocoder on Tue Oct 01, 2013 2:17 pm, edited 1 time in total.

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 3:57 am

Interesting. I found the camera board was perfect for me, when I tried to use a usb cam for vid it was totally inadequate.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 4:44 am

How are you using the camera board - bright sunlight? What about the USB cam didn't work?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 7:01 am

motocoder wrote:After several weeks of frustration with the Raspberry Pi Camera, I gave up on it and switched to a USB webcam. For those considering the camera board, I recommend you look into USB cameras as an alternative.

The primary reason that I switched was that the Raspberry Pi camera board has extremely bad low light issues. Trying to take a photo indoors, even with significant incandescent light, was resulting in black frames about 9 out of 10 times. 1 out of 10 times, it would produce a slightly underexposed photo instead, leading me to believe this might be a software bug rather than a hardware issue. Posting a question about it here generated a grand total of zero responses.

Other complaints with the camera: a fragile inflexible ribbon cable, raw/uncovered poorly protected with no tilt/swivel mount, ESD sensitive hardware, and no Video4Linux support.

Now I am using a Microsoft Lifecam Cinema, which I had sitting around unused. It exposes the image perfectly, no more low light issues, and has a nice long and flexible USB cable that gives me many more mounting options. It also has a tilt/swivel mount for the camera body, so that I can easily aim it (not possible with the Raspicam unless build something yourself). I was able to use the Motion software package to do video streaming and image capture as well. It is considerably lower resolution than the camera board, but for my applications (streaming video remotely), that is a non-issue.

The Raspberry Pi is a great little computer, and since it is running Linux there is tons of support for hardware for it. Don't mistakenly think that the Raspberry Pi Camera Board is your only option - it's not.
Thanks for taking money away from a charity.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 8:12 am

jamesh wrote: Thanks for taking money away from a charity.
Sorry you see it that way. That wasn't my intent. I see it as potentially preventing someone from wasting his own money and time (like I did) on a camera and camera mount that won't take pictures in normal room light.

If/when the problem gets fixed, I'll be happy to come back here and post how it's all Unicorns and Rainbows, and how everyone should run out and buy one.

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 9:11 am

motocoder wrote:The primary reason that I switched was that the Raspberry Pi camera board has extremely bad low light issues. Trying to take a photo indoors, even with significant incandescent light, was resulting in black frames about 9 out of 10 times. 1 out of 10 times,
That's quite a statement to make, considering very few / no other people have similar problems with it !

I suspect you came across a recent bug surrounding a specific commandline option (the nopreview switch),
but there was a workaround at the time, and its fixed now.
no Video4Linux support.
That is a big problem IMO, but there is a 3rd party V4L driver here:
http://www.raspberrypi.org/phpBB3/viewt ... 43&t=50639
and an official driver is being written.
Now I am using a USB Microsoft Lifecam Cinema,[...] It is considerably lower resolution than the camera board, but for my applications (streaming video remotely), that is a non-issue.
There's the key point - a USB camera is unlikely to be as high quality or resolution as a the raspicam especially for video,
the raspicam does 30fps HD with no problem.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 9:18 am

motocoder wrote:
jamesh wrote: Thanks for taking money away from a charity.
Sorry you see it that way. That wasn't my intent. I see it as potentially preventing someone from wasting his own money and time (like I did) on a camera and camera mount that won't take pictures in normal room light.

If/when the problem gets fixed, I'll be happy to come back here and post how it's all Unicorns and Rainbows, and how everyone should run out and buy one.
Mine takes pictures fine in the office - normal room light. There are 'problems' with *very low light* rooms - when time allows I'll see if anything can be done, but it may be the sensor simply isn't that good at very low light - it's cheap and cheerful in that respect.

However, if you are seeing problems in normal indoor conditions, that is not an inherent problem with the device, since it works fine for others. Debug what you have first, if its still sucks, try something else.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 5:48 pm

james - thank you for your replies. My intent really isn't to bash the Raspberry Pi camera, nor the hard work you have done to bring it to market. My intent was to make people aware that USB cameras do work, and for some scenarios they may be a better fit. I totally agree that in image quality (absent any bugs with exposure), the Raspberry Pi camera is superior.

The issue I am seeing isn't a matter of poor quality of images in low light. I am an amateur photographer, and a EE, and I am totally aware of how gain/ISO impacts image noise. The issue is that the camera is not setting the right exposure, and so as a result the frame is black. It doesn't always do this (about 9 out of 10 times), and when it doesn't, you can see a slightly underexposed image, with the expected noise due to the high ISO and/or longer exposure time.

Regarding the amount of light, I live in the Pacific Northwest part of the United States, and during the fall and winter months, the days are shorter and always overcast. So dimly lit surroundings are the norm. The room the camera was in has a light fixture with 4x 60-watt bulbs in it - about 5 feet from the camera. I don't have any cameras, other than this one, that produce black frames in that situation.

My point is that it's clearly some sort of bug. The responses on the other thread indicate that I'm not the only one experiencing this.

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 5:55 pm

mikerr wrote: That's quite a statement to make, considering very few / no other people have similar problems with it !
Oh really? I suggest you read the replies on the thread where I inquired about the issue. I am most definitely not the only one having the problem.

http://www.raspberrypi.org/phpBB3/viewt ... 43&t=54902
mikerr wrote: I suspect you came across a recent bug surrounding a specific commandline option (the nopreview switch),
but there was a workaround at the time, and its fixed now.
I don't think so, because I tried it with and without the nopreview switch. I also varied the preview time, under the assumption that the camera exposure issue was related to bug in the software that allowed it to terminate when the preview time was up even if it hadn't finished the exposure. That did not solve my problem.
mikerr wrote:
no Video4Linux support.
That is a big problem IMO, but there is a 3rd party V4L driver here:
http://www.raspberrypi.org/phpBB3/viewt ... 43&t=50639
and an official driver is being written.
That's great news - thanks for sharing.
mikerr wrote:
Now I am using a USB Microsoft Lifecam Cinema,[...] It is considerably lower resolution than the camera board, but for my applications (streaming video remotely), that is a non-issue.
There's the key point - a USB camera is unlikely to be as high quality or resolution as a the raspicam especially for video,
the raspicam does 30fps HD with no problem.
Indeed, although for scenarios with limited bandwidth, it's a non-issue. I am able to stream low FPS video (via the Motion software's MJPEG support) from the USB camera. Much more than that isn't an option for remote viewing, at least with the bandwidth I have available in those scenarios.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 6:03 pm

motocoder wrote:james - thank you for your replies. My intent really isn't to bash the Raspberry Pi camera, nor the hard work you have done to bring it to market. My intent was to make people aware that USB cameras do work, and for some scenarios they may be a better fit. I totally agree that in image quality (absent any bugs with exposure), the Raspberry Pi camera is superior.

The issue I am seeing isn't a matter of poor quality of images in low light. I am an amateur photographer, and a EE, and I am totally aware of how gain/ISO impacts image noise. The issue is that the camera is not setting the right exposure, and so as a result the frame is black. It doesn't always do this (about 9 out of 10 times), and when it doesn't, you can see a slightly underexposed image, with the expected noise due to the high ISO and/or longer exposure time.

Regarding the amount of light, I live in the Pacific Northwest part of the United States, and during the fall and winter months, the days are shorter and always overcast. So dimly lit surroundings are the norm. The room the camera was in has a light fixture with 4x 60-watt bulbs in it - about 5 feet from the camera. I don't have any cameras, other than this one, that produce black frames in that situation.

My point is that it's clearly some sort of bug. The responses on the other thread indicate that I'm not the only one experiencing this.
That sort of light level should be fine. There does appear to be something wrong with your particular setup (bad install, bad camera module - you have installed the latest software I presume?), rather than the camera in general. What I don't know. Out of interest, do you know the lux of the scene?

As for other having the same issue, I think over 20k camera modules have been sold now, so you need quite a few people having the same problem to make it 'common'.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Tue Sep 17, 2013 10:16 pm

I don't have a light meter that will read that directly, but using my camera (OM-D EM-5) to check exposure, and some conversion charts online, it looks like it is around 1.5 EV, or around 7 lux.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Wed Sep 18, 2013 8:57 am

7 lux is pretty dim lighting - 1x40w bulb in a large room would be brighter. I'd not be expecting great pictures at that light level.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Wed Sep 18, 2013 9:41 am

Just for fun, here are some examples of the output of the Raspi camera, just so people realise it not all doom and gloom...these certainly wouldn't be possible using a USB camera.

http://www.flickr.com/photos/daveake/se ... 610850873/
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Arp
Posts: 26
Joined: Wed Sep 11, 2013 1:26 pm
Location: NRW, Germany

Re: Consider a USB camera as an alternative

Thu Sep 19, 2013 8:54 am

Funny... I started with a MS lifecam, but changed to the raspberry camera because the lifecam could not do what I wanted. I primarly use it to record video. Full HD, h264. Using ffmpeg on the raspberry, I never got more than 5 frames per second. The Raspberry Cam has no problem recording at 30 fps. I think if the 2x2 Binning finaly works, even the low light issues should be gone. Ok, in 2x2 Binning maybe only 720p is possible, but for me, the 30 fps (actually 25 would be enough) is more important then 720p or 1080p.

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 6:09 am

Well, I guess our requirements are different. For my purposes, 5 frames per second of legible video at all times of day or night, are vastly superior to 30 frames per second of black frames 16 hours a day. I can't express how much my frustration level has decreased, and my satisfaction with my project now that I am able to see clear video no matter what the ambient light is.

If I want h264 encoded video, I can use a Logitech C920 web cam, and get both high frame rate heavily encoded video as well as proper exposure, V4L2 support, and freedom from dealing with the frustration of pre-release-quality software. When the Raspicam software has stabilized, I'll be an enthusiastic user of it again. Right now that's just not the case.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 7:53 am

motocoder wrote:Well, I guess our requirements are different. For my purposes, 5 frames per second of legible video at all times of day or night, are vastly superior to 30 frames per second of black frames 16 hours a day. I can't express how much my frustration level has decreased, and my satisfaction with my project now that I am able to see clear video no matter what the ambient light is.

If I want h264 encoded video, I can use a Logitech C920 web cam, and get both high frame rate heavily encoded video as well as proper exposure, V4L2 support, and freedom from dealing with the frustration of pre-release-quality software. When the Raspicam software has stabilized, I'll be an enthusiastic user of it again. Right now that's just not the case.
Hmm. In your opinion. Most people are quite happy, try to not be so negative. You'll enjoy life better, and so will I.

I think you need to understand that the camera and it's software were developed by people for free, in their spare time. The Foundation didn't design the board, the Foundation didn't write the software (they did do a lot of other stuff related though). Being unrelentingly negative rather puts those people off from actually working on it. I know this, because various comments from various people mean I haven't bothered to do any work on the camera for some weeks. Just not worth the snide comments. I am very busy at work and home which also doesn't help of course.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

tenochtitlanuk
Posts: 155
Joined: Fri Jul 06, 2012 8:51 pm
Location: Taunton, Somerset, UK
Contact: Website

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 11:54 am

Go, jamesh! I'm one of the very happy people who got a Pi camera as soon as we could and are VERY happy with its ease-of-use and performance. Worked first-time and software has been improved. And most Pi-fans realise that the Pi developers & the Foundation are doing a fantastic job while holding down jobs and raising families.

It is very easy for forum contributors to express frustration, and to imply that something is not up-to-standard in hardware or software support. Sometimes they just need to throw money at another, more expensive solution on another platform. Pi is intended to INTRODUCE people to technology, not to provide the leading-edge performance.
Many of us look back to the days when the internet didn't exist. To find how to do things in the Sixties I had to go to libraries for reference books and read the ( then many) electronic magazines. We moved from valves to transistors to ic's to the Pi. My first computer 'camera' was made from a dynamic RAM i/c with its lid cracked off. Monochrome. Very hard to interface, etc. So you'll recognise why I at least am 110% satisfied!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 12:17 pm

tenochtitlanuk wrote:Go, jamesh! I'm one of the very happy people who got a Pi camera as soon as we could and are VERY happy with its ease-of-use and performance. Worked first-time and software has been improved. And most Pi-fans realise that the Pi developers & the Foundation are doing a fantastic job while holding down jobs and raising families.

It is very easy for forum contributors to express frustration, and to imply that something is not up-to-standard in hardware or software support. Sometimes they just need to throw money at another, more expensive solution on another platform. Pi is intended to INTRODUCE people to technology, not to provide the leading-edge performance.
Many of us look back to the days when the internet didn't exist. To find how to do things in the Sixties I had to go to libraries for reference books and read the ( then many) electronic magazines. We moved from valves to transistors to ic's to the Pi. My first computer 'camera' was made from a dynamic RAM i/c with its lid cracked off. Monochrome. Very hard to interface, etc. So you'll recognise why I at least am 110% satisfied!
Thanks! I am hoping to get some time on this stuff next week, so hopefully some news then. As to the Foundation, they have been busy, on various things, should be some good announcements in the next couple of months....no hints....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

SacredRose
Posts: 25
Joined: Mon Sep 02, 2013 8:39 am

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 1:06 pm

Thanks! I am hoping to get some time on this stuff next week, so hopefully some news then. As to the Foundation, they have been busy, on various things, should be some good announcements in the next couple of months....no hints....
sounds interesting jamesh.

and i really can't wait till my pi and camera arrive to try and have some fun with it.

and you shouldn't feel bad about negative stuff like this. just look at the amount of camera's sold and how many people are actually happy about it. it just is the that people with bad experience tend to stand out more because people who are happy can't really make a topic about it :p

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 1:37 pm

tenochtitlanuk wrote:Go, jamesh! I'm one of the very happy people who got a Pi camera as soon as we could and are VERY happy with its ease-of-use and performance. Worked first-time and software has been improved. And most Pi-fans realise that the Pi developers & the Foundation are doing a fantastic job while holding down jobs and raising families.
Ditto!
I personally love the way the open-source-ness of various parts (ignoring the GPU-side before the zelaots start flaming me!) and the way the devs are so open on the forums, means you get to learn lots of stuff that you'd never even get to hear about with off-the-shelf products. And of course potentially offers up lots more flexibility too! :D

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 3:27 pm

jamesh wrote: I think you need to understand that the camera and it's software were developed by people for free, in their spare time. The Foundation didn't design the board, the Foundation didn't write the software (they did do a lot of other stuff related though). Being unrelentingly negative rather puts those people off from actually working on it. I know this, because various comments from various people mean I haven't bothered to do any work on the camera for some weeks. Just not worth the snide comments. I am very busy at work and home which also doesn't help of course.
I understand that it's an open source effort (excepting the GPU code, which seems likely to be where the bug is here). Again, my point wasn't to bash the work you or others have done, but to let people who need exposures in non-brightly lit scenes know that there is a problem, and that there is an alternative. In other words, to save others unnecessary expense and frustration.

I spent $35 for a camera, and then another $10 or so for a camera mount, and then spent a day or two writing software to control the raspistill process, do the motion detect, etc, eventually to have to throw all that away because the camera just doesn't work in low light. I'm just trying to warn others about the problem, so that they can not have to go through that themselves, and can either use one of the alternatives, wait for a fix, or at least go into it with their eyes open.

You seem to have taken this as a personal affront to you and your work, but, again, that is not the intent. It's totally unreasonable for you to expect or demand that people not communicate to others that there IS a problem. I'm sure you'll want to have the last word, but since you are getting rather nasty, this will be my last reply to you on the topic.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 3:51 pm

motocoder wrote:
jamesh wrote: I think you need to understand that the camera and it's software were developed by people for free, in their spare time. The Foundation didn't design the board, the Foundation didn't write the software (they did do a lot of other stuff related though). Being unrelentingly negative rather puts those people off from actually working on it. I know this, because various comments from various people mean I haven't bothered to do any work on the camera for some weeks. Just not worth the snide comments. I am very busy at work and home which also doesn't help of course.
I understand that it's an open source effort (excepting the GPU code, which seems likely to be where the bug is here). Again, my point wasn't to bash the work you or others have done, but to let people who need exposures in non-brightly lit scenes know that there is a problem, and that there is an alternative. In other words, to save others unnecessary expense and frustration.

I spent $35 for a camera, and then another $10 or so for a camera mount, and then spent a day or two writing software to control the raspistill process, do the motion detect, etc, eventually to have to throw all that away because the camera just doesn't work in low light. I'm just trying to warn others about the problem, so that they can not have to go through that themselves, and can either use one of the alternatives, wait for a fix, or at least go into it with their eyes open.

You seem to have taken this as a personal affront to you and your work, but, again, that is not the intent. It's totally unreasonable for you to expect or demand that people not communicate to others that there IS a problem. I'm sure you'll want to have the last word, but since you are getting rather nasty, this will be my last reply to you on the topic.
Nasty? Really? I'm simply pointing out that development time is limited (i.e. me), and that saying "frustration of pre-release-quality software. When the Raspicam software has stabilized..." is counter productive (at least where I am concerned). The software is actually pretty stable - it doesn't crash as long as all the HW is working OK, there are issues with some parts of it that are in the bug list, but in general, it's working. There's nothing really nasty causing problems, and the current bug list is pretty short and contains mainly minor bugs or feature requests (exposure is the biggy). There have been some splendid pictures taken since the camera came out, and to accuse it of being pre-release quality simple because it doesn't do exactly what you want, is , for want of a better word, the nasty part of this thread.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Fri Sep 20, 2013 4:33 pm

Just out of interest, does setting fps at 5 or so improve the low light performance? Note that at 30fps you only have 33ms per frame, which is not a lot of time to gather photons, but I'm not sure if reducing the frame rate does improve the exposure time. I woudl think the major benefit you are seeing on a webcam is simply that its running at a low frame rate. Webcams, I believe, use variable frame rate, since they are not bothered about maintaining a fixed rate, which we are. So in darker conditions the rate is lowered to help exposure times.

If setting a low fps (e.g. -fps 5) doesn't help, there is an issue there because I would expect it to improve the low light performance.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

motocoder
Posts: 29
Joined: Fri Sep 06, 2013 4:13 pm

Re: Consider a USB camera as an alternative

Sat Sep 21, 2013 4:41 am

jamesh wrote:Just out of interest, does setting fps at 5 or so improve the low light performance? Note that at 30fps you only have 33ms per frame, which is not a lot of time to gather photons, but I'm not sure if reducing the frame rate does improve the exposure time. I woudl think the major benefit you are seeing on a webcam is simply that its running at a low frame rate. Webcams, I believe, use variable frame rate, since they are not bothered about maintaining a fixed rate, which we are. So in darker conditions the rate is lowered to help exposure times.

If setting a low fps (e.g. -fps 5) doesn't help, there is an issue there because I would expect it to improve the low light performance.
Hi jamesh -

It probably wasn't clear from my brief description, but I wasn't capturing video, but rather still images. And in fact, I was spawning a process to run raspistill for each frame rather than using time lapse. What the code (was) doing is this:

while motion capture enabled:
Spawn raspistill to capture a single low-res mage.
Compare captured low-res image with previous image to detect motion
If motion is detected
spawn raspistill to capture a single higher res (only about 640x480) image.
Wait for 0.5 seconds

So it is generally quite a it less than 2 FPS. Even when the motion capture feature is disabled, the website has a button to trigger a manual image capture. And I saw the issue even when using that feature, so I don't think the problem was the frequency of captures. I have some time this weekend to hook the board up to my other Raspberry Pi, so please let me know if there is any additional info I can provide or things you want me to try. I was planning on running apt-get update/upgrade, rebooting, and trying some simple captures using raspistill from the command line.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: Consider a USB camera as an alternative

Sat Sep 21, 2013 7:33 am

That's not going to work very well. Stills takes over a second to start the camera, adjust exposure, take picture, shut down camera.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Camera board”