Ask Your Question
0

Read and Display RGB video file using opencv2.2

asked 2013-04-07 00:14:43 -0600

jay_sil_viper gravatar image

updated 2013-04-07 00:15:39 -0600

Hey Guys, I have an Uncompressed RGB video file. The extension is (.rgb)

I am not able to read and display the video. I am not able to even grab the frame .

cvNamedWindow( “Example2”, CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCreateFileCapture( "test.rgb" );
IplImage* frame;
while(1) {
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( “Example2”, frame );
char c = cvWaitKey(33);
if( c == 27 )
 break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( “Example2” );
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2013-04-07 02:38:02 -0600

First of all, I highly recommend using the C++ interface when using images and video's. It basically helps you with releasing resources and such. This would turn your code into something like this:

NamedWindow( “Example2”, CV_WINDOW_AUTOSIZE );
VideoCapture capture = VideoCapture( "C://absolute_link_to_video_file.rgb" );
Mat frame;
while(1) {
    frame = read( capture );
    imshow( “Example Image C++ style”, frame );
    WaitKey(10);
    if( !frame ) break;
}

More information about the functions can be used here:

http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html

Can you go and try this. Basically if this code does not work, then just place a debug point at the frame read function and see if it is throwing information back. If not, then probably the *.rgb type is not supported in OpenCV.

edit flag offensive delete link more

Comments

1

I've pretty much tried everything... I am going to try what you just posted and try to paste the debug statements.... Thanks...

jay_sil_viper gravatar imagejay_sil_viper ( 2013-04-07 12:47:21 -0600 )edit

Question Tools

Stats

Asked: 2013-04-07 00:14:43 -0600

Seen: 1,724 times

Last updated: Apr 07 '13