这是来自 O'Reilly Learning Opencv 的代码片段,
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。我在 Yahoo 中搜索了 opencv 组,发现了同样的问题。