Camera on beagle board

Hi ,

I am working on program to grab the frames from camera(logitech) and
save frames as images continuously , when I compile and run on linux
machine its working fine.I have compiled OpenCV library and written
program using open CV lib functions.

When I try to run on beagle board I am getting error like

Camera decode error(-1) : Corrupt JPEG data

Thank you,
Srikanth

sri wrote:

Hi ,

I am working on program to grab the frames from camera(logitech) and
save frames as images continuously , when I compile and run on linux
machine its working fine.I have compiled OpenCV library and written
program using open CV lib functions.

When I try to run on beagle board I am getting error like

Camera decode error(-1) : Corrupt JPEG data

<http://www.google.com/search?hl=en&q="Camera+decode+error"(-1)+%3A"Corrupt+JPEG+data"&aq=f&oq=&aqi=>

Can i have a look on your application to comment more

Hi suresh,

Initial 3 to 6 frames are decoded and stored successfully,after that I
am getting error like
Camera decode error(-1): JPEG decode error.

// A Simple Camera Capture Framework
int main() {
     int i = 0 ;
    IplImage *frame , *frames[10];
    char image[50];
  CvCapture* capture = cvCaptureFromCAM( -1 );
  if( !capture ) {
    fprintf( stderr, "ERROR: capture is NULL \n" );
    getchar();
    return -1;
  }
for (i = 0 ; i < 10 ; i++) {
  // Get one frame
     frame = cvQueryFrame( capture );
    if( !frame ) {
      fprintf( stderr, "ERROR: frame is null...\n" );
      getchar();
      break;
            }
    // Do not release the frame!
if( i < 10 ) {
        frames[i] = cvCloneImage( frame );
        sprintf( image, "%d.png", (i+1) );
       cvSaveImage( image, frames[i],0);
    }
    if( (cvWaitKey(1000) & 255) == 27 ) break;
  }
   cvReleaseCapture( &capture );
  cvDestroyWindow( "mywindow" );
  return 0;
}

Thank you,
Srikanth