- OpenCV 3 Computer Vision with Python Cookbook
- Alexey Spizhevoy Aleksandr Rybnikov
- 75字
- 2021-08-27 19:47:38
How it works...
Obtaining the video position and setting it is done using the cv2.CAP_PROP_POS_FRAMES property. Depending on the way a video is encoded, setting the property might not result in setting the exact frame index requested. The value to set must be within a valid range.
You should see the following output after running the program:
Frame count: 182
Position: 0
Position: 1
Position: 100
The following frames should be displayed:
![](https://epubservercos.yuewen.com/34A43F/19470396008899506/epubprivate/OEBPS/Images/8d41e6d5-e1bc-4080-8ddc-99c0b3484fa6.png?sign=1739516507-7FuaP7JFTPJQB4RaQBMvXqF96aflKNHy-0-56ce3d72fdca68a757ea769578ec8365)