the flicker in video might be due to lost frames - the vidcap0.1v reads only a frame at a time.
did try reading all available frames, heres the code snippet in case want to experiment:
Code:
struct {int first, last;} cur_frms;
output = open("out.yuv", O_RDWR|O_CREAT|O_TRUNC);
int bufsize = width * height * 2 * MAX_FRAMES;
buffer = malloc(bufsize);
int i;
for (i=0; i < 100; i++)
{
ioctl(videodev, WCAM_VIDIOCGCURFRMS, &cur_frms);
//if (i%10 == 0) printf("i=%d, cur_frms.first=%d, cur_frms.last = %d\n", \
i, cur_frms.first, cur_frms.last);
//if (cur_frms.first > cur_frms.last) continue;
n = read(videodev,buffer,bufsize);
while (1)
{
int frame_size = width * height * 2;
write(output, buffer+ cur_frms.first*frame_size, frame_size);
if (cur_frms.first == cur_frms.last) break;
else
{
cur_frms.first++;
if (cur_frms.first == MAX_FRAMES) cur_frms.first = 0;
}
}
//usleep(70000);
}
if (ioctl(videodev,VIDIOCCAPTURE, VIDEO_STOP) < 0) { perror("STOP VIDIOCCAPTURE"); exit(1); }
close(output);
close(videodev);
free(buffer);