這是來自O'Reilly的opencv學習的代碼片段,對於CV_CAP_PROP_FRAME_COUNT,cvGetCaptureProperty始終返回0!
cvNamedWindow("Example3", CV_WINDOW_AUTOSIZE);
g_capture = cvCreateFileCapture(argv[1]);
int frames = (int) cvGetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_COUNT);
if (frames != 0) {
cvCreateTrackbar("Position", "Example3", &g_slider_postion, frames, onTrackbarSlide);
}
但不幸的是,cvGetCaptureProperty始終返回0找遍了OpenCV的組中的雅虎,發現了同樣的問題。