Getting individual frames using CV_CAP_PROP_POS_FRAMES in cvSetCaptureProperty

前端 未结 5 944
天命终不由人
天命终不由人 2020-12-15 09:00

I am trying to jump to a specific frame by setting the CV_CAP_PROP_POS_FRAMES property and then reading the frame like this:

cvSetCapturePropert         


        
5条回答
  •  有刺的猬
    2020-12-15 09:16

    I've successfully used the following on OpenCV 3 / Python 3:

     # Skip to 150 frame then read the 151th frame
     cap.set(cv2.CAP_PROP_POS_FRAMES, 150))
     ret, frame = cap.read()
    

提交回复
热议问题