Using python I would like to monitor a .avi raw RGB video file that is being written to the hard disk by another process at the time of recording. So what I need is something that repeatedly gives me the currently last frame (or n-th last frame) of the video file on the disk.
I tried using OpenCV for that already, this however gives me only the currently last frame once, any further calls of QueryFrame after reaching the last frame for the first time do not return further images.
So essentially I am looking for something like this, but for .avi video files. Additionally for me it is not a problem if frames are skipped, it would be enough to get a couple of new frames a second.
You must close the
.avi-file at the end of each loop-iteration and then reopen it.EDIT: art requested a code sample. Here it is.
I have no idea how OP uses the AVI format, but that wasn’t part of the question.