Beaglebone not able to capture a frame from the camera
I'm running the Angstrom Distribution on a beaglebone (embedded linux platform) and am having some difficulty pulling a frame from the camera. I have done a decent amount of work with OpenCV on other platforms, but only using python.
In any case, this is as basic as I can illustrate the problem (I've also tried using "0", "1", & "2") for the CaptureFromCAM
argument.
root@beaglebone:/dev# python
Python 2.7.2 (default, Sep 11 2012, 16:15:43)
[GCC 4.5.4 20120305 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>> capture=cv.CaptureFromCAM(-1)
>>> img=cv.QueryFrame(capture)
>>> type(capture)
<type 'cv2.Capture'>
>>> type(img)
<type 'nonetype'="">
As you can see, I can create a capture object, but querying the frame doesn't seem to be working. I've tried this with a Logitech C210 and PS3 Eye with the same problems.
I've also tried to capture data using ffmpeg
in the following manner:
ffmpeg -f video4linux2 -r 25 -i /dev/video0 out.avi
Interestingly, if I try to pass a -t
(timeout) argument to ffmpeg
, it doesn't operate properly. The only way I was able to get the program to terminate properly (ie actually write the out.avi
file) was to disconnect the USB. Unfortunately, while this does write the output file, the file is only 5.7kb... blank.
Ultimately what I'm trying to do hear is capture a stream of video data that I can use for tracking... but pulling that first frame is the first hurdle.