March 2019
Intermediate to advanced
532 pages
13h 2m
English
To see how we can use the aforementioned properties, we are going to understand the read_video_file_backwards.py script, which uses some of these properties to load a video and output it backwards, showing the last frame of the video first and so on. We are going to use the following properties:
The first step is to get the index of the last frame:
# We get the index of the last frame of the video fileframe_index = capture.get(cv2.CAP_PROP_FRAME_COUNT) - 1
Therefore, we set the current frame to read to this position:
# We set the current frame position ...