Webcam + LibAV
Posted: Mon Feb 25, 2013 1:22 pm
Hello everyone!
I'm working on a robotics project which aims to use the Raspberry for computing visual SLAM calculations, and now I'm trying to get my webcam (a Logitech C270) to work -- and before you ask, yes, it is plugged into a powered USB hub.
I've also stumbled in the issues described in this thread, so I'm looking for alternate ways to receive a stream from the camera.
After loading the uvcvideo module with the "nodrop=1" option, avplay gives me a solid 432x240@15 FPS output with this command:
Also, trying fswebcam, I get good quality images, even at higher resolutions:
So, since OpenCV's camera does not work properly, I tried to write a C++ class which uses the libav* libraries to get a frame from the camera stream, and convert it to a jpeg image. This class works perfectly if tested on my development machine (a laptop with Xubuntu 12.10 64 bit) using the same camera, but it returns garbled green frames if used on the RasPi, stuff like this:

What do you think is wrong?
I'm working on a robotics project which aims to use the Raspberry for computing visual SLAM calculations, and now I'm trying to get my webcam (a Logitech C270) to work -- and before you ask, yes, it is plugged into a powered USB hub.
I've also stumbled in the issues described in this thread, so I'm looking for alternate ways to receive a stream from the camera.
After loading the uvcvideo module with the "nodrop=1" option, avplay gives me a solid 432x240@15 FPS output with this command:
Code: Select all
avplay -f video4linux2 -video_size=432x240 /dev/video0Code: Select all
fswebcam -r 800x600 testfs.jpg

What do you think is wrong?