title: keyframes from videofile - how to do fast extract in OpenCV?
body: <p>I know ffmpeg can do this from command line and almost sure it can do this from C++ code too. But is there any simple way in C++ OpenCV3 or OpenCV2 to grab from videofile  keyframes only?</p>
  
  <p><a href="http://code.opencv.org/issues/1419" rel="nofollow">Before</a> <code>video.set(CV_CAP_PROP_POS_FRAMES)</code> worked this way: position was "nearest keyframe", but now it is "fixed" and I can not find the way how to process keyframes only (for perfomance purpose) at least in one possible way:</p>
  
  <ul>
  <li>1st way : <code>read()</code> next <strong>key</strong>frame (like JavaCV <code>FFmpegFrameGrabber.grabKeyFrame()</code> )</li>
  <li>2nd way: do fast-working <code>grab()</code> for <strong>each</strong> frame, check it's propertie (which one?) and if it is keyframe then do slow-working <code>retrieve()</code> .</li>
  </ul>