Slow image capture using mmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi,

I can only capture 8-10 fps regardless of image
size using the bttv drivers and the v4l interface.

The type of card I have is an Osprey 100.  The device 
driver does not support read captures, so I have to
use mmap.  Here is the gist of my code:


fd = open(/dev/video0, O_RDONLY);

video_picture.depth = 24;
video_picture.format = VIDEO_PALETTE_RGB24
ioctl (fd, VIDIOCGPICT, *video_picture);

video_window.width = 176;
video_window.height = 144;
ioctl (fd, VIDIOCSWIN, *video_window);

//MMAP will only grant me enough memory for 2 frames
//no matter what my arguments are
unsigned char* data = 
   mmap(0, 152064,PROT_READ,MAP_SHARED,fd,0);


//Capture Loop
ioctl(fd,VIDIOCMCAPTURE, *video_mmap);
ioctl(fd,VIDIOCSYNC, &ONE);
<memcpy buffer 1>
ioctl(fd,VIDIOCMCAPTURE, *video_mmap);
ioctl(fd,VIDIOCSYNC, &TWO);
<memcpy buffer 2>

After each second I check the number of frames
I have been able to copy.  Its always 8-10.  If
anyone sees a problem, please let me know.
Thanks.

-kali





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux