Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Read frame by frame VC++

How do read a particular frame from a capute file

Current Code:

cvSetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES, trackBar2); // set to value of trackBar frame = cvQueryFrame(capture); label8->Text = "Frame No.: " + (int)cvGetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES) + " trackBar2->value: " + trackBar2->Value ;

It seems the (int(cvGetCaptureProperty(capture, CV_CAP_PROP_POS_Frames) doesn't give the next or prior frame when I adjust the trackBar2 which step back or forward by 1. It seems the trackBar2-Value increment correctly by 1 or -1 (depending on the scroll) but the CV_CAP_PROP_POS_Frames a random value.

Read frame by frame VC++

How do read a particular frame from a capute file

Current Code:

cvSetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES, trackBar2); // set to value of trackBar
frame =  cvQueryFrame(capture); 
label8->Text = "Frame No.: " + (int)cvGetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES) + " trackBar2->value: " + trackBar2->Value ;

;

It seems the (int(cvGetCaptureProperty(capture, CV_CAP_PROP_POS_Frames) doesn't give the next or prior frame when I adjust the trackBar2 which step back or forward by 1. It seems the trackBar2-Value increment correctly by 1 or -1 (depending on the scroll) but the CV_CAP_PROP_POS_Frames a random value.