4

I want to capture a USB webcam with my RPI2. I'm using a Microsoft Lifecam HD-3000.

The problem is that I can't get 30 FPS with a resolution 640x480. I think this is abnormal for a quad-core CPU.

On the RPI2 I get between 14-18 FPS and I'm not even saving the capture to a file.

I tested in console mode with avconv and also in the gui with luvcview.

luvcview -i 30 -s 640x480
or

avconv -f video4linux2 -input_format mjpeg -s 640x480 -r 30 -i /dev/video0 -y t1.avi

or
avconv -f video4linux2 -input_format yuyv422 -s 640x480 -r 30 -i /dev/video0 -y t2.avi

The Microsoft HD-3000 webcam has the following capabilites:

ffmpeg -f v4l2 -list_formats all -i /dev/video0

Raw: yuyv422 : YUV 4:2:2 (YUYV) : 640x480 1280x720 960x544 800x448 640x360 424x240 352x288 320x240 800x600 176x144 160x120 1280x800

Compressed: mjpeg : MJPEG : 640x480 1280x720 960x544 800x448 640x360 800x600 416x240 352x288 176x144 320x240 160x120

I also tested the same webcam on a dual core (Celeron) laptop running Ubuntu 14.04 and I get 30 FPS at 1280x720. So, I don't think the problem is with the webcam.

Is this normal for the RPI2 ? What could cause this low FPS ?

ssinfod
  • 596
  • 3
  • 10
  • 20

1 Answers1

7

Most probably, bottle neck in this case is CPU speed to process the feed.

I use Rpi for some basic image processing based automation work and here is what I've noticed.

  1. Rpi 1 hardly gives 5 fps at max @ 640x480. Blame single core @ 700 Mhz
  2. Rpi 2 gives about 14 - 16 fps at 640x480. (Quad core @ 900 Mhz)
  3. I've used Odriod-C1 (SBC mostly similar to Rpi 2 - Cortex A7 CPU @ 1.5 Ghz, Quad core) and BBB (BeagleBoard Black; single core, Cortex A7 - @ 1 Ghz) with USB cam as well just for the sake of comparison. Odriod seems to be giving the best performance (20 fps @ 640 x 480) and BBB gives you around 10 - 12 fps @ 640 x 480.

I believe from my experiments that upto some point, USB speeds doesn't play a significant part but as soon as you move towards high resolutions, you can't ignore it. Try connecting USB webcam on a ubuntu machine and try capturing @ 1024 x 768 or higher.

It would be also worth to note that Rpi camera module easily performs about 30 fps @ 720p mainly because it uses internal CSI bus and uses GPU core for encoding the feed.

Hope this comparison helps.

Phil B.
  • 5,053
  • 17
  • 30
dhruvvyas90
  • 2,883
  • 3
  • 21
  • 33