title: How to find the length of a video in OpenCV?
body: <p>I want to find the length of a video capture in OpenCV;</p>
  
  <pre><code>int frameNumbers = (int) cvGetCaptureProperty(video2, CV_CAP_PROP_FRAME_COUNT);
  int fps = (int) cvGetCaptureProperty(video2, CV_CAP_PROP_FPS);
  int videoLength = frameNumbers / fps;
  </code></pre>
  
  <p>but this give me a result which is less than the real answer. What do I have to do?</p>