Python OpenCv how do I detect when a video finishes playing?
10,565
check this link out. You can use the identifier CV_CAP_PROP_FRAME_COUNT
to get the Number of frames in the video file.
Author by
Egor. L
Updated on June 04, 2022Comments
-
Egor. L almost 2 years
I am using Python 3.5 and Opencv for an interactive video. However I can't figure out how to detect when my video finishes playing. Any ideas how I can detect when the video ends?
Thanks a bunch.
-
Egor. L over 6 yearsThank you, so I tried to do that but then it says that
CV_CAP_PROP_FRAME_COUNT
is not defined:NameError: name 'CV2_CAP_PROP_POS_FRAMES' is not defined
. Do you maybe know how to fix this?